From 869c3b4ef18d549b4484e278c6fcd8781d2bf3f3 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 30 Nov 2009 00:11:27 -0500 Subject: [PATCH] remove PlotKit entirely. Yay! --- plotkit_v091/COPYING | 28 - plotkit_v091/PlotKit/Base.js | 264 ---- plotkit_v091/PlotKit/Canvas.js | 242 ---- plotkit_v091/PlotKit/EasyPlot.js | 161 --- plotkit_v091/PlotKit/Layout.js | 132 -- plotkit_v091/PlotKit/PlotKit.js | 151 -- plotkit_v091/PlotKit/PlotKit_Packed.js | 2177 ----------------------------- plotkit_v091/PlotKit/SVG.js | 705 ---------- plotkit_v091/PlotKit/SweetCanvas.js | 348 ----- plotkit_v091/PlotKit/SweetSVG.js | 247 ---- plotkit_v091/PlotKit/dummy.svg | 9 - plotkit_v091/PlotKit/excanvas.js | 723 ---------- plotkit_v091/README | 1 - plotkit_v091/doc/MochiKitAdditions.html | 2 - plotkit_v091/doc/MochiKitAdditions.txt | 2 - plotkit_v091/doc/PlotKit.Base.html | 302 ---- plotkit_v091/doc/PlotKit.Base.txt | 139 -- plotkit_v091/doc/PlotKit.Canvas.html | 172 --- plotkit_v091/doc/PlotKit.Canvas.txt | 81 -- plotkit_v091/doc/PlotKit.EasyPlot.html | 155 -- plotkit_v091/doc/PlotKit.EasyPlot.txt | 50 - plotkit_v091/doc/PlotKit.Layout.html | 428 ------ plotkit_v091/doc/PlotKit.Layout.txt | 330 ----- plotkit_v091/doc/PlotKit.QuickStart.html | 368 ----- plotkit_v091/doc/PlotKit.QuickStart.txt | 256 ---- plotkit_v091/doc/PlotKit.Renderer.html | 436 ------ plotkit_v091/doc/PlotKit.Renderer.txt | 299 ---- plotkit_v091/doc/PlotKit.SVG.html | 159 --- plotkit_v091/doc/PlotKit.SVG.txt | 64 - plotkit_v091/doc/PlotKit.SweetCanvas.html | 131 -- plotkit_v091/doc/PlotKit.SweetCanvas.txt | 34 - plotkit_v091/doc/PlotKit.SweetSVG.html | 131 -- plotkit_v091/doc/PlotKit.SweetSVG.txt | 34 - plotkit_v091/doc/PlotKit.html | 334 ----- plotkit_v091/doc/PlotKit.txt | 151 -- plotkit_v091/doc/SVGCanvasCompat.html | 304 ---- plotkit_v091/doc/SVGCanvasCompat.txt | 144 -- plotkit_v091/doc/barsample.png | Bin 2752 -> 0 bytes plotkit_v091/doc/black.png | Bin 262 -> 0 bytes plotkit_v091/doc/blue.png | Bin 329 -> 0 bytes plotkit_v091/doc/cyan.png | Bin 268 -> 0 bytes plotkit_v091/doc/doc.css | 62 - plotkit_v091/doc/generate.py | 37 - plotkit_v091/doc/green.png | Bin 277 -> 0 bytes plotkit_v091/doc/orange.png | Bin 274 -> 0 bytes plotkit_v091/doc/piesample.png | Bin 15399 -> 0 bytes plotkit_v091/doc/purple.png | Bin 273 -> 0 bytes plotkit_v091/doc/red.png | Bin 280 -> 0 bytes plotkit_v091/scripts/pack.py | 58 - plotkit_v091/tests/axis.html | 31 - plotkit_v091/tests/basic.html | 25 - plotkit_v091/tests/basic.js | 143 -- plotkit_v091/tests/debug.html | 56 - plotkit_v091/tests/demo-svg.html | 58 - plotkit_v091/tests/demo-svg.js | 133 -- plotkit_v091/tests/demo.html | 57 - plotkit_v091/tests/demo.js | 136 -- plotkit_v091/tests/dynamic.html | 161 --- plotkit_v091/tests/img/firefox.png | Bin 1198 -> 0 bytes plotkit_v091/tests/img/konqueror.png | Bin 7776 -> 0 bytes plotkit_v091/tests/img/mozilla.ico | Bin 1406 -> 0 bytes plotkit_v091/tests/img/msie.gif | Bin 1556 -> 0 bytes plotkit_v091/tests/img/opera.ico | Bin 3638 -> 0 bytes plotkit_v091/tests/img/safari.gif | Bin 1166 -> 0 bytes plotkit_v091/tests/labels-img.html | 38 - plotkit_v091/tests/labels.html | 43 - plotkit_v091/tests/prototype_compat.html | 28 - plotkit_v091/tests/quickstart-easy.html | 29 - plotkit_v091/tests/quickstart-horiz.html | 53 - plotkit_v091/tests/quickstart-neg.html | 29 - plotkit_v091/tests/quickstart-svg.html | 61 - plotkit_v091/tests/quickstart.html | 57 - plotkit_v091/tests/sample.txt | 6 - plotkit_v091/tests/svg-sweet.html | 29 - plotkit_v091/tests/svg-sweet.js | 141 -- plotkit_v091/tests/svg.html | 26 - plotkit_v091/tests/svg.js | 147 -- plotkit_v091/tests/sweet.html | 24 - plotkit_v091/tests/sweet.js | 89 -- plotkit_v091/tests/tests.css | 66 - plotkit_v091/tests/testsvg.html | 20 - plotkit_v091/tests/testsvg.js | 31 - 82 files changed, 11568 deletions(-) delete mode 100644 plotkit_v091/COPYING delete mode 100644 plotkit_v091/PlotKit/Base.js delete mode 100644 plotkit_v091/PlotKit/Canvas.js delete mode 100644 plotkit_v091/PlotKit/EasyPlot.js delete mode 100644 plotkit_v091/PlotKit/Layout.js delete mode 100644 plotkit_v091/PlotKit/PlotKit.js delete mode 100644 plotkit_v091/PlotKit/PlotKit_Packed.js delete mode 100644 plotkit_v091/PlotKit/SVG.js delete mode 100644 plotkit_v091/PlotKit/SweetCanvas.js delete mode 100644 plotkit_v091/PlotKit/SweetSVG.js delete mode 100644 plotkit_v091/PlotKit/dummy.svg delete mode 100644 plotkit_v091/PlotKit/excanvas.js delete mode 100644 plotkit_v091/README delete mode 100644 plotkit_v091/doc/MochiKitAdditions.html delete mode 100644 plotkit_v091/doc/MochiKitAdditions.txt delete mode 100644 plotkit_v091/doc/PlotKit.Base.html delete mode 100644 plotkit_v091/doc/PlotKit.Base.txt delete mode 100644 plotkit_v091/doc/PlotKit.Canvas.html delete mode 100644 plotkit_v091/doc/PlotKit.Canvas.txt delete mode 100644 plotkit_v091/doc/PlotKit.EasyPlot.html delete mode 100644 plotkit_v091/doc/PlotKit.EasyPlot.txt delete mode 100644 plotkit_v091/doc/PlotKit.Layout.html delete mode 100644 plotkit_v091/doc/PlotKit.Layout.txt delete mode 100644 plotkit_v091/doc/PlotKit.QuickStart.html delete mode 100644 plotkit_v091/doc/PlotKit.QuickStart.txt delete mode 100644 plotkit_v091/doc/PlotKit.Renderer.html delete mode 100644 plotkit_v091/doc/PlotKit.Renderer.txt delete mode 100644 plotkit_v091/doc/PlotKit.SVG.html delete mode 100644 plotkit_v091/doc/PlotKit.SVG.txt delete mode 100644 plotkit_v091/doc/PlotKit.SweetCanvas.html delete mode 100644 plotkit_v091/doc/PlotKit.SweetCanvas.txt delete mode 100644 plotkit_v091/doc/PlotKit.SweetSVG.html delete mode 100644 plotkit_v091/doc/PlotKit.SweetSVG.txt delete mode 100644 plotkit_v091/doc/PlotKit.html delete mode 100644 plotkit_v091/doc/PlotKit.txt delete mode 100644 plotkit_v091/doc/SVGCanvasCompat.html delete mode 100644 plotkit_v091/doc/SVGCanvasCompat.txt delete mode 100644 plotkit_v091/doc/barsample.png delete mode 100644 plotkit_v091/doc/black.png delete mode 100644 plotkit_v091/doc/blue.png delete mode 100644 plotkit_v091/doc/cyan.png delete mode 100644 plotkit_v091/doc/doc.css delete mode 100755 plotkit_v091/doc/generate.py delete mode 100644 plotkit_v091/doc/green.png delete mode 100644 plotkit_v091/doc/orange.png delete mode 100644 plotkit_v091/doc/piesample.png delete mode 100644 plotkit_v091/doc/purple.png delete mode 100644 plotkit_v091/doc/red.png delete mode 100755 plotkit_v091/scripts/pack.py delete mode 100644 plotkit_v091/tests/axis.html delete mode 100644 plotkit_v091/tests/basic.html delete mode 100644 plotkit_v091/tests/basic.js delete mode 100644 plotkit_v091/tests/debug.html delete mode 100644 plotkit_v091/tests/demo-svg.html delete mode 100644 plotkit_v091/tests/demo-svg.js delete mode 100644 plotkit_v091/tests/demo.html delete mode 100644 plotkit_v091/tests/demo.js delete mode 100644 plotkit_v091/tests/dynamic.html delete mode 100644 plotkit_v091/tests/img/firefox.png delete mode 100644 plotkit_v091/tests/img/konqueror.png delete mode 100644 plotkit_v091/tests/img/mozilla.ico delete mode 100644 plotkit_v091/tests/img/msie.gif delete mode 100644 plotkit_v091/tests/img/opera.ico delete mode 100644 plotkit_v091/tests/img/safari.gif delete mode 100644 plotkit_v091/tests/labels-img.html delete mode 100644 plotkit_v091/tests/labels.html delete mode 100644 plotkit_v091/tests/prototype_compat.html delete mode 100644 plotkit_v091/tests/quickstart-easy.html delete mode 100644 plotkit_v091/tests/quickstart-horiz.html delete mode 100644 plotkit_v091/tests/quickstart-neg.html delete mode 100644 plotkit_v091/tests/quickstart-svg.html delete mode 100644 plotkit_v091/tests/quickstart.html delete mode 100644 plotkit_v091/tests/sample.txt delete mode 100644 plotkit_v091/tests/svg-sweet.html delete mode 100644 plotkit_v091/tests/svg-sweet.js delete mode 100644 plotkit_v091/tests/svg.html delete mode 100644 plotkit_v091/tests/svg.js delete mode 100644 plotkit_v091/tests/sweet.html delete mode 100644 plotkit_v091/tests/sweet.js delete mode 100644 plotkit_v091/tests/tests.css delete mode 100644 plotkit_v091/tests/testsvg.html delete mode 100644 plotkit_v091/tests/testsvg.js diff --git a/plotkit_v091/COPYING b/plotkit_v091/COPYING deleted file mode 100644 index b6153f2..0000000 --- a/plotkit_v091/COPYING +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2006, Alastair Tse -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of the Alastair Tse nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/plotkit_v091/PlotKit/Base.js b/plotkit_v091/PlotKit/Base.js deleted file mode 100644 index e672c0f..0000000 --- a/plotkit_v091/PlotKit/Base.js +++ /dev/null @@ -1,264 +0,0 @@ -/* - PlotKit - ======= - PlotKit is a collection of Javascript classes that allows - you to quickly visualise data using different types of charts. - - For license/info/documentation: http://www.liquidx.net/plotkit/ - - Copyright - --------- - Copyright 2005,2006 (c) Alastair Tse - For use under the BSD license. -*/ - -// -------------------------------------------------------------------- -// Check required components -// -------------------------------------------------------------------- - -try { - if (typeof(MochiKit.Base) == 'undefined' || - typeof(MochiKit.DOM) == 'undefined' || - typeof(MochiKit.Color) == 'undefined') - { - throw ""; - } -} -catch (e) { - throw "PlotKit depends on MochiKit.{Base,Color,DOM}" -} - -// ------------------------------------------------------------------- -// Define our own PlotKit namespace -// ------------------------------------------------------------------- - -if (typeof(PlotKit) == 'undefined') { - PlotKit = {}; -} - -PlotKit.NAME = "PlotKit"; -PlotKit.VERSION = "0.8"; -PlotKit.__repr__ = function() { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.toString = function() { - return this.__repr__(); -} - -// ------------------------------------------------------------------- -// Encapsulate all our utility function into it's own namespace. -// ------------------------------------------------------------------- - -if (typeof(PlotKit.Base) == 'undefined') { - PlotKit.Base = {}; -} - -PlotKit.Base.NAME = 'PlotKit.Base'; -PlotKit.Base.VERSION = PlotKit.VERSION; - -PlotKit.Base.__repr__ = function() { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.Base.toString = function() { - return this.__repr__(); -} - - -// Detect whether we are using prototype.js -PlotKit.Base.usingPrototype = function() { - try { - return (typeof(Object.extend) == 'function'); - } - catch (e) { - return false; - } -} - - -MochiKit.Base.update(PlotKit.Base, { - collapse: function(lst) { - var m = MochiKit.Base; - var biggerList = new Array(); - for (var i = 0; i < lst.length; i++) { - biggerList = m.concat(biggerList, lst[i]); - } - if (PlotKit.Base.usingPrototype()) { - delete biggerList.extend; - delete biggerList.from; - delete biggerList.inspect; - } - - return biggerList; - }, - - uniq: function(sortedList) { - // get unique elements in list, exactly the same as unix shell's uniq. - var m = MochiKit.Base; - - if (!m.isArrayLike(sortedList) || (sortedList.length < 1)) - return new Array(); - - var uniq = new Array(); - var lastElem = sortedList[0]; - uniq.push(sortedList[0]); - for (var i = 1; i < sortedList.length; i++) { - if (m.compare(sortedList[i], lastElem) != 0) { - lastElem = sortedList[i]; - uniq.push(sortedList[i]); - } - } - return uniq; - }, - - - palette: function(baseColor, fromLevel, toLevel, increment) { - var isNil = MochiKit.Base.isUndefinedOrNull; - var fractions = new Array(); - if (isNil(increment)) - increment = 0.1; - if (isNil(toLevel)) - toLevel = 0.4; - if (isNil(fromLevel)) - fromLevel = -0.2; - - var level = fromLevel; - while (level <= toLevel) { - fractions.push(level); - level += increment; - } - - var makeColor = function(color, fraction) { - return color.lighterColorWithLevel(fraction); - }; - return MochiKit.Base.map(partial(makeColor, baseColor), fractions); - }, - - excanvasSupported: function() { - if (/MSIE/.test(navigator.userAgent) && !window.opera) { - return true; - } - return false; - }, - - // The following functions are from quirksmode.org - // http://www.quirksmode.org/js/findpos.html - - findPosX: function(obj) { - var curleft = 0; - if (obj.offsetParent) { - while (obj.offsetParent) { - curleft += obj.offsetLeft - obj = obj.offsetParent; - } - } - else if (obj.x) - curleft += obj.x; - return curleft; - }, - - findPosY: function(obj) { - var curtop = 0; - if (obj.offsetParent) { - while (obj.offsetParent) { - curtop += obj.offsetTop - obj = obj.offsetParent; - } - } - else if (obj.y) - curtop += obj.y; - return curtop; - }, - - isFuncLike: function(obj) { - return (typeof(obj) == 'function'); - } -}); - -// -// Prototype.js aware (crippled) versions of map and items. -// - -PlotKit.Base.map = function(fn, lst) { - if (PlotKit.Base.usingPrototype()) { - var rval = []; - for (var x in lst) { - if (typeof(lst[x]) == 'function') continue; - rval.push(fn(lst[x])); - } - return rval; - } - else { - return MochiKit.Base.map(fn, lst); - } -}; - -PlotKit.Base.items = function(lst) { - if (PlotKit.Base.usingPrototype()) { - var rval = []; - for (var x in lst) { - if (typeof(lst[x]) == 'function') continue; - rval.push([x, lst[x]]); - } - return rval; - } - else { - return MochiKit.Base.items(lst); - } -}; - -PlotKit.Base.keys = function(lst) { - if (PlotKit.Base.usingPrototype()) { - var rval = []; - for (var x in lst) { - if (typeof(lst[x]) == 'function') continue; - rval.push(x); - } - return rval; - } - else { - return MochiKit.Base.keys(lst); - } -}; - -// -// colour schemes -// -PlotKit.Base.baseColors = function () { - var hexColor = MochiKit.Color.Color.fromHexString; - return [hexColor("#476fb2"), - hexColor("#be2c2b"), - hexColor("#85b730"), - hexColor("#734a99"), - hexColor("#26a1c5"), - hexColor("#fb8707"), - hexColor("#000000")]; -}; - -PlotKit.Base.EXPORT = [ - "baseColors", - "collapse", - "findPosX", - "findPosY", - "uniq", - "isFuncLike", - "excanvasSupported" -]; - -PlotKit.Base.EXPORT_OK = []; - -PlotKit.Base.__new__ = function() { - var m = MochiKit.Base; - - m.nameFunctions(this); - - this.EXPORT_TAGS = { - ":common": this.EXPORT, - ":all": m.concat(this.EXPORT, this.EXPORT_OK) - }; -}; - -PlotKit.Base.__new__(); -MochiKit.Base._exportSymbols(this, PlotKit.Base); - diff --git a/plotkit_v091/PlotKit/Canvas.js b/plotkit_v091/PlotKit/Canvas.js deleted file mode 100644 index a3a1e09..0000000 --- a/plotkit_v091/PlotKit/Canvas.js +++ /dev/null @@ -1,242 +0,0 @@ -PlotKit.CanvasRenderer = function(element, layout, options) { - if (arguments.length > 0) - this.__init__(element, layout, options); -}; - -PlotKit.CanvasRenderer.prototype.__init__ = function(element, layout, options) { - var isNil = MochiKit.Base.isUndefinedOrNull; - var Color = MochiKit.Color.Color; - - // default options - this.options = { - "strokeWidth": 0.5, - "drawXAxis": true, - "drawYAxis": true, - "axisLineColor": Color.blackColor(), - "axisLineWidth": 0.5, - "axisTickSize": 3, - "axisLabelColor": Color.blackColor(), - "axisLabelFont": "Arial", - "axisLabelFontSize": 9, - "axisLabelWidth": 50, - }; - MochiKit.Base.update(this.options, options ? options : {}); - - this.layout = layout; - this.element = MochiKit.DOM.getElement(element); - this.container = this.element.parentNode; - - // Stuff relating to Canvas on IE support - this.isIE = PlotKit.Base.excanvasSupported(); - - if (this.isIE && !isNil(G_vmlCanvasManager)) { - this.IEDelay = 0.5; - this.maxTries = 5; - this.renderDelay = null; - this.clearDelay = null; - this.element = G_vmlCanvasManager.initElement(this.element); - } - - this.height = this.element.height; - this.width = this.element.width; - - // --- check whether everything is ok before we return - - if (isNil(this.element)) - throw "CanvasRenderer() - passed canvas is not found"; - - if (!this.isIE && !(PlotKit.CanvasRenderer.isSupported(this.element))) - throw "CanvasRenderer() - Canvas is not supported."; - - if (isNil(this.container) || (this.container.nodeName.toLowerCase() != "div")) - throw "CanvasRenderer() - needs to be enclosed in
"; - - // internal state - this.xlabels = new Array(); - this.ylabels = new Array(); - - this.area = { - x: this.options.yAxisLabelWidth + 2 * this.options.axisTickSize, - y: 0 - }; - this.area.w = this.width - this.area.x - this.options.rightGap; - this.area.h = this.height - this.options.axisLabelFontSize - - 2 * this.options.axisTickSize; - - MochiKit.DOM.updateNodeAttributes(this.container, - {"style":{ "position": "relative", "width": this.width + "px"}}); -}; - - -PlotKit.CanvasRenderer.prototype._renderLineAxis = function() { - this._renderAxis(); -}; - - -PlotKit.CanvasRenderer.prototype._renderAxis = function() { - if (!this.options.drawXAxis && !this.options.drawYAxis) - return; - - var context = this.element.getContext("2d"); - - var labelStyle = {"style": - {"position": "absolute", - "fontSize": this.options.axisLabelFontSize + "px", - "zIndex": 10, - "color": this.options.axisLabelColor.toRGBString(), - "width": this.options.axisLabelWidth + "px", - "overflow": "hidden" - } - }; - - // axis lines - context.save(); - context.strokeStyle = this.options.axisLineColor.toRGBString(); - context.lineWidth = this.options.axisLineWidth; - - - if (this.options.drawYAxis) { - if (this.layout.yticks) { - var drawTick = function(tick) { - if (typeof(tick) == "function") return; - var x = this.area.x; - var y = this.area.y + tick[0] * this.area.h; - context.beginPath(); - context.moveTo(x, y); - context.lineTo(x - this.options.axisTickSize, y); - context.closePath(); - context.stroke(); - - var label = DIV(labelStyle, tick[1]); - var top = (y - this.options.axisLabelFontSize / 2); - if (top < 0) top = 0; - - if (top + this.options.axisLabelFontSize + 3 > this.height) { - label.style.bottom = "0px"; - } else { - label.style.top = top + "px"; - } - label.style.left = "0px"; - label.style.textAlign = "right"; - label.style.width = this.options.yAxisLabelWidth + "px"; - MochiKit.DOM.appendChildNodes(this.container, label); - this.ylabels.push(label); - }; - - MochiKit.Iter.forEach(this.layout.yticks, bind(drawTick, this)); - - // The lowest tick on the y-axis often overlaps with the leftmost - // tick on the x-axis. Shift the bottom tick up a little bit to - // compensate if necessary. - var bottomTick = this.ylabels[0]; - var fontSize = this.options.axisLabelFontSize; - var bottom = parseInt(bottomTick.style.top) + fontSize; - if (bottom > this.height - fontSize) { - bottomTick.style.top = (parseInt(bottomTick.style.top) - - fontSize / 2) + "px"; - } - } - - context.beginPath(); - context.moveTo(this.area.x, this.area.y); - context.lineTo(this.area.x, this.area.y + this.area.h); - context.closePath(); - context.stroke(); - } - - if (this.options.drawXAxis) { - if (this.layout.xticks) { - var drawTick = function(tick) { - if (typeof(dataset) == "function") return; - - var x = this.area.x + tick[0] * this.area.w; - var y = this.area.y + this.area.h; - context.beginPath(); - context.moveTo(x, y); - context.lineTo(x, y + this.options.axisTickSize); - context.closePath(); - context.stroke(); - - var label = DIV(labelStyle, tick[1]); - label.style.textAlign = "center"; - label.style.bottom = "0px"; - - var left = (x - this.options.axisLabelWidth/2); - if (left + this.options.axisLabelWidth > this.width) { - left = this.width - this.options.xAxisLabelWidth; - label.style.textAlign = "right"; - } - if (left < 0) { - left = 0; - label.style.textAlign = "left"; - } - - label.style.left = left + "px"; - label.style.width = this.options.xAxisLabelWidth + "px"; - MochiKit.DOM.appendChildNodes(this.container, label); - this.xlabels.push(label); - }; - - MochiKit.Iter.forEach(this.layout.xticks, bind(drawTick, this)); - } - - context.beginPath(); - context.moveTo(this.area.x, this.area.y + this.area.h); - context.lineTo(this.area.x + this.area.w, this.area.y + this.area.h); - context.closePath(); - context.stroke(); - } - - context.restore(); - -}; - -PlotKit.CanvasRenderer.prototype.clear = function() { - if (this.isIE) { - // VML takes a while to start up, so we just poll every this.IEDelay - try { - if (this.clearDelay) { - this.clearDelay.cancel(); - this.clearDelay = null; - } - var context = this.element.getContext("2d"); - } - catch (e) { - this.clearDelay = MochiKit.Async.wait(this.IEDelay); - this.clearDelay.addCallback(bind(this.clear, this)); - return; - } - } - - var context = this.element.getContext("2d"); - context.clearRect(0, 0, this.width, this.height); - - MochiKit.Iter.forEach(this.xlabels, MochiKit.DOM.removeElement); - MochiKit.Iter.forEach(this.ylabels, MochiKit.DOM.removeElement); - this.xlabels = new Array(); - this.ylabels = new Array(); -}; - -// ---------------------------------------------------------------- -// Everything below here is experimental and undocumented. -// ---------------------------------------------------------------- - - -PlotKit.CanvasRenderer.isSupported = function(canvasName) { - var canvas = null; - try { - if (MochiKit.Base.isUndefinedOrNull(canvasName)) - canvas = MochiKit.DOM.CANVAS({}); - else - canvas = MochiKit.DOM.getElement(canvasName); - var context = canvas.getContext("2d"); - } - catch (e) { - var ie = navigator.appVersion.match(/MSIE (\d\.\d)/); - var opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1); - if ((!ie) || (ie[1] < 6) || (opera)) - return false; - return true; - } - return true; -}; diff --git a/plotkit_v091/PlotKit/EasyPlot.js b/plotkit_v091/PlotKit/EasyPlot.js deleted file mode 100644 index 7607731..0000000 --- a/plotkit_v091/PlotKit/EasyPlot.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - PlotKit EasyPlot - ================ - - User friendly wrapper around the common plotting functions. - - Copyright - --------- - Copyright 2005,2006 (c) Alastair Tse - For use under the BSD license. - -*/ - -try { - if (typeof(PlotKit.CanvasRenderer) == 'undefined') - { - throw "" - } -} -catch (e) { - throw "PlotKit.EasyPlot depends on all of PlotKit's components"; -} - -// -------------------------------------------------------------------- -// Start of EasyPlot definition -// -------------------------------------------------------------------- - -if (typeof(PlotKit.EasyPlot) == 'undefined') { - PlotKit.EasyPlot = {}; -} - -PlotKit.EasyPlot.NAME = "PlotKit.EasyPlot"; -PlotKit.EasyPlot.VERSION = PlotKit.VERSION; - -PlotKit.EasyPlot.__repr__ = function() { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.EasyPlot.toString = function() { - return this.__repr__(); -} - -// -------------------------------------------------------------------- -// Start of EasyPlot definition -// -------------------------------------------------------------------- - -PlotKit.EasyPlot = function(style, options, divElem, datasources) { - this.layout = new Layout(style, options); - this.divElem = divElem; - this.width = parseInt(divElem.getAttribute('width')); - this.height = parseInt(divElem.getAttribute('height')); - this.deferredCount = 0; - - // make sure we have non-zero width - if (this.width < 1) { - this.width = this.divElem.width ? this.divElem.width : 300; - } - - if (this.height < 1) { - this.height = this.divElem.height ? this.divElem.height : 300; - } - - // load data sources - if (isArrayLike(datasources)) { - for (var i = 0; i < datasources.length; i++) { - if (typeof(datasources[i]) == "string") { - this.deferredCount++; - // load CSV via ajax - var d = MochiKit.Async.doSimpleXMLHttpRequest(datasources[i]); - d.addCallback(MochiKit.Base.bind(PlotKit.EasyPlot.onDataLoaded, this)); - } - else if (isArrayLike(datasources[i])) { - this.layout.addDataset("data-" + i, datasources[i]); - } - } - } - else if (!isUndefinedOrNull(datasources)) { - throw "Passed datasources are not Array like"; - } - - // setup canvas to render - - if (CanvasRenderer.isSupported()) { - this.element = CANVAS({"id": this.divElem.getAttribute("id") + "-canvas", - "width": this.width, - "height": this.height}, ""); - this.divElem.appendChild(this.element); - this.renderer = new SweetCanvasRenderer(this.element, this.layout, options); - } - else if (SVGRenderer.isSupported()) { - this.element = SVGRenderer.SVG({"id": this.divElem.getAttribute("id") + "-svg", - "width": this.width, - "height": this.height, - "version": "1.1", - "baseProfile": "full"}, ""); - this.divElem.appendChild(this.element); - this.renderer = new SweetSVGRenderer(this.element, this.layout, options); - } - - if ((this.deferredCount == 0) && (PlotKit.Base.keys(this.layout.datasets).length > 0)) { - this.layout.evaluate(); - this.renderer.clear(); - this.renderer.render(); - } - -}; - -PlotKit.EasyPlot.onDataLoaded = function(request) { - - // very primitive CSV parser, should fix to make it more compliant. - var table = new Array(); - var lines = request.responseText.split('\n'); - for (var i = 0; i < lines.length; i++) { - var stripped = MochiKit.Format.strip(lines[i]); - if ((stripped.length > 1) && (stripped.charAt(0) != '#')) { - table.push(stripped.split(',')); - } - } - - this.layout.addDataset("data-ajax-" + this.deferredCount, table); - this.deferredCount--; - - if ((this.deferredCount == 0) && (PlotKit.Base.keys(this.layout.datasets).length > 0)) { - this.layout.evaluate(); - this.renderer.clear(); - this.renderer.render(); - } -}; - -PlotKit.EasyPlot.prototype.reload = function() { - this.layout.evaluate(); - this.renderer.clear(); - this.renderer.render(); -}; - -// Namespace Iniitialisation - -PlotKit.EasyPlotModule = {}; -PlotKit.EasyPlotModule.EasyPlot = PlotKit.EasyPlot; - -PlotKit.EasyPlotModule.EXPORT = [ - "EasyPlot" -]; - -PlotKit.EasyPlotModule.EXPORT_OK = []; - -PlotKit.EasyPlotModule.__new__ = function() { - var m = MochiKit.Base; - - m.nameFunctions(this); - - this.EXPORT_TAGS = { - ":common": this.EXPORT, - ":all": m.concat(this.EXPORT, this.EXPORT_OK) - }; -}; - -PlotKit.EasyPlotModule.__new__(); -MochiKit.Base._exportSymbols(this, PlotKit.EasyPlotModule); - - diff --git a/plotkit_v091/PlotKit/Layout.js b/plotkit_v091/PlotKit/Layout.js deleted file mode 100644 index 13b2de0..0000000 --- a/plotkit_v091/PlotKit/Layout.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - PlotKit Layout - ============== - - Handles laying out data on to a virtual canvas square canvas between 0.0 - and 1.0. If you want to add new chart/plot types such as point plots, - you need to add them here. - - Copyright - --------- - Copyright 2005,2006 (c) Alastair Tse - For use under the BSD license. - -*/ - -// -------------------------------------------------------------------- -// Start of Layout definition -// -------------------------------------------------------------------- - -if (typeof(PlotKit.Layout) == 'undefined') { - PlotKit.Layout = {}; -} - -// -------------------------------------------------------------------- -// Start of Layout definition -// -------------------------------------------------------------------- - -PlotKit.Layout = function(style, options) { - this.options = { }; - - // valid external options : TODO: input verification - MochiKit.Base.update(this.options, options ? options : {}); - - // internal states - this.datasets = new Array(); -}; - -// -------------------------------------------------------------------- -// Dataset Manipulation -// -------------------------------------------------------------------- - - -PlotKit.Layout.prototype.addDataset = function(setname, set_xy) { - this.datasets[setname] = set_xy; -}; - -// -------------------------------------------------------------------- -// Evaluates the layout for the current data and style. -// -------------------------------------------------------------------- - -PlotKit.Layout.prototype.evaluate = function() { - this._evaluateLimits(); - this._evaluateLineCharts(); - this._evaluateLineTicks(); -}; - - -// -------------------------------------------------------------------- -// START Internal Functions -// -------------------------------------------------------------------- - -PlotKit.Layout.prototype._evaluateLimits = function() { - this.minxval = this.maxxval = null; - for (var name in this.datasets) { - var series = this.datasets[name]; - var x1 = series[0][0]; - if (!this.minxval || x1 < this.minxval) this.minxval = x1; - - var x2 = series[series.length - 1][0]; - if (!this.maxxval || x2 > this.maxxval) this.maxxval = x2; - } - this.xrange = this.maxxval - this.minxval; - this.xscale = (this.xrange != 0 ? 1/this.xrange : 1.0); - - this.minyval = this.options.yAxis[0]; - this.maxyval = this.options.yAxis[1]; - this.yrange = this.maxyval - this.minyval; - this.yscale = (this.yrange != 0 ? 1/this.yrange : 1.0); -}; - -// Create the line charts -PlotKit.Layout.prototype._evaluateLineCharts = function() { - // add all the rects - this.points = new Array(); - for (var setName in this.datasets) { - var dataset = this.datasets[setName]; - for (var j = 0; j < dataset.length; j++) { - var item = dataset[j]; - var point = { - x: ((parseFloat(item[0]) - this.minxval) * this.xscale), - y: 1.0 - ((parseFloat(item[1]) - this.minyval) * this.yscale), - xval: parseFloat(item[0]), - yval: parseFloat(item[1]), - name: setName - }; - - // limit the x, y values so they do not overdraw - if (point.y <= 0.0) { - point.y = 0.0; - } - if (point.y >= 1.0) { - point.y = 1.0; - } - if ((point.x >= 0.0) && (point.x <= 1.0)) { - this.points.push(point); - } - } - } -}; - -PlotKit.Layout.prototype._evaluateLineTicks = function() { - this.xticks = new Array(); - for (var i = 0; i < this.options.xTicks.length; i++) { - var tick = this.options.xTicks[i]; - var label = tick.label; - var pos = this.xscale * (tick.v - this.minxval); - if ((pos >= 0.0) && (pos <= 1.0)) { - this.xticks.push([pos, label]); - } - } - - this.yticks = new Array(); - for (var i = 0; i < this.options.yTicks.length; i++) { - var tick = this.options.yTicks[i]; - var label = tick.label; - var pos = 1.0 - (this.yscale * (tick.v - this.minyval)); - if ((pos >= 0.0) && (pos <= 1.0)) { - this.yticks.push([pos, label]); - } - } -}; - diff --git a/plotkit_v091/PlotKit/PlotKit.js b/plotkit_v091/PlotKit/PlotKit.js deleted file mode 100644 index e79abf7..0000000 --- a/plotkit_v091/PlotKit/PlotKit.js +++ /dev/null @@ -1,151 +0,0 @@ -/*** - -PlotKit Autoload Javascript Module. - -This file was adapted from MochiKit. -See for documentation, downloads, license, etc. -(c) 2005 Bob Ippolito. All rights Reserved. - -Modified by Alastair Tse, 2006, for PlotKit. - -***/ - -if (typeof(PlotKit) == 'undefined') { - PlotKit = {}; -} - -if (typeof(PlotKit.PlotKit) == 'undefined') { - PlotKit.PlotKit = {}; -} - -PlotKit.PlotKit.NAME = "PlotKit.PlotKit"; -PlotKit.PlotKit.VERSION = "0.9.1"; -PlotKit.PlotKit.__repr__ = function () { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.PlotKit.toString = function () { - return this.__repr__(); -}; - -PlotKit.PlotKit.SUBMODULES = [ - "Base", - "Layout", - "Canvas", - "SVG", - "SweetCanvas", - "SweetSVG", - "EasyPlot" -]; - -if (typeof(JSAN) != 'undefined' || typeof(dojo) != 'undefined') { - if (typeof(dojo) != 'undefined') { - dojo.provide('PlotKit.PlotKit'); - dojo.require("PlotKit.*"); - } - if (typeof(JSAN) != 'undefined') { - // hopefully this makes it easier for static analysis? - JSAN.use("PlotKit.Base", []); - JSAN.use("PlotKit.Layout", []); - JSAN.use("PlotKit.Canvas", []); - JSAN.use("PlotKit.SweetCanvas", []); - JSAN.use("PlotKit.SVG", []); - JSAN.use("PlotKit.SweetSVG", []); - } - (function () { - var extend = MochiKit.Base.extend; - var self = PlotKit.PlotKit; - var modules = self.SUBMODULES; - var EXPORT = []; - var EXPORT_OK = []; - var EXPORT_TAGS = {}; - var i, k, m, all; - for (i = 0; i < modules.length; i++) { - m = PlotKit[modules[i]]; - extend(EXPORT, m.EXPORT); - extend(EXPORT_OK, m.EXPORT_OK); - for (k in m.EXPORT_TAGS) { - EXPORT_TAGS[k] = extend(EXPORT_TAGS[k], m.EXPORT_TAGS[k]); - } - all = m.EXPORT_TAGS[":all"]; - if (!all) { - all = extend(null, m.EXPORT, m.EXPORT_OK); - } - var j; - for (j = 0; j < all.length; j++) { - k = all[j]; - self[k] = m[k]; - } - } - self.EXPORT = EXPORT; - self.EXPORT_OK = EXPORT_OK; - self.EXPORT_TAGS = EXPORT_TAGS; - }()); - -} else { - if (typeof(PlotKit.__compat__) == 'undefined') { - PlotKit.__compat__ = true; - } - (function () { - if (typeof(document) == "undefined") { - return; - } - - var scripts = document.getElementsByTagName("script"); - var kXULNSURI = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - var base = null; - var baseElem = null; - var allScripts = {}; - var i; - for (i = 0; i < scripts.length; i++) { - var src = scripts[i].getAttribute("src"); - if (!src) { - continue; - } - allScripts[src] = true; - if (src.match(/PlotKit.js$/)) { - base = src.substring(0, src.lastIndexOf('PlotKit.js')); - baseElem = scripts[i]; - } - - } - - if (base === null) { - return; - } - var modules = PlotKit.PlotKit.SUBMODULES; - for (var i = 0; i < modules.length; i++) { - if (PlotKit[modules[i]]) { - continue; - } - var uri = base + modules[i] + '.js'; - if (uri in allScripts) { - continue; - } - if (document.documentElement && - document.documentElement.namespaceURI == kXULNSURI) { - // XUL - var s = document.createElementNS(kXULNSURI, 'script'); - s.setAttribute("id", "PlotKit_" + base + modules[i]); - s.setAttribute("src", uri); - s.setAttribute("type", "application/x-javascript"); - baseElem.parentNode.appendChild(s); - } else { - // HTML - /* - DOM can not be used here because Safari does - deferred loading of scripts unless they are - in the document or inserted with document.write - - This is not XHTML compliant. If you want XHTML - compliance then you must use the packed version of MochiKit - or include each script individually (basically unroll - these document.write calls into your XHTML source) - - */ - document.write(''); - } - }; - })(); -} diff --git a/plotkit_v091/PlotKit/PlotKit_Packed.js b/plotkit_v091/PlotKit/PlotKit_Packed.js deleted file mode 100644 index 363042a..0000000 --- a/plotkit_v091/PlotKit/PlotKit_Packed.js +++ /dev/null @@ -1,2177 +0,0 @@ -/*** - - PlotKit.PlotKit 0.9.1 : PACKED VERSION - - THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please - diff against the source tree, not this file. - - For more information, . - - Copyright (c) 2006. Alastair Tse. - -***/ - -try{ -if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.DOM)=="undefined"||typeof (MochiKit.Color)=="undefined"||typeof (MochiKit.Format)=="undefined"){ -throw ""; -} -} -catch(e){ -throw "PlotKit depends on MochiKit.{Base,Color,DOM,Format}"; -} -MochiKit.Base.update(MochiKit.Color.Color.prototype,{asFillColor:function(){ -return this.lighterColorWithLevel(0.3); -},asStrokeColor:function(){ -return this.darkerColorWithLevel(0.1); -},asPointColor:function(){ -return this.lighterColorWithLevel(0.1); -}}); -if(typeof (PlotKit)=="undefined"){ -PlotKit={}; -} -PlotKit.NAME="PlotKit"; -PlotKit.VERSION="0.8"; -PlotKit.__repr__=function(){ -return "["+this.NAME+" "+this.VERSION+"]"; -}; -PlotKit.toString=function(){ -return this.__repr__(); -}; -if(typeof (PlotKit.Base)=="undefined"){ -PlotKit.Base={}; -} -PlotKit.Base.NAME="PlotKit.Base"; -PlotKit.Base.VERSION=PlotKit.VERSION; -PlotKit.Base.__repr__=function(){ -return "["+this.NAME+" "+this.VERSION+"]"; -}; -PlotKit.Base.toString=function(){ -return this.__repr__(); -}; -PlotKit.Base.usingPrototype=function(){ -try{ -return (typeof (Object.extend)=="function"); -} -catch(e){ -return false; -} -}; -MochiKit.Base.update(PlotKit.Base,{roundInterval:function(_1,_2,_3){ -var _4=MochiKit.Format.roundToFixed; -var _5=_1/_2; -return parseFloat(_4(_5,_3)); -},collapse:function(_6){ -var m=MochiKit.Base; -var _8=new Array(); -for(var i=0;i<_6.length;i++){ -_8=m.concat(_8,_6[i]); -} -if(PlotKit.Base.usingPrototype()){ -delete _8.extend; -delete _8.from; -delete _8.inspect; -} -return _8; -},uniq:function(_10){ -var m=MochiKit.Base; -if(!m.isArrayLike(_10)||(_10.length<1)){ -return new Array(); -} -var _11=new Array(); -var _12=_10[0]; -_11.push(_10[0]); -for(var i=1;i<_10.length;i++){ -if(m.compare(_10[i],_12)!=0){ -_12=_10[i]; -_11.push(_10[i]); -} -} -return _11; -},colorScheme:function(){ -var mb=MochiKit.Base; -var mc=MochiKit.Color; -var _15=["red","orange","yellow","green","cyan","blue","purple","magenta"]; -var _16=function(_17){ -return mc.Color[_17+"Color"](); -}; -return mb.map(_16,_15); -},baseDarkPrimaryColors:function(){ -var _18=MochiKit.Color.Color.fromHexString; -return [_18("#ad3f40"),_18("#ddac2c"),_18("#dfdd0c"),_18("#5276c4"),_18("#739c5a")]; -},basePrimaryColors:function(){ -var _19=MochiKit.Color.Color.fromHexString; -return [_19("#d24c4d"),_19("#f2b32f"),_19("#ece90e"),_19("#5d83da"),_19("#78a15d")]; -},baseBlueColors:function(){ -var _20=MochiKit.Color.Color.fromHexString; -return [_20("#4b6b94"),_20("#5d81b4"),_20("#acbad2")]; -},palette:function(_21,_22,_23,_24){ -var _25=MochiKit.Base.isUndefinedOrNull; -var _26=new Array(); -if(_25(_24)){ -_24=0.1; -} -if(_25(_23)){ -_23=0.4; -} -if(_25(_22)){ -_22=-0.2; -} -var _27=_22; -while(_27<=_23){ -_26.push(_27); -_27+=_24; -} -var _28=function(_29,_30){ -return _29.lighterColorWithLevel(_30); -}; -return MochiKit.Base.map(partial(_28,_21),_26); -},excanvasSupported:function(){ -if(/MSIE/.test(navigator.userAgent)&&!window.opera){ -return true; -} -return false; -},findPosX:function(obj){ -var _32=0; -if(obj.offsetParent){ -while(obj.offsetParent){ -_32+=obj.offsetLeft; -obj=obj.offsetParent; -} -}else{ -if(obj.x){ -_32+=obj.x; -} -} -return _32; -},findPosY:function(obj){ -var _33=0; -if(obj.offsetParent){ -while(obj.offsetParent){ -_33+=obj.offsetTop; -obj=obj.offsetParent; -} -}else{ -if(obj.y){ -_33+=obj.y; -} -} -return _33; -},isFuncLike:function(obj){ -return (typeof (obj)=="function"); -}}); -PlotKit.Base.map=function(fn,lst){ -if(PlotKit.Base.usingPrototype()){ -var _36=[]; -for(var x in lst){ -if(typeof (lst[x])=="function"){ -continue; -} -_36.push(fn(lst[x])); -} -return _36; -}else{ -return MochiKit.Base.map(fn,lst); -} -}; -PlotKit.Base.items=function(lst){ -if(PlotKit.Base.usingPrototype()){ -var _38=[]; -for(var x in lst){ -if(typeof (lst[x])=="function"){ -continue; -} -_38.push([x,lst[x]]); -} -return _38; -}else{ -return MochiKit.Base.items(lst); -} -}; -PlotKit.Base.keys=function(lst){ -if(PlotKit.Base.usingPrototype()){ -var _39=[]; -for(var x in lst){ -if(typeof (lst[x])=="function"){ -continue; -} -_39.push(x); -} -return _39; -}else{ -return MochiKit.Base.keys(lst); -} -}; -PlotKit.Base.baseColors=function(){ -var _40=MochiKit.Color.Color.fromHexString; -return [_40("#476fb2"),_40("#be2c2b"),_40("#85b730"),_40("#734a99"),_40("#26a1c5"),_40("#fb8707"),_40("#000000")]; -}; -PlotKit.Base.officeBaseStyle={"axisLineWidth":2,"axisLabelColor":Color.grayColor(),"axisLineColor":Color.whiteColor(),"padding":{top:5,bottom:10,left:30,right:30}}; -MochiKit.Base.update(PlotKit.Base,{officeBlue:function(){ -var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),"backgroundColor":PlotKit.Base.baseColors()[0].lighterColorWithLevel(0.45)}; -MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle); -return r; -},officeRed:function(){ -var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[1]),"backgroundColor":PlotKit.Base.baseColors()[1].lighterColorWithLevel(0.5)}; -MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle); -return r; -},officeGreen:function(){ -var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[2]),"backgroundColor":PlotKit.Base.baseColors()[2].lighterColorWithLevel(0.5)}; -MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle); -return r; -},officePurple:function(){ -var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[3]),"backgroundColor":PlotKit.Base.baseColors()[3].lighterColorWithLevel(0.5)}; -MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle); -return r; -},officeCyan:function(){ -var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[4]),"backgroundColor":PlotKit.Base.baseColors()[4].lighterColorWithLevel(0.5)}; -MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle); -return r; -},officeOrange:function(){ -var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[5]),"backgroundColor":PlotKit.Base.baseColors()[5].lighterColorWithLevel(0.4)}; -MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle); -return r; -},officeBlack:function(){ -var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[6],0,0.6),"backgroundColor":PlotKit.Base.baseColors()[6].lighterColorWithLevel(0.9)}; -MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle); -return r; -}}); -PlotKit.Base.EXPORT=["baseColors","collapse","colorScheme","findPosX","findPosY","officeBaseStyle","officeBlue","officeRed","officeGreen","officePurple","officeCyan","officeOrange","officeBlack","roundInterval","uniq","isFuncLike","excanvasSupported"]; -PlotKit.Base.EXPORT_OK=[]; -PlotKit.Base.__new__=function(){ -var m=MochiKit.Base; -m.nameFunctions(this); -this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; -}; -PlotKit.Base.__new__(); -MochiKit.Base._exportSymbols(this,PlotKit.Base); -try{ -if(typeof (PlotKit.Base)=="undefined"){ -throw ""; -} -} -catch(e){ -throw "PlotKit.Layout depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.Base"; -} -if(typeof (PlotKit.Layout)=="undefined"){ -PlotKit.Layout={}; -} -PlotKit.Layout.NAME="PlotKit.Layout"; -PlotKit.Layout.VERSION=PlotKit.VERSION; -PlotKit.Layout.__repr__=function(){ -return "["+this.NAME+" "+this.VERSION+"]"; -}; -PlotKit.Layout.toString=function(){ -return this.__repr__(); -}; -PlotKit.Layout.valid_styles=["bar","line","pie","point"]; -PlotKit.Layout=function(_42,_43){ -this.options={"barWidthFillFraction":0.75,"barOrientation":"vertical","xOriginIsZero":true,"yOriginIsZero":true,"xAxis":null,"yAxis":null,"xTicks":null,"yTicks":null,"xNumberOfTicks":10,"yNumberOfTicks":5,"xTickPrecision":1,"yTickPrecision":1,"pieRadius":0.4}; -this.style=_42; -MochiKit.Base.update(this.options,_43?_43:{}); -if(!MochiKit.Base.isUndefinedOrNull(this.options.xAxis)){ -this.minxval=this.options.xAxis[0]; -this.maxxval=this.options.xAxis[1]; -this.xscale=this.maxxval-this.minxval; -}else{ -this.minxval=0; -this.maxxval=null; -this.xscale=null; -} -if(!MochiKit.Base.isUndefinedOrNull(this.options.yAxis)){ -this.minyval=this.options.yAxis[0]; -this.maxyval=this.options.yAxis[1]; -this.yscale=this.maxyval-this.minyval; -}else{ -this.minyval=0; -this.maxyval=null; -this.yscale=null; -} -this.bars=new Array(); -this.points=new Array(); -this.slices=new Array(); -this.xticks=new Array(); -this.yticks=new Array(); -this.datasets=new Array(); -this.minxdelta=0; -this.xrange=1; -this.yrange=1; -this.hitTestCache={x2maxy:null}; -}; -PlotKit.Layout.prototype.addDataset=function(_44,_45){ -this.datasets[_44]=_45; -}; -PlotKit.Layout.prototype.removeDataset=function(_46,_47){ -delete this.datasets[_46]; -}; -PlotKit.Layout.prototype.addDatasetFromTable=function(_48,_49,_50,_51,_52){ -var _53=MochiKit.Base.isUndefinedOrNull; -var _54=MochiKit.DOM.scrapeText; -var _55=MochiKit.Format.strip; -if(_53(_50)){ -_50=0; -} -if(_53(_51)){ -_51=1; -} -if(_53(_52)){ -_52=-1; -} -var _56=_49.tBodies[0].rows; -var _57=new Array(); -var _58=new Array(); -if(!_53(_56)){ -for(var i=0;i<_56.length;i++){ -_57.push([parseFloat(_55(_54(_56[i].cells[_50]))),parseFloat(_55(_54(_56[i].cells[_51])))]); -if(_52>=0){ -_58.push({v:parseFloat(_55(_54(_56[i].cells[_50]))),label:_55(_54(_56[i].cells[_52]))}); -} -} -this.addDataset(_48,_57); -if(_52>=0){ -this.options.xTicks=_58; -} -return true; -} -return false; -}; -PlotKit.Layout.prototype.evaluate=function(){ -this._evaluateLimits(); -this._evaluateScales(); -if(this.style=="bar"){ -if(this.options.barOrientation=="horizontal"){ -this._evaluateHorizBarCharts(); -}else{ -this._evaluateBarCharts(); -} -this._evaluateBarTicks(); -}else{ -if(this.style=="line"){ -this._evaluateLineCharts(); -this._evaluateLineTicks(); -}else{ -if(this.style=="pie"){ -this._evaluatePieCharts(); -this._evaluatePieTicks(); -} -} -} -}; -PlotKit.Layout.prototype.hitTest=function(x,y){ -var f=MochiKit.Format.twoDigitFloat; -if((this.style=="bar")&&this.bars&&(this.bars.length>0)){ -for(var i=0;i=bar.x)&&(x<=bar.x+bar.w)&&(y>=bar.y)&&(y-bar.y<=bar.h)){ -return bar; -} -} -}else{ -if(this.style=="line"){ -if(this.hitTestCache.x2maxy==null){ -this._regenerateHitTestCache(); -} -var _62=x/this.xscale; -var _63=this.hitTestCache.xvalues; -var _64=null; -var _65=null; -for(var i=1;i<_63.length;i++){ -if(_63[i]>_62){ -_64=_63[i-1]; -_65=_63[i]; -break; -} -} -if((_64!=null)){ -var _66=this.hitTestCache.x2maxy[_64]; -var _67=this.hitTestCache.x2maxy[_65]; -var _68=(1-y)/this.yscale; -var _69=(_67-_66)/(_65-_64); -var _70=_66+_69*(_62-_64); -if(_70>=_68){ -var obj={xval:_62,yval:_68,xafter:_65,yafter:_67,xbefore:_64,ybefore:_66,yprojected:_70}; -return obj; -} -} -}else{ -if(this.style=="pie"){ -var _71=Math.sqrt((y-0.5)*(y-0.5)+(x-0.5)*(x-0.5)); -if(_71>this.options.pieRadius){ -return null; -} -var _72=Math.atan2(y-0.5,x-0.5)-Math.PI/2; -for(var i=0;i=_72){ -return _73; -} -} -} -} -} -return null; -}; -PlotKit.Layout.prototype.rectForX=function(x){ -return null; -}; -PlotKit.Layout.prototype.angleRangeForX=function(x){ -return null; -}; -PlotKit.Layout.prototype._evaluateLimits=function(){ -var map=PlotKit.Base.map; -var _75=PlotKit.Base.items; -var _76=MochiKit.Base.itemgetter; -var _77=PlotKit.Base.collapse; -var _78=MochiKit.Base.listMin; -var _79=MochiKit.Base.listMax; -var _80=MochiKit.Base.isUndefinedOrNull; -var all=_77(map(_76(1),_75(this.datasets))); -if(_80(this.options.xAxis)){ -if(this.options.xOriginIsZero){ -this.minxval=0; -}else{ -this.minxval=_78(map(parseFloat,map(_76(0),all))); -} -this.maxxval=_79(map(parseFloat,map(_76(0),all))); -}else{ -this.minxval=this.options.xAxis[0]; -this.maxxval=this.options.xAxis[1]; -this.xscale=this.maxval-this.minxval; -} -if(_80(this.options.yAxis)){ -if(this.options.yOriginIsZero){ -this.minyval=0; -}else{ -this.minyval=_78(map(parseFloat,map(_76(1),all))); -} -this.maxyval=_79(map(parseFloat,map(_76(1),all))); -}else{ -this.minyval=this.options.yAxis[0]; -this.maxyval=this.options.yAxis[1]; -this.yscale=this.maxyval-this.minyval; -} -}; -PlotKit.Layout.prototype._evaluateScales=function(){ -var _82=MochiKit.Base.isUndefinedOrNull; -this.xrange=this.maxxval-this.minxval; -if(this.xrange==0){ -this.xscale=1; -}else{ -this.xscale=1/this.xrange; -} -this.yrange=this.maxyval-this.minyval; -if(this.yrange==0){ -this.yscale=1; -}else{ -this.yscale=1/this.yrange; -} -}; -PlotKit.Layout.prototype._uniqueXValues=function(){ -var _83=PlotKit.Base.collapse; -var map=PlotKit.Base.map; -var _84=PlotKit.Base.uniq; -var _85=MochiKit.Base.itemgetter; -var _86=PlotKit.Base.items; -var _87=map(parseFloat,map(_85(0),_83(map(_85(1),_86(this.datasets))))); -_87.sort(MochiKit.Base.compare); -return _84(_87); -}; -PlotKit.Layout.prototype._evaluateBarCharts=function(){ -var _88=PlotKit.Base.items; -var _89=_88(this.datasets).length; -var _90=10000000; -var _91=this._uniqueXValues(); -for(var i=1;i<_91.length;i++){ -_90=Math.min(Math.abs(_91[i]-_91[i-1]),_90); -} -var _92=0; -var _93=0; -var _94=0; -if(_91.length==1){ -_90=1; -this.xscale=1; -this.minxval=_91[0]; -_92=1*this.options.barWidthFillFraction; -_93=_92/_89; -_94=(1-this.options.barWidthFillFraction)/2; -}else{ -if(this.xrange==1){ -this.xscale=0.5; -}else{ -if(this.xrange==2){ -this.xscale=1/3; -}else{ -this.xscale=(1-_90/this.xrange)/this.xrange; -} -} -_92=_90*this.xscale*this.options.barWidthFillFraction; -_93=_92/_89; -_94=_90*this.xscale*(1-this.options.barWidthFillFraction)/2; -} -this.minxdelta=_90; -this.bars=new Array(); -var i=0; -for(var _95 in this.datasets){ -var _96=this.datasets[_95]; -if(PlotKit.Base.isFuncLike(_96)){ -continue; -} -for(var j=0;j<_96.length;j++){ -var _98=_96[j]; -var _99={x:((parseFloat(_98[0])-this.minxval)*this.xscale)+(i*_93)+_94,y:1-((parseFloat(_98[1])-this.minyval)*this.yscale),w:_93,h:((parseFloat(_98[1])-this.minyval)*this.yscale),xval:parseFloat(_98[0]),yval:parseFloat(_98[1]),name:_95}; -if((_99.x>=0)&&(_99.x<=1)&&(_99.y>=0)&&(_99.y<=1)){ -this.bars.push(_99); -} -} -i++; -} -}; -PlotKit.Layout.prototype._evaluateHorizBarCharts=function(){ -var _100=PlotKit.Base.items; -var _101=_100(this.datasets).length; -var _102=10000000; -var _103=this._uniqueXValues(); -for(var i=1;i<_103.length;i++){ -_102=Math.min(Math.abs(_103[i]-_103[i-1]),_102); -} -var _104=0; -var _105=0; -var _106=0; -if(_103.length==1){ -_102=1; -this.xscale=1; -this.minxval=_103[0]; -_104=1*this.options.barWidthFillFraction; -_105=_104/_101; -_106=(1-this.options.barWidthFillFraction)/2; -}else{ -this.xscale=(1-_102/this.xrange)/this.xrange; -_104=_102*this.xscale*this.options.barWidthFillFraction; -_105=_104/_101; -_106=_102*this.xscale*(1-this.options.barWidthFillFraction)/2; -} -this.minxdelta=_102; -this.bars=new Array(); -var i=0; -for(var _107 in this.datasets){ -var _108=this.datasets[_107]; -if(PlotKit.Base.isFuncLike(_108)){ -continue; -} -for(var j=0;j<_108.length;j++){ -var item=_108[j]; -var rect={y:((parseFloat(item[0])-this.minxval)*this.xscale)+(i*_105)+_106,x:0,h:_105,w:((parseFloat(item[1])-this.minyval)*this.yscale),xval:parseFloat(item[0]),yval:parseFloat(item[1]),name:_107}; -if(rect.y<=0){ -rect.y=0; -} -if(rect.y>=1){ -rect.y=1; -} -if((rect.x>=0)&&(rect.x<=1)){ -this.bars.push(rect); -} -} -i++; -} -}; -PlotKit.Layout.prototype._evaluateLineCharts=function(){ -var _111=PlotKit.Base.items; -var _112=_111(this.datasets).length; -this.points=new Array(); -var i=0; -for(var _113 in this.datasets){ -var _114=this.datasets[_113]; -if(PlotKit.Base.isFuncLike(_114)){ -continue; -} -_114.sort(function(a,b){ -return compare(parseFloat(a[0]),parseFloat(b[0])); -}); -for(var j=0;j<_114.length;j++){ -var item=_114[j]; -var _117={x:((parseFloat(item[0])-this.minxval)*this.xscale),y:1-((parseFloat(item[1])-this.minyval)*this.yscale),xval:parseFloat(item[0]),yval:parseFloat(item[1]),name:_113}; -if(_117.y<=0){ -_117.y=0; -} -if(_117.y>=1){ -_117.y=1; -} -if((_117.x>=0)&&(_117.x<=1)){ -this.points.push(_117); -} -} -i++; -} -}; -PlotKit.Layout.prototype._evaluatePieCharts=function(){ -var _118=PlotKit.Base.items; -var sum=MochiKit.Iter.sum; -var _120=MochiKit.Base.itemgetter; -var _121=_118(this.datasets).length; -var _122=_118(this.datasets)[0][1]; -var _123=sum(map(_120(1),_122)); -this.slices=new Array(); -var _124=0; -for(var i=0;i<_122.length;i++){ -var _125=_122[i][1]/_123; -var _126=_124*Math.PI*2; -var _127=(_124+_125)*Math.PI*2; -var _128={fraction:_125,xval:_122[i][0],yval:_122[i][1],startAngle:_126,endAngle:_127}; -if(_122[i][1]!=0){ -this.slices.push(_128); -} -_124+=_125; -} -}; -PlotKit.Layout.prototype._evaluateLineTicksForXAxis=function(){ -var _129=MochiKit.Base.isUndefinedOrNull; -if(this.options.xTicks){ -this.xticks=new Array(); -var _130=function(tick){ -var _132=tick.label; -if(_129(_132)){ -_132=tick.v.toString(); -} -var pos=this.xscale*(tick.v-this.minxval); -if((pos>=0)&&(pos<=1)){ -this.xticks.push([pos,_132]); -} -}; -MochiKit.Iter.forEach(this.options.xTicks,bind(_130,this)); -}else{ -if(this.options.xNumberOfTicks){ -var _134=this._uniqueXValues(); -var _135=this.xrange/this.options.xNumberOfTicks; -var _136=0; -this.xticks=new Array(); -for(var i=0;i<=_134.length;i++){ -if((_134[i]-this.minxval)>=(_136*_135)){ -var pos=this.xscale*(_134[i]-this.minxval); -if((pos>1)||(pos<0)){ -continue; -} -this.xticks.push([pos,_134[i]]); -_136++; -} -if(_136>this.options.xNumberOfTicks){ -break; -} -} -} -} -}; -PlotKit.Layout.prototype._evaluateLineTicksForYAxis=function(){ -var _137=MochiKit.Base.isUndefinedOrNull; -if(this.options.yTicks){ -this.yticks=new Array(); -var _138=function(tick){ -var _139=tick.label; -if(_137(_139)){ -_139=tick.v.toString(); -} -var pos=1-(this.yscale*(tick.v-this.minyval)); -if((pos>=0)&&(pos<=1)){ -this.yticks.push([pos,_139]); -} -}; -MochiKit.Iter.forEach(this.options.yTicks,bind(_138,this)); -}else{ -if(this.options.yNumberOfTicks){ -this.yticks=new Array(); -var _140=PlotKit.Base.roundInterval; -var prec=this.options.yTickPrecision; -var _142=_140(this.yrange,this.options.yNumberOfTicks,prec); -for(var i=0;i<=this.options.yNumberOfTicks;i++){ -var yval=this.minyval+(i*_142); -var pos=1-((yval-this.minyval)*this.yscale); -if((pos>1)||(pos<0)){ -continue; -} -this.yticks.push([pos,MochiKit.Format.roundToFixed(yval,prec)]); -} -} -} -}; -PlotKit.Layout.prototype._evaluateLineTicks=function(){ -this._evaluateLineTicksForXAxis(); -this._evaluateLineTicksForYAxis(); -}; -PlotKit.Layout.prototype._evaluateBarTicks=function(){ -this._evaluateLineTicks(); -var _144=function(tick){ -return [tick[0]+(this.minxdelta*this.xscale)/2,tick[1]]; -}; -this.xticks=MochiKit.Base.map(bind(_144,this),this.xticks); -if(this.options.barOrientation=="horizontal"){ -var _145=this.xticks; -this.xticks=this.yticks; -this.yticks=_145; -var _146=function(tick){ -return [1-tick[0],tick[1]]; -}; -this.xticks=MochiKit.Base.map(_146,this.xticks); -} -}; -PlotKit.Layout.prototype._evaluatePieTicks=function(){ -var _147=MochiKit.Base.isUndefinedOrNull; -var _148=MochiKit.Format.numberFormatter("#%"); -this.xticks=new Array(); -if(this.options.xTicks){ -var _149=new Array(); -for(var i=0;i0){ -this.__init__(_158,_159,_160); -} -}; -PlotKit.CanvasRenderer.prototype.__init__=function(_161,_162,_163){ -var _164=MochiKit.Base.isUndefinedOrNull; -var _165=MochiKit.Color.Color; -this.options={"drawBackground":true,"backgroundColor":_165.whiteColor(),"padding":{left:30,right:30,top:5,bottom:10},"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),"strokeColor":_165.whiteColor(),"strokeColorTransform":"asStrokeColor","strokeWidth":0.5,"shouldFill":true,"shouldStroke":true,"drawXAxis":true,"drawYAxis":true,"axisLineColor":_165.blackColor(),"axisLineWidth":0.5,"axisTickSize":3,"axisLabelColor":_165.blackColor(),"axisLabelFont":"Arial","axisLabelFontSize":9,"axisLabelWidth":50,"pieRadius":0.4,"enableEvents":true}; -MochiKit.Base.update(this.options,_163?_163:{}); -this.layout=_162; -this.element=MochiKit.DOM.getElement(_161); -this.container=this.element.parentNode; -this.isIE=PlotKit.Base.excanvasSupported(); -if(this.isIE&&!_164(G_vmlCanvasManager)){ -this.IEDelay=0.5; -this.maxTries=5; -this.renderDelay=null; -this.clearDelay=null; -this.element=G_vmlCanvasManager.initElement(this.element); -} -this.height=this.element.height; -this.width=this.element.width; -if(_164(this.element)){ -throw "CanvasRenderer() - passed canvas is not found"; -} -if(!this.isIE&&!(PlotKit.CanvasRenderer.isSupported(this.element))){ -throw "CanvasRenderer() - Canvas is not supported."; -} -if(_164(this.container)||(this.container.nodeName.toLowerCase()!="div")){ -throw "CanvasRenderer() - needs to be enclosed in
"; -} -this.xlabels=new Array(); -this.ylabels=new Array(); -this.isFirstRender=true; -this.area={x:this.options.padding.left,y:this.options.padding.top,w:this.width-this.options.padding.left-this.options.padding.right,h:this.height-this.options.padding.top-this.options.padding.bottom}; -MochiKit.DOM.updateNodeAttributes(this.container,{"style":{"position":"relative","width":this.width+"px"}}); -}; -PlotKit.CanvasRenderer.prototype.render=function(){ -if(this.isIE){ -try{ -if(this.renderDelay){ -this.renderDelay.cancel(); -this.renderDelay=null; -} -var _166=this.element.getContext("2d"); -} -catch(e){ -this.isFirstRender=false; -if(this.maxTries-->0){ -this.renderDelay=MochiKit.Async.wait(this.IEDelay); -this.renderDelay.addCallback(bind(this.render,this)); -} -return; -} -} -if(this.options.drawBackground){ -this._renderBackground(); -} -if(this.layout.style=="bar"){ -this._renderBarChart(); -this._renderBarAxis(); -}else{ -if(this.layout.style=="pie"){ -this._renderPieChart(); -this._renderPieAxis(); -}else{ -if(this.layout.style=="line"){ -this._renderLineChart(); -this._renderLineAxis(); -} -} -} -}; -PlotKit.CanvasRenderer.prototype._renderBarChartWrap=function(data,_168){ -var _169=this.element.getContext("2d"); -var _170=this.options.colorScheme.length; -var _171=this.options.colorScheme; -var _172=MochiKit.Base.keys(this.layout.datasets); -var _173=_172.length; -for(var i=0;i<_173;i++){ -var _174=_172[i]; -var _175=_171[i%_170]; -_169.save(); -_169.fillStyle=_175.toRGBString(); -if(this.options.strokeColor){ -_169.strokeStyle=this.options.strokeColor.toRGBString(); -}else{ -if(this.options.strokeColorTransform){ -_169.strokeStyle=_175[this.options.strokeColorTransform]().toRGBString(); -} -} -_169.lineWidth=this.options.strokeWidth; -var _176=function(obj){ -if(obj.name==_174){ -_168(_169,obj); -} -}; -MochiKit.Iter.forEach(data,bind(_176,this)); -_169.restore(); -} -}; -PlotKit.CanvasRenderer.prototype._renderBarChart=function(){ -var bind=MochiKit.Base.bind; -var _178=function(_179,bar){ -var x=this.area.w*bar.x+this.area.x; -var y=this.area.h*bar.y+this.area.y; -var w=this.area.w*bar.w; -var h=this.area.h*bar.h; -if((w<1)||(h<1)){ -return; -} -if(this.options.shouldFill){ -_179.fillRect(x,y,w,h); -} -if(this.options.shouldStroke){ -_179.strokeRect(x,y,w,h); -} -}; -this._renderBarChartWrap(this.layout.bars,bind(_178,this)); -}; -PlotKit.CanvasRenderer.prototype._renderLineChart=function(){ -var _182=this.element.getContext("2d"); -var _183=this.options.colorScheme.length; -var _184=this.options.colorScheme; -var _185=MochiKit.Base.keys(this.layout.datasets); -var _186=_185.length; -var bind=MochiKit.Base.bind; -var _187=MochiKit.Base.partial; -for(var i=0;i<_186;i++){ -var _188=_185[i]; -var _189=_184[i%_183]; -var _190=this.options.strokeColorTransform; -_182.save(); -_182.fillStyle=_189.toRGBString(); -if(this.options.strokeColor){ -_182.strokeStyle=this.options.strokeColor.toRGBString(); -}else{ -if(this.options.strokeColorTransform){ -_182.strokeStyle=_189[_190]().toRGBString(); -} -} -_182.lineWidth=this.options.strokeWidth; -var _191=function(ctx){ -ctx.beginPath(); -ctx.moveTo(this.area.x,this.area.y+this.area.h); -var _193=function(ctx_,_195){ -if(_195.name==_188){ -ctx_.lineTo(this.area.w*_195.x+this.area.x,this.area.h*_195.y+this.area.y); -} -}; -MochiKit.Iter.forEach(this.layout.points,_187(_193,ctx),this); -ctx.lineTo(this.area.w+this.area.x,this.area.h+this.area.y); -ctx.lineTo(this.area.x,this.area.y+this.area.h); -ctx.closePath(); -}; -if(this.options.shouldFill){ -bind(_191,this)(_182); -_182.fill(); -} -if(this.options.shouldStroke){ -bind(_191,this)(_182); -_182.stroke(); -} -_182.restore(); -} -}; -PlotKit.CanvasRenderer.prototype._renderPieChart=function(){ -var _196=this.element.getContext("2d"); -var _197=this.options.colorScheme.length; -var _198=this.layout.slices; -var _199=this.area.x+this.area.w*0.5; -var _200=this.area.y+this.area.h*0.5; -var _201=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius); -if(this.isIE){ -_199=parseInt(_199); -_200=parseInt(_200); -_201=parseInt(_201); -} -for(var i=0;i<_198.length;i++){ -var _202=this.options.colorScheme[i%_197]; -_196.save(); -_196.fillStyle=_202.toRGBString(); -var _203=function(){ -_196.beginPath(); -_196.moveTo(_199,_200); -_196.arc(_199,_200,_201,_198[i].startAngle-Math.PI/2,_198[i].endAngle-Math.PI/2,false); -_196.lineTo(_199,_200); -_196.closePath(); -}; -if(Math.abs(_198[i].startAngle-_198[i].endAngle)>0.001){ -if(this.options.shouldFill){ -_203(); -_196.fill(); -} -if(this.options.shouldStroke){ -_203(); -_196.lineWidth=this.options.strokeWidth; -if(this.options.strokeColor){ -_196.strokeStyle=this.options.strokeColor.toRGBString(); -}else{ -if(this.options.strokeColorTransform){ -_196.strokeStyle=_202[this.options.strokeColorTransform]().toRGBString(); -} -} -_196.stroke(); -} -} -_196.restore(); -} -}; -PlotKit.CanvasRenderer.prototype._renderBarAxis=function(){ -this._renderAxis(); -}; -PlotKit.CanvasRenderer.prototype._renderLineAxis=function(){ -this._renderAxis(); -}; -PlotKit.CanvasRenderer.prototype._renderAxis=function(){ -if(!this.options.drawXAxis&&!this.options.drawYAxis){ -return; -} -var _204=this.element.getContext("2d"); -var _205={"style":{"position":"absolute","fontSize":this.options.axisLabelFontSize+"px","zIndex":10,"color":this.options.axisLabelColor.toRGBString(),"width":this.options.axisLabelWidth+"px","overflow":"hidden"}}; -_204.save(); -_204.strokeStyle=this.options.axisLineColor.toRGBString(); -_204.lineWidth=this.options.axisLineWidth; -if(this.options.drawYAxis){ -if(this.layout.yticks){ -var _206=function(tick){ -if(typeof (tick)=="function"){ -return; -} -var x=this.area.x; -var y=this.area.y+tick[0]*this.area.h; -_204.beginPath(); -_204.moveTo(x,y); -_204.lineTo(x-this.options.axisTickSize,y); -_204.closePath(); -_204.stroke(); -var _207=DIV(_205,tick[1]); -_207.style.top=(y-this.options.axisLabelFontSize)+"px"; -_207.style.left=(x-this.options.padding.left-this.options.axisTickSize)+"px"; -_207.style.textAlign="right"; -_207.style.width=(this.options.padding.left-this.options.axisTickSize*2)+"px"; -MochiKit.DOM.appendChildNodes(this.container,_207); -this.ylabels.push(_207); -}; -MochiKit.Iter.forEach(this.layout.yticks,bind(_206,this)); -} -_204.beginPath(); -_204.moveTo(this.area.x,this.area.y); -_204.lineTo(this.area.x,this.area.y+this.area.h); -_204.closePath(); -_204.stroke(); -} -if(this.options.drawXAxis){ -if(this.layout.xticks){ -var _206=function(tick){ -if(typeof (dataset)=="function"){ -return; -} -var x=this.area.x+tick[0]*this.area.w; -var y=this.area.y+this.area.h; -_204.beginPath(); -_204.moveTo(x,y); -_204.lineTo(x,y+this.options.axisTickSize); -_204.closePath(); -_204.stroke(); -var _208=DIV(_205,tick[1]); -_208.style.top=(y+this.options.axisTickSize)+"px"; -_208.style.left=(x-this.options.axisLabelWidth/2)+"px"; -_208.style.textAlign="center"; -_208.style.width=this.options.axisLabelWidth+"px"; -MochiKit.DOM.appendChildNodes(this.container,_208); -this.xlabels.push(_208); -}; -MochiKit.Iter.forEach(this.layout.xticks,bind(_206,this)); -} -_204.beginPath(); -_204.moveTo(this.area.x,this.area.y+this.area.h); -_204.lineTo(this.area.x+this.area.w,this.area.y+this.area.h); -_204.closePath(); -_204.stroke(); -} -_204.restore(); -}; -PlotKit.CanvasRenderer.prototype._renderPieAxis=function(){ -if(!this.options.drawXAxis){ -return; -} -if(this.layout.xticks){ -var _209=new Array(); -for(var i=0;iMath.PI*2){ -_216=_216-Math.PI*2; -}else{ -if(_216<0){ -_216=_216+Math.PI*2; -} -} -var _217=_210+Math.sin(_216)*(_212+10); -var _218=_211-Math.cos(_216)*(_212+10); -var _219={"position":"absolute","zIndex":11,"width":_213+"px","fontSize":this.options.axisLabelFontSize+"px","overflow":"hidden","color":this.options.axisLabelColor.toHexString()}; -if(_216<=Math.PI*0.5){ -_219["textAlign"]="left"; -_219["verticalAlign"]="top"; -_219["left"]=_217+"px"; -_219["top"]=(_218-this.options.axisLabelFontSize)+"px"; -}else{ -if((_216>Math.PI*0.5)&&(_216<=Math.PI)){ -_219["textAlign"]="left"; -_219["verticalAlign"]="bottom"; -_219["left"]=_217+"px"; -_219["top"]=_218+"px"; -}else{ -if((_216>Math.PI)&&(_216<=Math.PI*1.5)){ -_219["textAlign"]="right"; -_219["verticalAlign"]="bottom"; -_219["left"]=(_217-_213)+"px"; -_219["top"]=_218+"px"; -}else{ -_219["textAlign"]="right"; -_219["verticalAlign"]="bottom"; -_219["left"]=(_217-_213)+"px"; -_219["top"]=(_218-this.options.axisLabelFontSize)+"px"; -} -} -} -var _220=DIV({"style":_219},this.layout.xticks[i][1]); -this.xlabels.push(_220); -MochiKit.DOM.appendChildNodes(this.container,_220); -} -} -}; -PlotKit.CanvasRenderer.prototype._renderBackground=function(){ -var _221=this.element.getContext("2d"); -_221.save(); -_221.fillStyle=this.options.backgroundColor.toRGBString(); -_221.fillRect(0,0,this.width,this.height); -_221.restore(); -}; -PlotKit.CanvasRenderer.prototype.clear=function(){ -if(this.isIE){ -try{ -if(this.clearDelay){ -this.clearDelay.cancel(); -this.clearDelay=null; -} -var _222=this.element.getContext("2d"); -} -catch(e){ -this.isFirstRender=false; -this.clearDelay=MochiKit.Async.wait(this.IEDelay); -this.clearDelay.addCallback(bind(this.clear,this)); -return; -} -} -var _222=this.element.getContext("2d"); -_222.clearRect(0,0,this.width,this.height); -MochiKit.Iter.forEach(this.xlabels,MochiKit.DOM.removeElement); -MochiKit.Iter.forEach(this.ylabels,MochiKit.DOM.removeElement); -this.xlabels=new Array(); -this.ylabels=new Array(); -}; -PlotKit.CanvasRenderer.prototype._initialiseEvents=function(){ -var _223=MochiKit.Signal.connect; -var bind=MochiKit.Base.bind; -_223(this.element,"onclick",bind(this.onclick,this)); -}; -PlotKit.CanvasRenderer.prototype._resolveObject=function(e){ -var x=(e.mouse().page.x-PlotKit.Base.findPosX(this.element)-this.area.x)/this.area.w; -var y=(e.mouse().page.y-PlotKit.Base.findPosY(this.element)-this.area.y)/this.area.h; -var _225=this.layout.hitTest(x,y); -if(_225){ -return _225; -} -return null; -}; -PlotKit.CanvasRenderer.prototype._createEventObject=function(_226,e){ -if(_226==null){ -return null; -} -e.chart=_226; -return e; -}; -PlotKit.CanvasRenderer.prototype.onclick=function(e){ -var _227=this._resolveObject(e); -var _228=this._createEventObject(_227,e); -if(_228!=null){ -MochiKit.Signal.signal(this,"onclick",_228); -} -}; -PlotKit.CanvasRenderer.prototype.onmouseover=function(e){ -var _229=this._resolveObject(e); -var _230=this._createEventObject(_229,e); -if(_230!=null){ -signal(this,"onmouseover",_230); -} -}; -PlotKit.CanvasRenderer.prototype.onmouseout=function(e){ -var _231=this._resolveObject(e); -var _232=this._createEventObject(_231,e); -if(_232==null){ -signal(this,"onmouseout",e); -}else{ -signal(this,"onmouseout",_232); -} -}; -PlotKit.CanvasRenderer.prototype.onmousemove=function(e){ -var _233=this._resolveObject(e); -var _234=this._createEventObject(_233,e); -if((_233==null)&&(this.event_isinside==null)){ -return; -} -if((_233!=null)&&(this.event_isinside==null)){ -signal(this,"onmouseover",_234); -} -if((_233==null)&&(this.event_isinside!=null)){ -signal(this,"onmouseout",_234); -} -if((_233!=null)&&(this.event_isinside!=null)){ -signal(this,"onmousemove",_234); -} -this.event_isinside=_233; -}; -PlotKit.CanvasRenderer.isSupported=function(_235){ -var _236=null; -try{ -if(MochiKit.Base.isUndefinedOrNull(_235)){ -_236=MochiKit.DOM.CANVAS({}); -}else{ -_236=MochiKit.DOM.getElement(_235); -} -var _237=_236.getContext("2d"); -} -catch(e){ -var ie=navigator.appVersion.match(/MSIE (\d\.\d)/); -var _239=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1); -if((!ie)||(ie[1]<6)||(_239)){ -return false; -} -return true; -} -return true; -}; -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); -try{ -if(typeof (PlotKit.Layout)=="undefined"){ -throw ""; -} -} -catch(e){ -throw "PlotKit depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.Layout"; -} -PlotKit.SVGRenderer=function(_240,_241,_242){ -if(arguments.length>0){ -this.__init__(_240,_241,_242); -} -}; -PlotKit.SVGRenderer.NAME="PlotKit.SVGRenderer"; -PlotKit.SVGRenderer.VERSION=PlotKit.VERSION; -PlotKit.SVGRenderer.__repr__=function(){ -return "["+this.NAME+" "+this.VERSION+"]"; -}; -PlotKit.SVGRenderer.toString=function(){ -return this.__repr__(); -}; -PlotKit.SVGRenderer.SVGNS="http://www.w3.org/2000/svg"; -PlotKit.SVGRenderer.prototype.__init__=function(_243,_244,_245){ -var _246=MochiKit.Base.isUndefinedOrNull; -this.options={"drawBackground":true,"backgroundColor":Color.whiteColor(),"padding":{left:30,right:30,top:5,bottom:10},"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[1]),"strokeColor":Color.whiteColor(),"strokeColorTransform":"asStrokeColor","strokeWidth":0.5,"shouldFill":true,"shouldStroke":true,"drawXAxis":true,"drawYAxis":true,"axisLineColor":Color.blackColor(),"axisLineWidth":0.5,"axisTickSize":3,"axisLabelColor":Color.blackColor(),"axisLabelFont":"Arial","axisLabelFontSize":9,"axisLabelWidth":50,"axisLabelUseDiv":true,"pieRadius":0.4,"enableEvents":true}; -MochiKit.Base.update(this.options,_245?_245:{}); -this.layout=_244; -this.element=MochiKit.DOM.getElement(_243); -this.container=this.element.parentNode; -this.height=parseInt(this.element.getAttribute("height")); -this.width=parseInt(this.element.getAttribute("width")); -this.document=document; -this.root=this.element; -try{ -this.document=this.element.getSVGDocument(); -this.root=_246(this.document.documentElement)?this.element:this.document.documentElement; -} -catch(e){ -} -this.element.style.zIndex=1; -if(_246(this.element)){ -throw "SVGRenderer() - passed SVG object is not found"; -} -if(_246(this.container)||this.container.nodeName.toLowerCase()!="div"){ -throw "SVGRenderer() - No DIV's around the SVG."; -} -this.xlabels=new Array(); -this.ylabels=new Array(); -this.defs=this.createSVGElement("defs"); -this.area={x:this.options.padding.left,y:this.options.padding.top,w:this.width-this.options.padding.left-this.options.padding.right,h:this.height-this.options.padding.top-this.options.padding.bottom}; -MochiKit.DOM.updateNodeAttributes(this.container,{"style":{"position":"relative","width":this.width+"px"}}); -}; -PlotKit.SVGRenderer.prototype.render=function(){ -if(this.options.drawBackground){ -this._renderBackground(); -} -if(this.layout.style=="bar"){ -this._renderBarChart(); -this._renderBarAxis(); -}else{ -if(this.layout.style=="pie"){ -this._renderPieChart(); -this._renderPieAxis(); -}else{ -if(this.layout.style=="line"){ -this._renderLineChart(); -this._renderLineAxis(); -} -} -} -}; -PlotKit.SVGRenderer.prototype._renderBarOrLine=function(data,_247,_248,_249){ -var _250=this.options.colorScheme.length; -var _251=this.options.colorScheme; -var _252=MochiKit.Base.keys(this.layout.datasets); -var _253=_252.length; -for(var i=0;i<_253;i++){ -var _254=_252[i]; -var _255=new Array(); -var _256=_251[i%_250]; -if(this.options.shouldFill){ -_255["fill"]=_256.toRGBString(); -}else{ -_255["fill"]="none"; -} -if(this.options.shouldStroke&&(this.options.strokeColor||this.options.strokeColorTransform)){ -if(this.options.strokeColor){ -_255["stroke"]=this.options.strokeColor.toRGBString(); -}else{ -if(this.options.strokeColorTransform){ -_255["stroke"]=_256[this.options.strokeColorTransform]().toRGBString(); -} -} -_255["strokeWidth"]=this.options.strokeWidth; -} -if(_248){ -_248(_255); -} -var _257=function(obj){ -if(obj.name==_254){ -_247(_255,obj); -} -}; -MochiKit.Iter.forEach(data,bind(_257,this)); -if(_249){ -_249(_255); -} -} -}; -PlotKit.SVGRenderer.prototype._renderBarChart=function(){ -var bind=MochiKit.Base.bind; -var _258=function(_259,bar){ -var x=this.area.w*bar.x+this.area.x; -var y=this.area.h*bar.y+this.area.y; -var w=this.area.w*bar.w; -var h=this.area.h*bar.h; -this._drawRect(x,y,w,h,_259); -}; -this._renderBarOrLine(this.layout.bars,bind(_258,this)); -}; -PlotKit.SVGRenderer.prototype._renderLineChart=function(){ -var bind=MochiKit.Base.bind; -var _260=function(_261,_262){ -this._tempPointsBuffer+=(this.area.w*_262.x+this.area.x)+","+(this.area.h*_262.y+this.area.y)+" "; -}; -var _263=function(_264){ -this._tempPointsBuffer=""; -this._tempPointsBuffer+=(this.area.x)+","+(this.area.y+this.area.h)+" "; -}; -var _265=function(_266){ -this._tempPointsBuffer+=(this.area.w+this.area.x)+","+(this.area.h+this.area.y); -_266["points"]=this._tempPointsBuffer; -var elem=this.createSVGElement("polygon",_266); -this.root.appendChild(elem); -}; -this._renderBarOrLine(this.layout.points,bind(_260,this),bind(_263,this),bind(_265,this)); -}; -PlotKit.SVGRenderer.prototype._renderPieChart=function(){ -var _268=this.options.colorScheme.length; -var _269=this.layout.slices; -var _270=this.area.x+this.area.w*0.5; -var _271=this.area.y+this.area.h*0.5; -var _272=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius); -if(_269.length==1&&(Math.abs(_269[0].startAngle)-Math.abs(_269[0].endAngle)<0.1)){ -var _273={"cx":_270,"cy":_271,"r":_272}; -var _274=this.options.colorScheme[0]; -if(this.options.shouldFill){ -_273["fill"]=_274.toRGBString(); -}else{ -_273["fill"]="none"; -} -if(this.options.shouldStroke&&(this.options.strokeColor||this.options.strokeColorTransform)){ -if(this.options.strokeColor){ -_273["stroke"]=this.options.strokeColor.toRGBString(); -}else{ -if(this.options.strokeColorTransform){ -_273["stroke"]=_274[this.options.strokeColorTransform]().toRGBString(); -} -} -_273["style"]="stroke-width: "+this.options.strokeWidth; -} -this.root.appendChild(this.createSVGElement("circle",_273)); -return; -} -for(var i=0;i<_269.length;i++){ -var _273=new Array(); -var _274=this.options.colorScheme[i%_268]; -if(this.options.shouldFill){ -_273["fill"]=_274.toRGBString(); -}else{ -_273["fill"]="none"; -} -if(this.options.shouldStroke&&(this.options.strokeColor||this.options.strokeColorTransform)){ -if(this.options.strokeColor){ -_273["stroke"]=this.options.strokeColor.toRGBString(); -}else{ -if(this.options.strokeColorTransform){ -_273["stroke"]=_274[this.options.strokeColorTransform]().toRGBString(); -} -} -_273["style"]="stroke-width:"+this.options.strokeWidth; -} -var _275=0; -if(Math.abs(_269[i].endAngle-_269[i].startAngle)>Math.PI){ -_275=1; -} -var x1=Math.cos(_269[i].startAngle-Math.PI/2)*_272; -var y1=Math.sin(_269[i].startAngle-Math.PI/2)*_272; -var x2=Math.cos(_269[i].endAngle-Math.PI/2)*_272; -var y2=Math.sin(_269[i].endAngle-Math.PI/2)*_272; -var rx=x2-x1; -var ry=y2-y1; -var _282="M"+_270+","+_271+" "; -_282+="l"+x1+","+y1+" "; -_282+="a"+_272+","+_272+" 0 "+_275+",1 "+rx+","+ry+" z"; -_273["d"]=_282; -var elem=this.createSVGElement("path",_273); -this.root.appendChild(elem); -} -}; -PlotKit.SVGRenderer.prototype._renderBarAxis=function(){ -this._renderAxis(); -}; -PlotKit.SVGRenderer.prototype._renderLineAxis=function(){ -this._renderAxis(); -}; -PlotKit.SVGRenderer.prototype._renderAxis=function(){ -if(!this.options.drawXAxis&&!this.options.drawYAxis){ -return; -} -var _283={"style":{"position":"absolute","textAlign":"center","fontSize":this.options.axisLabelFontSize+"px","zIndex":10,"color":this.options.axisLabelColor.toRGBString(),"width":this.options.axisLabelWidth+"px","overflow":"hidden"}}; -var _284={"stroke":this.options.axisLineColor.toRGBString(),"strokeWidth":this.options.axisLineWidth}; -if(this.options.drawYAxis){ -if(this.layout.yticks){ -var _285=function(tick){ -var x=this.area.x; -var y=this.area.y+tick[0]*this.area.h; -this._drawLine(x,y,x-3,y,_284); -if(this.options.axisLabelUseDiv){ -var _286=DIV(_283,tick[1]); -_286.style.top=(y-this.options.axisLabelFontSize)+"px"; -_286.style.left=(x-this.options.padding.left+this.options.axisTickSize)+"px"; -_286.style.textAlign="left"; -_286.style.width=(this.options.padding.left-3)+"px"; -MochiKit.DOM.appendChildNodes(this.container,_286); -this.ylabels.push(_286); -}else{ -var _287={y:y+3,x:(x-this.options.padding.left+3),width:(this.options.padding.left-this.options.axisTickSize)+"px",height:(this.options.axisLabelFontSize+3)+"px",fontFamily:"Arial",fontSize:this.options.axisLabelFontSize+"px",fill:this.options.axisLabelColor.toRGBString()}; -var _286=this.createSVGElement("text",_287); -_286.appendChild(this.document.createTextNode(tick[1])); -this.root.appendChild(_286); -} -}; -MochiKit.Iter.forEach(this.layout.yticks,bind(_285,this)); -} -this._drawLine(this.area.x,this.area.y,this.area.x,this.area.y+this.area.h,_284); -} -if(this.options.drawXAxis){ -if(this.layout.xticks){ -var _285=function(tick){ -var x=this.area.x+tick[0]*this.area.w; -var y=this.area.y+this.area.h; -this._drawLine(x,y,x,y+this.options.axisTickSize,_284); -if(this.options.axisLabelUseDiv){ -var _288=DIV(_283,tick[1]); -_288.style.top=(y+this.options.axisTickSize)+"px"; -_288.style.left=(x-this.options.axisLabelWidth/2)+"px"; -_288.style.textAlign="center"; -_288.style.width=this.options.axisLabelWidth+"px"; -MochiKit.DOM.appendChildNodes(this.container,_288); -this.xlabels.push(_288); -}else{ -var _289={y:(y+this.options.axisTickSize+this.options.axisLabelFontSize),x:x-3,width:this.options.axisLabelWidth+"px",height:(this.options.axisLabelFontSize+3)+"px",fontFamily:"Arial",fontSize:this.options.axisLabelFontSize+"px",fill:this.options.axisLabelColor.toRGBString(),textAnchor:"middle"}; -var _288=this.createSVGElement("text",_289); -_288.appendChild(this.document.createTextNode(tick[1])); -this.root.appendChild(_288); -} -}; -MochiKit.Iter.forEach(this.layout.xticks,bind(_285,this)); -} -this._drawLine(this.area.x,this.area.y+this.area.h,this.area.x+this.area.w,this.area.y+this.area.h,_284); -} -}; -PlotKit.SVGRenderer.prototype._renderPieAxis=function(){ -if(this.layout.xticks){ -var _290=new Array(); -for(var i=0;iMath.PI*2){ -_297=_297-Math.PI*2; -}else{ -if(_297<0){ -_297=_297+Math.PI*2; -} -} -var _298=_291+Math.sin(_297)*(_293+10); -var _299=_292-Math.cos(_297)*(_293+10); -var _300={"position":"absolute","zIndex":11,"width":_294+"px","fontSize":this.options.axisLabelFontSize+"px","overflow":"hidden","color":this.options.axisLabelColor.toHexString()}; -var _301={"width":_294+"px","fontSize":this.options.axisLabelFontSize+"px","height":(this.options.axisLabelFontSize+3)+"px","fill":this.options.axisLabelColor.toRGBString()}; -if(_297<=Math.PI*0.5){ -MochiKit.Base.update(_300,{"textAlign":"left","verticalAlign":"top","left":_298+"px","top":(_299-this.options.axisLabelFontSize)+"px"}); -MochiKit.Base.update(_301,{"x":_298,"y":(_299-this.options.axisLabelFontSize),"textAnchor":"left"}); -}else{ -if((_297>Math.PI*0.5)&&(_297<=Math.PI)){ -MochiKit.Base.update(_300,{"textAlign":"left","verticalAlign":"bottom","left":_298+"px","top":_299+"px"}); -MochiKit.Base.update(_301,{"textAnchor":"left","x":_298,"y":_299}); -}else{ -if((_297>Math.PI)&&(_297<=Math.PI*1.5)){ -MochiKit.Base.update(_300,{"textAlign":"right","verticalAlign":"bottom","left":_298+"px","top":_299+"px"}); -MochiKit.Base.update(_301,{"textAnchor":"right","x":_298-_294,"y":_299}); -}else{ -MochiKit.Base.update(_300,{"textAlign":"left","verticalAlign":"bottom","left":_298+"px","top":_299+"px"}); -MochiKit.Base.update(_301,{"textAnchor":"left","x":_298-_294,"y":_299-this.options.axisLabelFontSize}); -} -} -} -if(this.options.axisLabelUseDiv){ -var _302=DIV({"style":_300},this.layout.xticks[i][1]); -this.xlabels.push(_302); -MochiKit.DOM.appendChildNodes(this.container,_302); -}else{ -var _302=this.createSVGElement("text",_301); -_302.appendChild(this.document.createTextNode(this.layout.xticks[i][1])); -this.root.appendChild(_302); -} -} -} -}; -PlotKit.SVGRenderer.prototype._renderBackground=function(){ -var opts={"stroke":"none","fill":this.options.backgroundColor.toRGBString()}; -this._drawRect(0,0,this.width,this.height,opts); -}; -PlotKit.SVGRenderer.prototype._drawRect=function(x,y,w,h,_304){ -var _305={x:x+"px",y:y+"px",width:w+"px",height:h+"px"}; -if(_304){ -MochiKit.Base.update(_305,_304); -} -var elem=this.createSVGElement("rect",_305); -this.root.appendChild(elem); -}; -PlotKit.SVGRenderer.prototype._drawLine=function(x1,y1,x2,y2,_306){ -var _307={x1:x1+"px",y1:y1+"px",x2:x2+"px",y2:y2+"px"}; -if(_306){ -MochiKit.Base.update(_307,_306); -} -var elem=this.createSVGElement("line",_307); -this.root.appendChild(elem); -}; -PlotKit.SVGRenderer.prototype.clear=function(){ -while(this.element.firstChild){ -this.element.removeChild(this.element.firstChild); -} -if(this.options.axisLabelUseDiv){ -for(var i=0;i=6)&&(!_313)){ -var _314=_312["width"]?_312["width"]:"100"; -var _315=_312["height"]?_312["height"]:"100"; -var eid=_312["id"]?_312["id"]:"notunique"; -var html=""; -var _318=document.createElement(html); -var _319=_318.getSVGDocument().createElementNS(PlotKit.SVGRenderer.SVGNS,"svg"); -_319.setAttribute("width",_314); -_319.setAttribute("height",_315); -_318.getSVGDocument().appendChild(_319); -return _318; -}else{ -return PlotKit.SVGRenderer.prototype.createSVGElement("svg",_312); -} -}; -PlotKit.SVGRenderer.isSupported=function(){ -var _320=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1); -var _321=navigator.appVersion.match(/MSIE (\d\.\d)/); -var _322=navigator.userAgent.match(/AppleWebKit\/(\d+)/); -var _323=navigator.userAgent.match(/Opera\/(\d*\.\d*)/); -var _324=navigator.userAgent.match(/rv:(\d*\.\d*).*Gecko/); -var _325="http://www.w3.org/TR/SVG11/feature#SVG"; -if(_321&&(_321[1]>=6)&&!_320){ -return document.implementation.hasFeature(_325,"1.1"); -} -if(_323&&(_323[1]>8.9)){ -return true; -} -if(_324&&(_324>1.7)){ -return true; -} -return false; -}; -PlotKit.SVG={}; -PlotKit.SVG.SVGRenderer=PlotKit.SVGRenderer; -PlotKit.SVG.EXPORT=["SVGRenderer"]; -PlotKit.SVG.EXPORT_OK=["SVGRenderer"]; -PlotKit.SVG.__new__=function(){ -var m=MochiKit.Base; -m.nameFunctions(this); -this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; -}; -PlotKit.SVG.__new__(); -MochiKit.Base._exportSymbols(this,PlotKit.SVG); -try{ -if(typeof (PlotKit.CanvasRenderer)=="undefined"){ -throw ""; -} -} -catch(e){ -throw "SweetCanvas depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, Canvas}"; -} -if(typeof (PlotKit.SweetCanvasRenderer)=="undefined"){ -PlotKit.SweetCanvasRenderer={}; -} -PlotKit.SweetCanvasRenderer=function(_326,_327,_328){ -if(arguments.length>0){ -this.__init__(_326,_327,_328); -} -}; -PlotKit.SweetCanvasRenderer.NAME="PlotKit.SweetCanvasRenderer"; -PlotKit.SweetCanvasRenderer.VERSION=PlotKit.VERSION; -PlotKit.SweetCanvasRenderer.__repr__=function(){ -return "["+this.NAME+" "+this.VERSION+"]"; -}; -PlotKit.SweetCanvasRenderer.toString=function(){ -return this.__repr__(); -}; -PlotKit.SweetCanvasRenderer.prototype=new PlotKit.CanvasRenderer(); -PlotKit.SweetCanvasRenderer.prototype.constructor=PlotKit.SweetCanvasRenderer; -PlotKit.SweetCanvasRenderer.__super__=PlotKit.CanvasRenderer.prototype; -PlotKit.SweetCanvasRenderer.prototype.__init__=function(el,_330,opts){ -var _331=PlotKit.Base.officeBlue(); -MochiKit.Base.update(_331,opts); -PlotKit.SweetCanvasRenderer.__super__.__init__.call(this,el,_330,_331); -}; -PlotKit.SweetCanvasRenderer.prototype._renderBarChart=function(){ -var bind=MochiKit.Base.bind; -var _332=Color.blackColor().colorWithAlpha(0.1).toRGBString(); -var _333=function(_334,x,y,w,h){ -_334.fillStyle=_332; -_334.fillRect(x-2,y-2,w+4,h+2); -_334.fillStyle=_332; -_334.fillRect(x-1,y-1,w+2,h+1); -}; -var _335=this.options.colorScheme.length; -var _336=this.options.colorScheme; -var _337=PlotKit.Base.keys(this.layout.datasets); -var _338=_337.length; -var _339=function(name){ -for(var i=0;i<_338;i++){ -if(name==_337[i]){ -return _336[i%_335]; -} -} -return _336[0]; -}; -var _340=function(_341,bar){ -var x=this.area.w*bar.x+this.area.x; -var y=this.area.h*bar.y+this.area.y; -var w=this.area.w*bar.w; -var h=this.area.h*bar.h; -if((w<1)||(h<1)){ -return; -} -_341.save(); -_341.shadowBlur=5; -_341.shadowColor=Color.fromHexString("#888888").toRGBString(); -if(this.isIE){ -_341.save(); -_341.fillStyle="#cccccc"; -_341.fillRect(x-2,y-2,w+4,h+2); -_341.restore(); -}else{ -_333(_341,x,y,w,h); -} -if(this.options.shouldFill){ -_341.fillStyle=_339(bar.name).toRGBString(); -_341.fillRect(x,y,w,h); -} -_341.shadowBlur=0; -_341.strokeStyle=Color.whiteColor().toRGBString(); -_341.lineWidth=2; -if(this.options.shouldStroke){ -_341.strokeRect(x,y,w,h); -} -_341.restore(); -}; -this._renderBarChartWrap(this.layout.bars,bind(_340,this)); -}; -PlotKit.SweetCanvasRenderer.prototype._renderLineChart=function(){ -var _342=this.element.getContext("2d"); -var _343=this.options.colorScheme.length; -var _344=this.options.colorScheme; -var _345=PlotKit.Base.keys(this.layout.datasets); -var _346=_345.length; -var bind=MochiKit.Base.bind; -for(var i=0;i<_346;i++){ -var _347=_345[i]; -var _348=_344[i%_343]; -var _349=this.options.strokeColorTransform; -_342.save(); -var _350=function(ctx){ -ctx.beginPath(); -ctx.moveTo(this.area.x,this.area.y+this.area.h); -var _351=function(ctx_,_352){ -if(_352.name==_347){ -ctx_.lineTo(this.area.w*_352.x+this.area.x,this.area.h*_352.y+this.area.y); -} -}; -MochiKit.Iter.forEach(this.layout.points,partial(_351,ctx),this); -ctx.lineTo(this.area.w+this.area.x,this.area.h+this.area.y); -ctx.lineTo(this.area.x,this.area.y+this.area.h); -ctx.closePath(); -}; -if(this.options.shouldFill){ -_342.save(); -if(this.isIE){ -_342.fillStyle="#cccccc"; -}else{ -_342.fillStyle=Color.blackColor().colorWithAlpha(0.2).toRGBString(); -} -_342.translate(-1,-2); -bind(_350,this)(_342); -if(this.options.shouldFill){ -_342.fill(); -} -_342.restore(); -} -_342.shadowBlur=5; -_342.shadowColor=Color.fromHexString("#888888").toRGBString(); -_342.fillStyle=_348.toRGBString(); -_342.lineWidth=2; -_342.strokeStyle=Color.whiteColor().toRGBString(); -if(this.options.shouldFill){ -bind(_350,this)(_342); -_342.fill(); -} -if(this.options.shouldStroke){ -bind(_350,this)(_342); -_342.stroke(); -} -_342.restore(); -} -}; -PlotKit.SweetCanvasRenderer.prototype._renderPieChart=function(){ -var _353=this.element.getContext("2d"); -var _354=this.options.colorScheme.length; -var _355=this.layout.slices; -var _356=this.area.x+this.area.w*0.5; -var _357=this.area.y+this.area.h*0.5; -var _358=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius); -if(this.isIE){ -_356=parseInt(_356); -_357=parseInt(_357); -_358=parseInt(_358); -} -if(!this.isIE){ -_353.save(); -var _359=Color.blackColor().colorWithAlpha(0.2); -_353.fillStyle=_359.toRGBString(); -_353.shadowBlur=5; -_353.shadowColor=Color.fromHexString("#888888").toRGBString(); -_353.translate(1,1); -_353.beginPath(); -_353.moveTo(_356,_357); -_353.arc(_356,_357,_358+2,0,Math.PI*2,false); -_353.closePath(); -_353.fill(); -_353.restore(); -} -_353.save(); -_353.strokeStyle=Color.whiteColor().toRGBString(); -_353.lineWidth=2; -for(var i=0;i<_355.length;i++){ -var _360=this.options.colorScheme[i%_354]; -_353.fillStyle=_360.toRGBString(); -var _361=function(){ -_353.beginPath(); -_353.moveTo(_356,_357); -_353.arc(_356,_357,_358,_355[i].startAngle-Math.PI/2,_355[i].endAngle-Math.PI/2,false); -_353.lineTo(_356,_357); -_353.closePath(); -}; -if(Math.abs(_355[i].startAngle-_355[i].endAngle)>0.0001){ -if(this.options.shouldFill){ -_361(); -_353.fill(); -} -if(this.options.shouldStroke){ -_361(); -_353.stroke(); -} -} -} -_353.restore(); -}; -PlotKit.SweetCanvasRenderer.prototype._renderBackground=function(){ -var _362=this.element.getContext("2d"); -if(this.layout.style=="bar"||this.layout.style=="line"){ -_362.save(); -_362.fillStyle=this.options.backgroundColor.toRGBString(); -_362.fillRect(this.area.x,this.area.y,this.area.w,this.area.h); -_362.strokeStyle=this.options.axisLineColor.toRGBString(); -_362.lineWidth=1; -var _363=this.layout.yticks; -var _364=false; -if(this.layout.style=="bar"&&this.layout.options.barOrientation=="horizontal"){ -_363=this.layout.xticks; -_364=true; -} -for(var i=0;i<_363.length;i++){ -var x1=0; -var y1=0; -var x2=0; -var y2=0; -if(_364){ -x1=_363[i][0]*this.area.w+this.area.x; -y1=this.area.y; -x2=x1; -y2=y1+this.area.h; -}else{ -x1=this.area.x; -y1=_363[i][0]*this.area.h+this.area.y; -x2=x1+this.area.w; -y2=y1; -} -_362.beginPath(); -_362.moveTo(x1,y1); -_362.lineTo(x2,y2); -_362.closePath(); -_362.stroke(); -} -_362.restore(); -}else{ -PlotKit.SweetCanvasRenderer.__super__._renderBackground.call(this); -} -}; -PlotKit.SweetCanvas={}; -PlotKit.SweetCanvas.SweetCanvasRenderer=PlotKit.SweetCanvasRenderer; -PlotKit.SweetCanvas.EXPORT=["SweetCanvasRenderer"]; -PlotKit.SweetCanvas.EXPORT_OK=["SweetCanvasRenderer"]; -PlotKit.SweetCanvas.__new__=function(){ -var m=MochiKit.Base; -m.nameFunctions(this); -this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; -}; -PlotKit.SweetCanvas.__new__(); -MochiKit.Base._exportSymbols(this,PlotKit.SweetCanvas); -try{ -if(typeof (PlotKit.SVGRenderer)=="undefined"){ -throw ""; -} -} -catch(e){ -throw "SweetSVG depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, SVG}"; -} -if(typeof (PlotKit.SweetSVGRenderer)=="undefined"){ -PlotKit.SweetSVGRenderer={}; -} -PlotKit.SweetSVGRenderer=function(_365,_366,_367){ -if(arguments.length>0){ -this.__init__(_365,_366,_367); -} -}; -PlotKit.SweetSVGRenderer.NAME="PlotKit.SweetSVGRenderer"; -PlotKit.SweetSVGRenderer.VERSION=PlotKit.VERSION; -PlotKit.SweetSVGRenderer.__repr__=function(){ -return "["+this.NAME+" "+this.VERSION+"]"; -}; -PlotKit.SweetSVGRenderer.toString=function(){ -return this.__repr__(); -}; -PlotKit.SweetSVGRenderer.prototype=new PlotKit.SVGRenderer(); -PlotKit.SweetSVGRenderer.prototype.constructor=PlotKit.SweetSVGRenderer; -PlotKit.SweetSVGRenderer.__super__=PlotKit.SVGRenderer.prototype; -PlotKit.SweetSVGRenderer.prototype.__init__=function(_368,_369,_370){ -var _371=PlotKit.Base.officeBlue(); -MochiKit.Base.update(_371,_370); -PlotKit.SweetSVGRenderer.__super__.__init__.call(this,_368,_369,_371); -}; -PlotKit.SweetSVGRenderer.prototype._addDropShadowFilter=function(){ -var _372=this.createSVGElement("filter",{x:0,y:0,"id":"dropShadow"}); -var _373=this.createSVGElement("feOffset",{"in":"SourceGraphic","dx":0,"dy":0,"result":"topCopy"}); -var blur=this.createSVGElement("feGaussianBlur",{"in":"SourceAlpha","StdDeviation":2,"result":"shadow"}); -var _375=this.createSVGElement("feOffset",{"in":"shadow","dx":-1,"dy":-2,"result":"movedShadow"}); -var _376=this.createSVGElement("feMerge"); -var _377=this.createSVGElement("feMergeNode",{"in":"topCopy"}); -var _378=this.createSVGElement("feMergeNode",{"in":"movedShadow"}); -_376.appendChild(_377); -_376.appendChild(_378); -_372.appendChild(_373); -_372.appendChild(blur); -_372.appendChild(_375); -_372.appendChild(_376); -this.defs.appendChild(_372); -}; -PlotKit.SweetSVGRenderer.prototype._renderBarChart=function(){ -var bind=MochiKit.Base.bind; -var _379=Color.blackColor().toRGBString(); -var _380="fill:"+_379+";fill-opacity:0.15"; -var _381="stroke-width: 2.0; stroke:"+Color.whiteColor().toRGBString(); -var _382=function(_383,bar){ -var x=this.area.w*bar.x+this.area.x; -var y=this.area.h*bar.y+this.area.y; -var w=this.area.w*bar.w; -var h=this.area.h*bar.h; -if((w<1)||(h<1)){ -return; -} -_383["style"]=_381; -this._drawRect(x-2,y-1,w+4,h+2,{"style":_380}); -this._drawRect(x,y,w,h,_383); -}; -this._renderBarOrLine(this.layout.bars,bind(_382,this)); -}; -PlotKit.SweetSVGRenderer.prototype._renderLineChart=function(){ -var bind=MochiKit.Base.bind; -var _384=Color.blackColor().toRGBString(); -var _385="fill:"+_384+";fill-opacity:0.15"; -var _386="stroke-width: 2.0; stroke:"+Color.whiteColor().toRGBString(); -var _387=function(_388,_389){ -this._tempPointsBuffer+=(this.area.w*_389.x+this.area.x)+","+(this.area.h*_389.y+this.area.y)+" "; -}; -var _390=function(_391){ -this._tempPointsBuffer=""; -this._tempPointsBuffer+=(this.area.x)+","+(this.area.y+this.area.h)+" "; -}; -var _392=function(_393){ -this._tempPointsBuffer+=(this.area.w+this.area.x)+","+(this.area.h+this.area.y); -_393["points"]=this._tempPointsBuffer; -_393["stroke"]="none"; -_393["transform"]="translate(-2, -1)"; -_393["style"]=_385; -var _394=this.createSVGElement("polygon",_393); -this.root.appendChild(_394); -_393["transform"]=""; -_393["style"]=_386; -var elem=this.createSVGElement("polygon",_393); -this.root.appendChild(elem); -}; -this._renderBarOrLine(this.layout.points,bind(_387,this),bind(_390,this),bind(_392,this)); -}; -PlotKit.SweetSVGRenderer.prototype._renderPieChart=function(){ -var _395=this.area.x+this.area.w*0.5; -var _396=this.area.y+this.area.h*0.5; -var _397=Color.blackColor().toRGBString(); -var _398=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius); -var _399="fill:"+_397+";fill-opacity:0.15"; -var _400=this.createSVGElement("circle",{"style":_399,"cx":_395+1,"cy":_396+1,"r":_398+1}); -this.root.appendChild(_400); -PlotKit.SweetSVGRenderer.__super__._renderPieChart.call(this); -}; -PlotKit.SweetSVGRenderer.prototype._renderBackground=function(){ -var _401={"fill":this.options.backgroundColor.toRGBString(),"stroke":"none"}; -if(this.layout.style=="bar"||this.layout.style=="line"){ -this._drawRect(this.area.x,this.area.y,this.area.w,this.area.h,_401); -var _402=this.layout.yticks; -var _403=false; -if(this.layout.style=="bar"&&this.layout.options.barOrientation=="horizontal"){ -_402=this.layout.xticks; -_403=true; -} -for(var i=0;i<_402.length;i++){ -var x=0; -var y=0; -var w=0; -var h=0; -if(_403){ -x=_402[i][0]*this.area.w+this.area.x; -y=this.area.y; -w=1; -h=this.area.w; -}else{ -x=this.area.x; -y=_402[i][0]*this.area.h+this.area.y; -w=this.area.w; -h=1; -} -this._drawRect(x,y,w,h,{"fill":this.options.axisLineColor.toRGBString()}); -} -}else{ -PlotKit.SweetSVGRenderer.__super__._renderBackground.call(this); -} -}; -PlotKit.SweetSVG={}; -PlotKit.SweetSVG.SweetSVGRenderer=PlotKit.SweetSVGRenderer; -PlotKit.SweetSVG.EXPORT=["SweetSVGRenderer"]; -PlotKit.SweetSVG.EXPORT_OK=["SweetSVGRenderer"]; -PlotKit.SweetSVG.__new__=function(){ -var m=MochiKit.Base; -m.nameFunctions(this); -this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; -}; -PlotKit.SweetSVG.__new__(); -MochiKit.Base._exportSymbols(this,PlotKit.SweetSVG); -try{ -if(typeof (PlotKit.CanvasRenderer)=="undefined"){ -throw ""; -} -} -catch(e){ -throw "PlotKit.EasyPlot depends on all of PlotKit's components"; -} -if(typeof (PlotKit.EasyPlot)=="undefined"){ -PlotKit.EasyPlot={}; -} -PlotKit.EasyPlot.NAME="PlotKit.EasyPlot"; -PlotKit.EasyPlot.VERSION=PlotKit.VERSION; -PlotKit.EasyPlot.__repr__=function(){ -return "["+this.NAME+" "+this.VERSION+"]"; -}; -PlotKit.EasyPlot.toString=function(){ -return this.__repr__(); -}; -PlotKit.EasyPlot=function(_404,_405,_406,_407){ -this.layout=new Layout(_404,_405); -this.divElem=_406; -this.width=parseInt(_406.getAttribute("width")); -this.height=parseInt(_406.getAttribute("height")); -this.deferredCount=0; -if(this.width<1){ -this.width=this.divElem.width?this.divElem.width:300; -} -if(this.height<1){ -this.height=this.divElem.height?this.divElem.height:300; -} -if(isArrayLike(_407)){ -for(var i=0;i<_407.length;i++){ -if(typeof (_407[i])=="string"){ -this.deferredCount++; -var d=MochiKit.Async.doSimpleXMLHttpRequest(_407[i]); -d.addCallback(MochiKit.Base.bind(PlotKit.EasyPlot.onDataLoaded,this)); -}else{ -if(isArrayLike(_407[i])){ -this.layout.addDataset("data-"+i,_407[i]); -} -} -} -}else{ -if(!isUndefinedOrNull(_407)){ -throw "Passed datasources are not Array like"; -} -} -if(CanvasRenderer.isSupported()){ -this.element=CANVAS({"id":this.divElem.getAttribute("id")+"-canvas","width":this.width,"height":this.height},""); -this.divElem.appendChild(this.element); -this.renderer=new SweetCanvasRenderer(this.element,this.layout,_405); -}else{ -if(SVGRenderer.isSupported()){ -this.element=SVGRenderer.SVG({"id":this.divElem.getAttribute("id")+"-svg","width":this.width,"height":this.height,"version":"1.1","baseProfile":"full"},""); -this.divElem.appendChild(this.element); -this.renderer=new SweetSVGRenderer(this.element,this.layout,_405); -} -} -if((this.deferredCount==0)&&(PlotKit.Base.keys(this.layout.datasets).length>0)){ -this.layout.evaluate(); -this.renderer.clear(); -this.renderer.render(); -} -}; -PlotKit.EasyPlot.onDataLoaded=function(_409){ -var _410=new Array(); -var _411=_409.responseText.split("\n"); -for(var i=0;i<_411.length;i++){ -var _412=MochiKit.Format.strip(_411[i]); -if((_412.length>1)&&(_412.charAt(0)!="#")){ -_410.push(_412.split(",")); -} -} -this.layout.addDataset("data-ajax-"+this.deferredCount,_410); -this.deferredCount--; -if((this.deferredCount==0)&&(PlotKit.Base.keys(this.layout.datasets).length>0)){ -this.layout.evaluate(); -this.renderer.clear(); -this.renderer.render(); -} -}; -PlotKit.EasyPlot.prototype.reload=function(){ -this.layout.evaluate(); -this.renderer.clear(); -this.renderer.render(); -}; -PlotKit.EasyPlotModule={}; -PlotKit.EasyPlotModule.EasyPlot=PlotKit.EasyPlot; -PlotKit.EasyPlotModule.EXPORT=["EasyPlot"]; -PlotKit.EasyPlotModule.EXPORT_OK=[]; -PlotKit.EasyPlotModule.__new__=function(){ -var m=MochiKit.Base; -m.nameFunctions(this); -this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; -}; -PlotKit.EasyPlotModule.__new__(); -MochiKit.Base._exportSymbols(this,PlotKit.EasyPlotModule); - - diff --git a/plotkit_v091/PlotKit/SVG.js b/plotkit_v091/PlotKit/SVG.js deleted file mode 100644 index 3687bc0..0000000 --- a/plotkit_v091/PlotKit/SVG.js +++ /dev/null @@ -1,705 +0,0 @@ -/* - PlotKit SVG - =========== - SVG Renderer for PlotKit - - Copyright - --------- - Copyright 2005,2006 (c) Alastair Tse - For use under the BSD license. -*/ - -// ------------------------------------------------------------------------- -// NOTES: - If you use XHTML1.1 strict, then you must include each MochiKit -// file individuall. -// - For IE support, you must include the AdobeSVG object hack. -// See tests/svg.html for details. -// ------------------------------------------------------------------------- -// ------------------------------------------------------------------------- -// Check required components -// ------------------------------------------------------------------------- - -try { - if (typeof(PlotKit.Layout) == 'undefined') - { - throw ""; - } -} -catch (e) { - throw "PlotKit depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.Layout" -} - - -// --------------------------------------------------------------------------- -// SVG Renderer -// --------------------------------------------------------------------------- - -PlotKit.SVGRenderer = function(element, layout, options) { - if (arguments.length > 0) - this.__init__(element, layout, options); -}; - -PlotKit.SVGRenderer.NAME = "PlotKit.SVGRenderer"; -PlotKit.SVGRenderer.VERSION = PlotKit.VERSION; - -PlotKit.SVGRenderer.__repr__ = function() { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.SVGRenderer.toString = function() { - return this.__repr__(); -} - -PlotKit.SVGRenderer.SVGNS = 'http://www.w3.org/2000/svg'; - -PlotKit.SVGRenderer.prototype.__init__ = function(element, layout, options) { - var isNil = MochiKit.Base.isUndefinedOrNull; - - // default options - this.options = { - "drawBackground": true, - "backgroundColor": Color.whiteColor(), - "padding": {left: 30, right: 30, top: 5, bottom: 10}, - "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[1]), - "strokeColor": Color.whiteColor(), - "strokeColorTransform": "asStrokeColor", - "strokeWidth": 0.5, - "shouldFill": true, - "shouldStroke": true, - "drawXAxis": true, - "drawYAxis": true, - "axisLineColor": Color.blackColor(), - "axisLineWidth": 0.5, - "axisTickSize": 3, - "axisLabelColor": Color.blackColor(), - "axisLabelFont": "Arial", - "axisLabelFontSize": 9, - "axisLabelWidth": 50, - "axisLabelUseDiv": true, - "pieRadius": 0.4, - "enableEvents": true - }; - - MochiKit.Base.update(this.options, options ? options : {}); - this.layout = layout; - this.element = MochiKit.DOM.getElement(element); - this.container = this.element.parentNode; - this.height = parseInt(this.element.getAttribute("height")); - this.width = parseInt(this.element.getAttribute("width")); - this.document = document; - this.root = this.element; - - // Adobe SVG Support: - // - if an exception is thrown, then no Adobe SVG Plugin support. - try { - this.document = this.element.getSVGDocument(); - this.root = isNil(this.document.documentElement) ? this.element : this.document.documentElement; - } - catch (e) { - } - - this.element.style.zIndex = 1; - - if (isNil(this.element)) - throw "SVGRenderer() - passed SVG object is not found"; - - if (isNil(this.container) || this.container.nodeName.toLowerCase() != "div") - throw "SVGRenderer() - No DIV's around the SVG."; - - // internal state - this.xlabels = new Array(); - this.ylabels = new Array(); - - // initialise some meta structures in SVG - this.defs = this.createSVGElement("defs"); - - this.area = { - x: this.options.padding.left, - y: this.options.padding.top, - w: this.width - this.options.padding.left - this.options.padding.right, - h: this.height - this.options.padding.top - this.options.padding.bottom - }; - - MochiKit.DOM.updateNodeAttributes(this.container, - {"style":{ "position": "relative", "width": this.width + "px"}}); - - -}; - - -PlotKit.SVGRenderer.prototype.render = function() { - if (this.options.drawBackground) - this._renderBackground(); - - if (this.layout.style == "bar") { - this._renderBarChart(); - this._renderBarAxis(); - } - else if (this.layout.style == "pie") { - this._renderPieChart(); - this._renderPieAxis(); - } - else if (this.layout.style == "line") { - this._renderLineChart(); - this._renderLineAxis(); - } -}; - -PlotKit.SVGRenderer.prototype._renderBarOrLine = function(data, plotFunc, startFunc, endFunc) { - - var colorCount = this.options.colorScheme.length; - var colorScheme = this.options.colorScheme; - var setNames = MochiKit.Base.keys(this.layout.datasets); - var setCount = setNames.length; - - for (var i = 0; i < setCount; i++) { - var setName = setNames[i]; - var attrs = new Array(); - var color = colorScheme[i%colorCount]; - - if (this.options.shouldFill) - attrs["fill"] = color.toRGBString(); - else - attrs["fill"] = "none"; - - if (this.options.shouldStroke && - (this.options.strokeColor || this.options.strokeColorTransform)) { - if (this.options.strokeColor) - attrs["stroke"] = this.options.strokeColor.toRGBString(); - else if (this.options.strokeColorTransform) - attrs["stroke"] = color[this.options.strokeColorTransform]().toRGBString(); - attrs["strokeWidth"] = this.options.strokeWidth; - } - - if (startFunc) - startFunc(attrs); - - var forEachFunc = function(obj) { - if (obj.name == setName) - plotFunc(attrs, obj); - }; - - MochiKit.Iter.forEach(data, bind(forEachFunc, this)); - if (endFunc) - endFunc(attrs); - } -}; - -PlotKit.SVGRenderer.prototype._renderBarChart = function() { - var bind = MochiKit.Base.bind; - - var drawRect = function(attrs, bar) { - var x = this.area.w * bar.x + this.area.x; - var y = this.area.h * bar.y + this.area.y; - var w = this.area.w * bar.w; - var h = this.area.h * bar.h; - this._drawRect(x, y, w, h, attrs); - }; - this._renderBarOrLine(this.layout.bars, bind(drawRect, this)); -}; - -PlotKit.SVGRenderer.prototype._renderLineChart = function() { - var bind = MochiKit.Base.bind; - - var addPoint = function(attrs, point) { - this._tempPointsBuffer += (this.area.w * point.x + this.area.x) + "," + - (this.area.h * point.y + this.area.y) + " "; - }; - - var startLine = function(attrs) { - this._tempPointsBuffer = ""; - this._tempPointsBuffer += (this.area.x) + "," + (this.area.y+this.area.h) + " "; - }; - - var endLine = function(attrs) { - this._tempPointsBuffer += (this.area.w + this.area.x) + "," +(this.area.h + this.area.y); - attrs["points"] = this._tempPointsBuffer; - var elem = this.createSVGElement("polygon", attrs); - this.root.appendChild(elem); - }; - - this._renderBarOrLine(this.layout.points, - bind(addPoint, this), - bind(startLine, this), - bind(endLine, this)); -}; - - -PlotKit.SVGRenderer.prototype._renderPieChart = function() { - var colorCount = this.options.colorScheme.length; - var slices = this.layout.slices; - - var centerx = this.area.x + this.area.w * 0.5; - var centery = this.area.y + this.area.h * 0.5; - var radius = Math.min(this.area.w * this.options.pieRadius, - this.area.h * this.options.pieRadius); - - // NOTE NOTE!! Canvas Tag draws the circle clockwise from the y = 0, x = 1 - // so we have to subtract 90 degrees to make it start at y = 1, x = 0 - - // workaround if we only have 1 slice of 100% - if (slices.length == 1 && (Math.abs(slices[0].startAngle) - Math.abs(slices[0].endAngle) < 0.1)) { - var attrs = {"cx": centerx , "cy": centery , "r": radius }; - var color = this.options.colorScheme[0]; - if (this.options.shouldFill) - attrs["fill"] = color.toRGBString(); - else - attrs["fill"] = "none"; - - if (this.options.shouldStroke && - (this.options.strokeColor || this.options.strokeColorTransform)) { - if (this.options.strokeColor) - attrs["stroke"] = this.options.strokeColor.toRGBString(); - else if (this.options.strokeColorTransform) - attrs["stroke"] = color[this.options.strokeColorTransform]().toRGBString(); - attrs["style"] = "stroke-width: " + this.options.strokeWidth; - } - - this.root.appendChild(this.createSVGElement("circle", attrs)); - return; - } - - for (var i = 0; i < slices.length; i++) { - var attrs = new Array(); - var color = this.options.colorScheme[i%colorCount]; - if (this.options.shouldFill) - attrs["fill"] = color.toRGBString(); - else - attrs["fill"] = "none"; - - if (this.options.shouldStroke && - (this.options.strokeColor || this.options.strokeColorTransform)) { - if (this.options.strokeColor) - attrs["stroke"] = this.options.strokeColor.toRGBString(); - else if (this.options.strokeColorTransform) - attrs["stroke"] = color[this.options.strokeColorTransform]().toRGBString(); - attrs["style"] = "stroke-width:" + this.options.strokeWidth; - } - - var largearc = 0; - if (Math.abs(slices[i].endAngle - slices[i].startAngle) > Math.PI) - largearc = 1; - var x1 = Math.cos(slices[i].startAngle - Math.PI/2) * radius; - var y1 = Math.sin(slices[i].startAngle - Math.PI/2) * radius; - var x2 = Math.cos(slices[i].endAngle - Math.PI/2) * radius; - var y2 = Math.sin(slices[i].endAngle - Math.PI/2) * radius; - var rx = x2 - x1; - var ry = y2 - y1; - - var pathString = "M" + centerx + "," + centery + " "; - pathString += "l" + x1 + "," + y1 + " "; - pathString += "a" + radius + "," + radius + " 0 " + largearc + ",1 " + rx + "," + ry + " z"; - - attrs["d"] = pathString; - - var elem = this.createSVGElement("path", attrs); - this.root.appendChild(elem); - } -}; - -PlotKit.SVGRenderer.prototype._renderBarAxis = function() { - this._renderAxis(); -} - -PlotKit.SVGRenderer.prototype._renderLineAxis = function() { - this._renderAxis(); -}; - - -PlotKit.SVGRenderer.prototype._renderAxis = function() { - - if (!this.options.drawXAxis && !this.options.drawYAxis) - return; - - var labelStyle = {"style": - {"position": "absolute", - "textAlign": "center", - "fontSize": this.options.axisLabelFontSize + "px", - "zIndex": 10, - "color": this.options.axisLabelColor.toRGBString(), - "width": this.options.axisLabelWidth + "px", - "overflow": "hidden" - } - }; - - // axis lines - var lineAttrs = { - "stroke": this.options.axisLineColor.toRGBString(), - "strokeWidth": this.options.axisLineWidth - }; - - - if (this.options.drawYAxis) { - if (this.layout.yticks) { - var drawTick = function(tick) { - var x = this.area.x; - var y = this.area.y + tick[0] * this.area.h; - this._drawLine(x, y, x - 3, y, lineAttrs); - - if (this.options.axisLabelUseDiv) { - var label = DIV(labelStyle, tick[1]); - label.style.top = (y - this.options.axisLabelFontSize) + "px"; - label.style.left = (x - this.options.padding.left + this.options.axisTickSize) + "px"; - label.style.textAlign = "left"; - label.style.width = (this.options.padding.left - 3) + "px"; - MochiKit.DOM.appendChildNodes(this.container, label); - this.ylabels.push(label); - } - else { - var attrs = { - y: y + 3, - x: (x - this.options.padding.left + 3), - width: (this.options.padding.left - this.options.axisTickSize) + "px", - height: (this.options.axisLabelFontSize + 3) + "px", - fontFamily: "Arial", - fontSize: this.options.axisLabelFontSize + "px", - fill: this.options.axisLabelColor.toRGBString() - }; - - /* we can do clipping just like DIVs - http://www.xml.com/pub/a/2004/06/02/svgtype.html */ - /* - var mask = this.createSVGElement("mask", {id: "mask" + tick[0]}); - var maskShape = this.createSVGElement("rect", - {y: y + 3, - x: (x - this.options.padding.left + 3), - width: (this.options.padding.left - this.options.axisTickSize) + "px", - height: (this.options.axisLabelFontSize + 3) + "px", - style: {"fill": "#ffffff", "stroke": "#000000"}}); - mask.appendChild(maskShape); - this.defs.appendChild(mask); - - attrs["filter"] = "url(#mask" + tick[0] + ")"; - */ - - var label = this.createSVGElement("text", attrs); - label.appendChild(this.document.createTextNode(tick[1])); - this.root.appendChild(label); - } - }; - - MochiKit.Iter.forEach(this.layout.yticks, bind(drawTick, this)); - } - - this._drawLine(this.area.x, this.area.y, this.area.x, this.area.y + this.area.h, lineAttrs); - } - - if (this.options.drawXAxis) { - if (this.layout.xticks) { - var drawTick = function(tick) { - var x = this.area.x + tick[0] * this.area.w; - var y = this.area.y + this.area.h; - this._drawLine(x, y, x, y + this.options.axisTickSize, lineAttrs); - - if (this.options.axisLabelUseDiv) { - var label = DIV(labelStyle, tick[1]); - label.style.top = (y + this.options.axisTickSize) + "px"; - label.style.left = (x - this.options.axisLabelWidth/2) + "px"; - label.style.textAlign = "center"; - label.style.width = this.options.axisLabelWidth + "px"; - MochiKit.DOM.appendChildNodes(this.container, label); - this.xlabels.push(label); - } - else { - var attrs = { - y: (y + this.options.axisTickSize + this.options.axisLabelFontSize), - x: x - 3, - width: this.options.axisLabelWidth + "px", - height: (this.options.axisLabelFontSize + 3) + "px", - fontFamily: "Arial", - fontSize: this.options.axisLabelFontSize + "px", - fill: this.options.axisLabelColor.toRGBString(), - textAnchor: "middle" - }; - var label = this.createSVGElement("text", attrs); - label.appendChild(this.document.createTextNode(tick[1])); - this.root.appendChild(label); - } - }; - - MochiKit.Iter.forEach(this.layout.xticks, bind(drawTick, this)); - } - - this._drawLine(this.area.x, this.area.y + this.area.h, this.area.x + this.area.w, this.area.y + this.area.h, lineAttrs) - } -}; - -PlotKit.SVGRenderer.prototype._renderPieAxis = function() { - - if (this.layout.xticks) { - // make a lookup dict for x->slice values - var lookup = new Array(); - for (var i = 0; i < this.layout.slices.length; i++) { - lookup[this.layout.slices[i].xval] = this.layout.slices[i]; - } - - var centerx = this.area.x + this.area.w * 0.5; - var centery = this.area.y + this.area.h * 0.5; - var radius = Math.min(this.area.w * this.options.pieRadius + 10, - this.area.h * this.options.pieRadius + 10); - var labelWidth = this.options.axisLabelWidth; - - for (var i = 0; i < this.layout.xticks.length; i++) { - var slice = lookup[this.layout.xticks[i][0]]; - if (MochiKit.Base.isUndefinedOrNull(slice)) - continue; - - - var angle = (slice.startAngle + slice.endAngle)/2; - // normalize the angle - var normalisedAngle = angle; - if (normalisedAngle > Math.PI * 2) - normalisedAngle = normalisedAngle - Math.PI * 2; - else if (normalisedAngle < 0) - normalisedAngle = normalisedAngle + Math.PI * 2; - - var labelx = centerx + Math.sin(normalisedAngle) * (radius + 10); - var labely = centery - Math.cos(normalisedAngle) * (radius + 10); - - var attrib = { - "position": "absolute", - "zIndex": 11, - "width": labelWidth + "px", - "fontSize": this.options.axisLabelFontSize + "px", - "overflow": "hidden", - "color": this.options.axisLabelColor.toHexString() - }; - - var svgattrib = { - "width": labelWidth + "px", - "fontSize": this.options.axisLabelFontSize + "px", - "height": (this.options.axisLabelFontSize + 3) + "px", - "fill": this.options.axisLabelColor.toRGBString() - }; - - if (normalisedAngle <= Math.PI * 0.5) { - // text on top and align left - MochiKit.Base.update(attrib, { - 'textAlign': 'left', 'verticalAlign': 'top', - 'left': labelx + 'px', - 'top': (labely - this.options.axisLabelFontSize) + "px" - }); - MochiKit.Base.update(svgattrib, { - "x": labelx, - "y" :(labely - this.options.axisLabelFontSize), - "textAnchor": "left" - }); - } - else if ((normalisedAngle > Math.PI * 0.5) && (normalisedAngle <= Math.PI)) { - // text on bottom and align left - MochiKit.Base.update(attrib, { - 'textAlign': 'left', 'verticalAlign': 'bottom', - 'left': labelx + 'px', - 'top': labely + "px" - }); - MochiKit.Base.update(svgattrib, { - 'textAnchor': 'left', - 'x': labelx, - 'y': labely - }); - } - else if ((normalisedAngle > Math.PI) && (normalisedAngle <= Math.PI*1.5)) { - // text on bottom and align right - MochiKit.Base.update(attrib, { - 'textAlign': 'right', 'verticalAlign': 'bottom', - 'left': labelx + 'px', - 'top': labely + "px" - }); - MochiKit.Base.update(svgattrib, { - 'textAnchor': 'right', - 'x': labelx - labelWidth, - 'y': labely - }); - } - else { - // text on top and align right - MochiKit.Base.update(attrib, { - 'textAlign': 'left', 'verticalAlign': 'bottom', - 'left': labelx + 'px', - 'top': labely + "px" - }); - MochiKit.Base.update(svgattrib, { - 'textAnchor': 'left', - 'x': labelx - labelWidth, - 'y': labely - this.options.axisLabelFontSize - }); - } - - if (this.options.axisLabelUseDiv) { - var label = DIV({'style': attrib}, this.layout.xticks[i][1]); - this.xlabels.push(label); - MochiKit.DOM.appendChildNodes(this.container, label); - } - else { - var label = this.createSVGElement("text", svgattrib); - label.appendChild(this.document.createTextNode(this.layout.xticks[i][1])) - this.root.appendChild(label); - } - } - - } -}; - -PlotKit.SVGRenderer.prototype._renderBackground = function() { - var opts = {"stroke": "none", - "fill": this.options.backgroundColor.toRGBString() - }; - this._drawRect(0, 0, this.width, this.height, opts); -}; - -PlotKit.SVGRenderer.prototype._drawRect = function(x, y, w, h, moreattrs) { - var attrs = {x: x + "px", y: y + "px", width: w + "px", height: h + "px"}; - if (moreattrs) - MochiKit.Base.update(attrs, moreattrs); - - var elem = this.createSVGElement("rect", attrs); - this.root.appendChild(elem); -}; - -PlotKit.SVGRenderer.prototype._drawLine = function(x1, y1, x2, y2, moreattrs) { - var attrs = {x1: x1 + "px", y1: y1 + "px", x2: x2 + "px", y2: y2 + "px"}; - if (moreattrs) - MochiKit.Base.update(attrs, moreattrs); - - var elem = this.createSVGElement("line", attrs); - this.root.appendChild(elem); -} - -PlotKit.SVGRenderer.prototype.clear = function() { - while(this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - } - - if (this.options.axisLabelUseDiv) { - for (var i = 0; i < this.xlabels.length; i++) { - MochiKit.DOM.removeElement(this.xlabels[i]); - } - for (var i = 0; i < this.ylabels.length; i++) { - MochiKit.DOM.removeElement(this.ylabels[i]); - } - } - this.xlabels = new Array(); - this.ylabels = new Array(); -}; - - -PlotKit.SVGRenderer.prototype.createSVGElement = function(name, attrs) { - var isNil = MochiKit.Base.isUndefinedOrNull; - var elem; - var doc = isNil(this.document) ? document : this.document; - - try { - elem = doc.createElementNS(PlotKit.SVGRenderer.SVGNS, name); - } - catch (e) { - elem = doc.createElement(name); - elem.setAttribute("xmlns", PlotKit.SVGRenderer.SVGNS); - } - - if (attrs) - MochiKit.DOM.updateNodeAttributes(elem, attrs); - - // TODO: we don't completely emulate the MochiKit.DOM.createElement - // as we don't care about nodes contained. We really should though. - - return elem; - -}; - - -PlotKit.SVGRenderer.SVG = function(attrs) { - // we have to do things differently for IE+AdobeSVG. - // My guess this works (via trial and error) is that we need to - // have an SVG object in order to use SVGDocument.createElementNS - // but IE doesn't allow us to that. - - var ie = navigator.appVersion.match(/MSIE (\d\.\d)/); - var opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1); - if (ie && (ie[1] >= 6) && (!opera)) { - var width = attrs["width"] ? attrs["width"] : "100"; - var height = attrs["height"] ? attrs["height"] : "100"; - var eid = attrs["id"] ? attrs["id"] : "notunique"; - - var html = ''; - - var canvas = document.createElement(html); - - // create embedded SVG inside SVG. - var group = canvas.getSVGDocument().createElementNS(PlotKit.SVGRenderer.SVGNS, "svg"); - group.setAttribute("width", width); - group.setAttribute("height", height); - canvas.getSVGDocument().appendChild(group); - - return canvas; - } - else { - return PlotKit.SVGRenderer.prototype.createSVGElement("svg", attrs); - } -}; - -PlotKit.SVGRenderer.isSupported = function() { - var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1); - var ieVersion = navigator.appVersion.match(/MSIE (\d\.\d)/); - var safariVersion = navigator.userAgent.match(/AppleWebKit\/(\d+)/); - var operaVersion = navigator.userAgent.match(/Opera\/(\d*\.\d*)/); - var mozillaVersion = navigator.userAgent.match(/rv:(\d*\.\d*).*Gecko/); - var svgFeature = "http://www.w3.org/TR/SVG11/feature#SVG"; - - if (ieVersion && (ieVersion[1] >= 6) && !isOpera) { - return document.implementation.hasFeature(svgFeature,"1.1"); - /* - var dummysvg = document.createElement(''); - try { - dummysvg.getSVGDocument(); - dummysvg = null; - return true; - } - catch (e) { - return false; - } - */ - - } - - /* support not really there yet. no text and paths are buggy - if (safariVersion && (safariVersion[1] > 419)) - return true; - */ - - if (operaVersion && (operaVersion[1] > 8.9)) - return true - - if (mozillaVersion && (mozillaVersion > 1.7)) - return true; - - return false; -}; - -// Namespace Iniitialisation - -PlotKit.SVG = {} -PlotKit.SVG.SVGRenderer = PlotKit.SVGRenderer; - -PlotKit.SVG.EXPORT = [ - "SVGRenderer" -]; - -PlotKit.SVG.EXPORT_OK = [ - "SVGRenderer" -]; - -PlotKit.SVG.__new__ = function() { - var m = MochiKit.Base; - - m.nameFunctions(this); - - this.EXPORT_TAGS = { - ":common": this.EXPORT, - ":all": m.concat(this.EXPORT, this.EXPORT_OK) - }; -}; - -PlotKit.SVG.__new__(); -MochiKit.Base._exportSymbols(this, PlotKit.SVG); - diff --git a/plotkit_v091/PlotKit/SweetCanvas.js b/plotkit_v091/PlotKit/SweetCanvas.js deleted file mode 100644 index bb6fe5c..0000000 --- a/plotkit_v091/PlotKit/SweetCanvas.js +++ /dev/null @@ -1,348 +0,0 @@ -/* - PlotKit Sweet Canvas Renderer - ============================= - Canvas Renderer for PlotKit which looks pretty! - - Copyright - --------- - Copyright 2005,2006 (c) Alastair Tse - For use under the BSD license. -*/ - -// ------------------------------------------------------------------------- -// Check required components -// ------------------------------------------------------------------------- - -try { - if (typeof(PlotKit.CanvasRenderer) == 'undefined') - { - throw ""; - } -} -catch (e) { - throw "SweetCanvas depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, Canvas}" -} - - -if (typeof(PlotKit.SweetCanvasRenderer) == 'undefined') { - PlotKit.SweetCanvasRenderer = {}; -} - -PlotKit.SweetCanvasRenderer = function(element, layout, options) { - if (arguments.length > 0) { - this.__init__(element, layout, options); - } -}; - -PlotKit.SweetCanvasRenderer.NAME = "PlotKit.SweetCanvasRenderer"; -PlotKit.SweetCanvasRenderer.VERSION = PlotKit.VERSION; - -PlotKit.SweetCanvasRenderer.__repr__ = function() { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.SweetCanvasRenderer.toString = function() { - return this.__repr__(); -}; - -// --------------------------------------------------------------------- -// Subclassing Magic -// --------------------------------------------------------------------- - -PlotKit.SweetCanvasRenderer.prototype = new PlotKit.CanvasRenderer(); -PlotKit.SweetCanvasRenderer.prototype.constructor = PlotKit.SweetCanvasRenderer; -PlotKit.SweetCanvasRenderer.__super__ = PlotKit.CanvasRenderer.prototype; - -// --------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------- - -PlotKit.SweetCanvasRenderer.prototype.__init__ = function(el, layout, opts) { - var moreOpts = PlotKit.Base.officeBlue(); - MochiKit.Base.update(moreOpts, opts); - PlotKit.SweetCanvasRenderer.__super__.__init__.call(this, el, layout, moreOpts); -}; - -// --------------------------------------------------------------------- -// Extended Plotting Functions -// --------------------------------------------------------------------- - -PlotKit.SweetCanvasRenderer.prototype._renderBarChart = function() { - var bind = MochiKit.Base.bind; - var shadowColor = Color.blackColor().colorWithAlpha(0.1).toRGBString(); - - var prepareFakeShadow = function(context, x, y, w, h) { - context.fillStyle = shadowColor; - context.fillRect(x-2, y-2, w+4, h+2); - context.fillStyle = shadowColor; - context.fillRect(x-1, y-1, w+2, h+1); - }; - - var colorCount = this.options.colorScheme.length; - var colorScheme = this.options.colorScheme; - var setNames = PlotKit.Base.keys(this.layout.datasets); - var setCount = setNames.length; - - var chooseColor = function(name) { - for (var i = 0; i < setCount; i++) { - if (name == setNames[i]) - return colorScheme[i%colorCount]; - } - return colorScheme[0]; - }; - - var drawRect = function(context, bar) { - var x = this.area.w * bar.x + this.area.x; - var y = this.area.h * bar.y + this.area.y; - var w = this.area.w * bar.w; - var h = this.area.h * bar.h; - - if ((w < 1) || (h < 1)) - return; - - context.save(); - - context.shadowBlur = 5.0; - context.shadowColor = Color.fromHexString("#888888").toRGBString(); - - if (this.isIE) { - context.save(); - context.fillStyle = "#cccccc"; - context.fillRect(x-2, y-2, w+4, h+2); - context.restore(); - } - else { - prepareFakeShadow(context, x, y, w, h); - } - - if (this.options.shouldFill) { - context.fillStyle = chooseColor(bar.name).toRGBString(); - context.fillRect(x, y, w, h); - } - - context.shadowBlur = 0; - context.strokeStyle = Color.whiteColor().toRGBString(); - context.lineWidth = 2.0; - - if (this.options.shouldStroke) { - context.strokeRect(x, y, w, h); - } - - context.restore(); - - }; - this._renderBarChartWrap(this.layout.bars, bind(drawRect, this)); -}; - -PlotKit.SweetCanvasRenderer.prototype._renderLineChart = function() { - var context = this.element.getContext("2d"); - var colorCount = this.options.colorScheme.length; - var colorScheme = this.options.colorScheme; - var setNames = PlotKit.Base.keys(this.layout.datasets); - var setCount = setNames.length; - var bind = MochiKit.Base.bind; - - - for (var i = 0; i < setCount; i++) { - var setName = setNames[i]; - var color = colorScheme[i%colorCount]; - var strokeX = this.options.strokeColorTransform; - - // setup graphics context - context.save(); - - // create paths - var makePath = function(ctx) { - ctx.beginPath(); - ctx.moveTo(this.area.x, this.area.y + this.area.h); - var addPoint = function(ctx_, point) { - if (point.name == setName) - ctx_.lineTo(this.area.w * point.x + this.area.x, - this.area.h * point.y + this.area.y); - }; - MochiKit.Iter.forEach(this.layout.points, partial(addPoint, ctx), this); - ctx.lineTo(this.area.w + this.area.x, - this.area.h + this.area.y); - ctx.lineTo(this.area.x, this.area.y + this.area.h); - ctx.closePath(); - }; - - // faux shadow for firefox - if (this.options.shouldFill) { - context.save(); - if (this.isIE) { - context.fillStyle = "#cccccc"; - } - else { - context.fillStyle = Color.blackColor().colorWithAlpha(0.2).toRGBString(); - } - context.translate(-1, -2); - bind(makePath, this)(context); - if (this.options.shouldFill) { - context.fill(); - } - context.restore(); - } - - context.shadowBlur = 5.0; - context.shadowColor = Color.fromHexString("#888888").toRGBString(); - context.fillStyle = color.toRGBString(); - context.lineWidth = 2.0; - context.strokeStyle = Color.whiteColor().toRGBString(); - - if (this.options.shouldFill) { - bind(makePath, this)(context); - context.fill(); - } - if (this.options.shouldStroke) { - bind(makePath, this)(context); - context.stroke(); - } - context.restore(); - } -}; - -PlotKit.SweetCanvasRenderer.prototype._renderPieChart = function() { - var context = this.element.getContext("2d"); - - var colorCount = this.options.colorScheme.length; - var slices = this.layout.slices; - - var centerx = this.area.x + this.area.w * 0.5; - var centery = this.area.y + this.area.h * 0.5; - var radius = Math.min(this.area.w * this.options.pieRadius, - this.area.h * this.options.pieRadius); - - if (this.isIE) { - centerx = parseInt(centerx); - centery = parseInt(centery); - radius = parseInt(radius); - } - - // NOTE NOTE!! Canvas Tag draws the circle clockwise from the y = 0, x = 1 - // so we have to subtract 90 degrees to make it start at y = 1, x = 0 - - if (!this.isIE) { - context.save(); - var shadowColor = Color.blackColor().colorWithAlpha(0.2); - context.fillStyle = shadowColor.toRGBString(); - context.shadowBlur = 5.0; - context.shadowColor = Color.fromHexString("#888888").toRGBString(); - context.translate(1, 1); - context.beginPath(); - context.moveTo(centerx, centery); - context.arc(centerx, centery, radius + 2, 0, Math.PI*2, false); - context.closePath(); - context.fill(); - context.restore(); - } - - context.save(); - context.strokeStyle = Color.whiteColor().toRGBString(); - context.lineWidth = 2.0; - for (var i = 0; i < slices.length; i++) { - var color = this.options.colorScheme[i%colorCount]; - context.fillStyle = color.toRGBString(); - - var makePath = function() { - context.beginPath(); - context.moveTo(centerx, centery); - context.arc(centerx, centery, radius, - slices[i].startAngle - Math.PI/2, - slices[i].endAngle - Math.PI/2, - false); - context.lineTo(centerx, centery); - context.closePath(); - }; - - if (Math.abs(slices[i].startAngle - slices[i].endAngle) > 0.0001) { - if (this.options.shouldFill) { - makePath(); - context.fill(); - } - if (this.options.shouldStroke) { - makePath(); - context.stroke(); - } - } - } - context.restore(); -}; - -PlotKit.SweetCanvasRenderer.prototype._renderBackground = function() { - var context = this.element.getContext("2d"); - - if (this.layout.style == "bar" || this.layout.style == "line") { - context.save(); - context.fillStyle = this.options.backgroundColor.toRGBString(); - context.fillRect(this.area.x, this.area.y, this.area.w, this.area.h); - context.strokeStyle = this.options.axisLineColor.toRGBString(); - context.lineWidth = 1.0; - - var ticks = this.layout.yticks; - var horiz = false; - if (this.layout.style == "bar" && - this.layout.options.barOrientation == "horizontal") { - ticks = this.layout.xticks; - horiz = true; - } - - for (var i = 0; i < ticks.length; i++) { - var x1 = 0; - var y1 = 0; - var x2 = 0; - var y2 = 0; - - if (horiz) { - x1 = ticks[i][0] * this.area.w + this.area.x; - y1 = this.area.y; - x2 = x1; - y2 = y1 + this.area.h; - } - else { - x1 = this.area.x; - y1 = ticks[i][0] * this.area.h + this.area.y; - x2 = x1 + this.area.w; - y2 = y1; - } - - context.beginPath(); - context.moveTo(x1, y1); - context.lineTo(x2, y2); - context.closePath(); - context.stroke(); - } - context.restore(); - } - else { - PlotKit.SweetCanvasRenderer.__super__._renderBackground.call(this); - } -}; - -// Namespace Iniitialisation - -PlotKit.SweetCanvas = {} -PlotKit.SweetCanvas.SweetCanvasRenderer = PlotKit.SweetCanvasRenderer; - -PlotKit.SweetCanvas.EXPORT = [ - "SweetCanvasRenderer" -]; - -PlotKit.SweetCanvas.EXPORT_OK = [ - "SweetCanvasRenderer" -]; - -PlotKit.SweetCanvas.__new__ = function() { - var m = MochiKit.Base; - - m.nameFunctions(this); - - this.EXPORT_TAGS = { - ":common": this.EXPORT, - ":all": m.concat(this.EXPORT, this.EXPORT_OK) - }; -}; - -PlotKit.SweetCanvas.__new__(); -MochiKit.Base._exportSymbols(this, PlotKit.SweetCanvas); - diff --git a/plotkit_v091/PlotKit/SweetSVG.js b/plotkit_v091/PlotKit/SweetSVG.js deleted file mode 100644 index 4183058..0000000 --- a/plotkit_v091/PlotKit/SweetSVG.js +++ /dev/null @@ -1,247 +0,0 @@ -/* - PlotKit Sweet SVG Renderer - ========================== - SVG Renderer for PlotKit which looks pretty! - - Copyright - --------- - Copyright 2005,2006 (c) Alastair Tse - For use under the BSD license. -*/ - - -// ------------------------------------------------------------------------- -// Check required components -// ------------------------------------------------------------------------- - -try { - if (typeof(PlotKit.SVGRenderer) == 'undefined') - { - throw ""; - } -} -catch (e) { - throw "SweetSVG depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, SVG}" -} - - -if (typeof(PlotKit.SweetSVGRenderer) == 'undefined') { - PlotKit.SweetSVGRenderer = {}; -} - -PlotKit.SweetSVGRenderer = function(element, layout, options) { - if (arguments.length > 0) { - this.__init__(element, layout, options); - } -}; - -PlotKit.SweetSVGRenderer.NAME = "PlotKit.SweetSVGRenderer"; -PlotKit.SweetSVGRenderer.VERSION = PlotKit.VERSION; - -PlotKit.SweetSVGRenderer.__repr__ = function() { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.SweetSVGRenderer.toString = function() { - return this.__repr__(); -}; - -// --------------------------------------------------------------------- -// Subclassing Magic -// --------------------------------------------------------------------- - -PlotKit.SweetSVGRenderer.prototype = new PlotKit.SVGRenderer(); -PlotKit.SweetSVGRenderer.prototype.constructor = PlotKit.SweetSVGRenderer; -PlotKit.SweetSVGRenderer.__super__ = PlotKit.SVGRenderer.prototype; - -// --------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------- - -PlotKit.SweetSVGRenderer.prototype.__init__ = function(element, layout, options) { - var moreOpts = PlotKit.Base.officeBlue(); - MochiKit.Base.update(moreOpts, options); - PlotKit.SweetSVGRenderer.__super__.__init__.call(this, element, layout, moreOpts); - //this._addDropShadowFilter(); -}; - -PlotKit.SweetSVGRenderer.prototype._addDropShadowFilter = function() { - var filter = this.createSVGElement("filter", {x: 0, y: 0, "id":"dropShadow"}); - var goffset = this.createSVGElement("feOffset", - {"in": "SourceGraphic", "dx": 0, "dy": 0, "result": "topCopy"}); - var blur = this.createSVGElement("feGaussianBlur", - {"in": "SourceAlpha", "StdDeviation": 2, "result": "shadow"}); - var soffset = this.createSVGElement("feOffset", - {"in": "shadow", "dx": -1, "dy": -2, "result":"movedShadow"}); - var merge = this.createSVGElement("feMerge"); - var gmerge = this.createSVGElement("feMergeNode", {"in":"topCopy"}); - var smerge = this.createSVGElement("feMergeNode", {"in":"movedShadow"}); - - merge.appendChild(gmerge); - merge.appendChild(smerge); - filter.appendChild(goffset); - filter.appendChild(blur); - filter.appendChild(soffset); - filter.appendChild(merge); - this.defs.appendChild(filter); -}; - -// --------------------------------------------------------------------- -// Extended Plotting Functions -// --------------------------------------------------------------------- - -PlotKit.SweetSVGRenderer.prototype._renderBarChart = function() { - var bind = MochiKit.Base.bind; - var shadowColor = Color.blackColor().toRGBString(); - var shadowStyle = "fill:" + shadowColor + ";fill-opacity:0.15"; - var strokeStyle = "stroke-width: 2.0; stroke:" + Color.whiteColor().toRGBString(); - - var drawRect = function(attrs, bar) { - var x = this.area.w * bar.x + this.area.x; - var y = this.area.h * bar.y + this.area.y; - var w = this.area.w * bar.w; - var h = this.area.h * bar.h; - - if ((w < 1) || (h < 1)) - return; - - //attrs["filter"] = "url(#dropShadow)"; - attrs["style"] = strokeStyle; - this._drawRect(x - 2, y - 1, w+4, h+2, {"style":shadowStyle}); - this._drawRect(x, y, w, h, attrs); - }; - this._renderBarOrLine(this.layout.bars, bind(drawRect, this)); - -}; - -PlotKit.SweetSVGRenderer.prototype._renderLineChart = function() { - var bind = MochiKit.Base.bind; - var shadowColor = Color.blackColor().toRGBString(); - var shadowStyle = "fill:" + shadowColor + ";fill-opacity:0.15"; - var strokeStyle = "stroke-width: 2.0; stroke:" + Color.whiteColor().toRGBString(); - - var addPoint = function(attrs, point) { - this._tempPointsBuffer += (this.area.w * point.x + this.area.x) + "," + - (this.area.h * point.y + this.area.y) + " "; - }; - - var startLine = function(attrs) { - this._tempPointsBuffer = ""; - this._tempPointsBuffer += (this.area.x) + "," + (this.area.y+this.area.h) + " "; - }; - - var endLine = function(attrs) { - this._tempPointsBuffer += (this.area.w + this.area.x) + "," +(this.area.h + this.area.y); - attrs["points"] = this._tempPointsBuffer; - - attrs["stroke"] = "none"; - attrs["transform"] = "translate(-2, -1)"; - attrs["style"] = shadowStyle; - var shadow = this.createSVGElement("polygon", attrs); - this.root.appendChild(shadow); - - attrs["transform"] = ""; - attrs["style"] = strokeStyle; - var elem = this.createSVGElement("polygon", attrs); - this.root.appendChild(elem); - - - }; - - this._renderBarOrLine(this.layout.points, - bind(addPoint, this), - bind(startLine, this), - bind(endLine, this)); -}; - -PlotKit.SweetSVGRenderer.prototype._renderPieChart = function() { - var centerx = this.area.x + this.area.w * 0.5; - var centery = this.area.y + this.area.h * 0.5; - var shadowColor = Color.blackColor().toRGBString(); - var radius = Math.min(this.area.w * this.options.pieRadius, - this.area.h * this.options.pieRadius); - var shadowStyle = "fill:" + shadowColor + ";fill-opacity:0.15"; - - var shadow = this.createSVGElement("circle", - {"style": shadowStyle, "cx": centerx + 1, "cy": centery + 1, "r": radius + 1}); - this.root.appendChild(shadow); - - PlotKit.SweetSVGRenderer.__super__._renderPieChart.call(this); -}; - - -PlotKit.SweetSVGRenderer.prototype._renderBackground = function() { - var attrs = { - "fill": this.options.backgroundColor.toRGBString(), - "stroke": "none" - }; - - - if (this.layout.style == "bar" || this.layout.style == "line") { - this._drawRect(this.area.x, this.area.y, - this.area.w, this.area.h, attrs); - - var ticks = this.layout.yticks; - var horiz = false; - if (this.layout.style == "bar" && - this.layout.options.barOrientation == "horizontal") { - ticks = this.layout.xticks; - horiz = true; - } - - for (var i = 0; i < ticks.length; i++) { - var x = 0; - var y = 0; - var w = 0; - var h = 0; - - if (horiz) { - x = ticks[i][0] * this.area.w + this.area.x; - y = this.area.y; - w = 1; - h = this.area.w; - } - else { - x = this.area.x; - y = ticks[i][0] * this.area.h + this.area.y; - w = this.area.w; - h = 1; - } - - this._drawRect(x, y, w, h, - {"fill": this.options.axisLineColor.toRGBString()}); - } - } - else { - PlotKit.SweetSVGRenderer.__super__._renderBackground.call(this); - - } - -}; - -// Namespace Iniitialisation - -PlotKit.SweetSVG = {} -PlotKit.SweetSVG.SweetSVGRenderer = PlotKit.SweetSVGRenderer; - -PlotKit.SweetSVG.EXPORT = [ - "SweetSVGRenderer" -]; - -PlotKit.SweetSVG.EXPORT_OK = [ - "SweetSVGRenderer" -]; - -PlotKit.SweetSVG.__new__ = function() { - var m = MochiKit.Base; - - m.nameFunctions(this); - - this.EXPORT_TAGS = { - ":common": this.EXPORT, - ":all": m.concat(this.EXPORT, this.EXPORT_OK) - }; -}; - -PlotKit.SweetSVG.__new__(); -MochiKit.Base._exportSymbols(this, PlotKit.SweetSVG); diff --git a/plotkit_v091/PlotKit/dummy.svg b/plotkit_v091/PlotKit/dummy.svg deleted file mode 100644 index 6a82bd4..0000000 --- a/plotkit_v091/PlotKit/dummy.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/plotkit_v091/PlotKit/excanvas.js b/plotkit_v091/PlotKit/excanvas.js deleted file mode 100644 index ca77da2..0000000 --- a/plotkit_v091/PlotKit/excanvas.js +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO: Patterns -// TODO: Radial gradient -// TODO: Clipping paths -// TODO: Coordsize (still need to support stretching) -// TODO: Painting mode -// TODO: Optimize -// TODO: canvas width/height sets content size in moz, border size in ie - -// only add this code if we do not already have a canvas implementation -if (!window.CanvasRenderingContext2D) { - -(function () { - - // alias some functions to make (compiled) code shorter - var m = Math; - var mr = m.round; - var ms = m.sin; - var mc = m.cos; - - var G_vmlCanvasManager_ = { - init: function (opt_doc) { - var doc = opt_doc || document; - if (/MSIE/.test(navigator.userAgent) && !window.opera) { - var self = this; - doc.attachEvent("onreadystatechange", function () { - self.init_(doc); - }); - } - }, - - init_: function (doc, e) { - if (doc.readyState == "complete") { - // create xmlns - if (!doc.namespaces["g_vml_"]) { - doc.namespaces.add("g_vml_", "urn:schemas-microsoft-com:vml"); - } - - // setup default css - var ss = doc.createStyleSheet(); - ss.cssText = "canvas{display:inline-block;overflow:hidden;" + - "text-align:left;}" + - "g_vml_\\:*{behavior:url(#default#VML)}"; - - // find all canvas elements - var els = doc.getElementsByTagName("canvas"); - for (var i = 0; i < els.length; i++) { - if (!els[i].getContext) { - this.initElement(els[i]); - } - } - } - }, - - fixElement_: function (el) { - // in IE before version 5.5 we would need to add HTML: to the tag name - // but we do not care about IE before version 6 - var outerHTML = el.outerHTML; - var newEl = document.createElement(outerHTML); - // if the tag is still open IE has created the children as siblings and - // it has also created a tag with the name "/FOO" - if (outerHTML.slice(-2) != "/>") { - var tagName = "/" + el.tagName; - var ns; - // remove content - while ((ns = el.nextSibling) && ns.tagName != tagName) { - ns.removeNode(); - } - // remove the incorrect closing tag - if (ns) { - ns.removeNode(); - } - } - el.parentNode.replaceChild(newEl, el); - return newEl; - }, - - /** - * Public initializes a canvas element so that it can be used as canvas - * element from now on. This is called automatically before the page is - * loaded but if you are creating elements using createElement you need to - * make sure this is called on the element. - * @param {HTMLElement} el The canvas element to initialize. - * @return {HTMLElement} the element that was created. - */ - initElement: function (el) { - el = this.fixElement_(el); - el.getContext = function () { - if (this.context_) { - return this.context_; - } - return this.context_ = new CanvasRenderingContext2D_(this); - }; - - // do not use inline function because that will leak memory - // el.attachEvent('onpropertychange', onPropertyChange) - el.attachEvent('onresize', onResize); - - var attrs = el.attributes; - if (attrs.width && attrs.width.specified) { - // TODO: use runtimeStyle and coordsize - // el.getContext().setWidth_(attrs.width.nodeValue); - el.style.width = attrs.width.nodeValue + "px"; - } - if (attrs.height && attrs.height.specified) { - // TODO: use runtimeStyle and coordsize - // el.getContext().setHeight_(attrs.height.nodeValue); - el.style.height = attrs.height.nodeValue + "px"; - } - //el.getContext().setCoordsize_() - return el; - } - }; - - function onPropertyChange(e) { - // we need to watch changes to width and height - switch (e.propertyName) { - case 'width': - case 'height': - // TODO: coordsize and size - break; - } - } - - function onResize(e) { - var el = e.srcElement; - if (el.firstChild) { - el.firstChild.style.width = el.clientWidth + 'px'; - el.firstChild.style.height = el.clientHeight + 'px'; - } - } - - G_vmlCanvasManager_.init(); - - // precompute "00" to "FF" - var dec2hex = []; - for (var i = 0; i < 16; i++) { - for (var j = 0; j < 16; j++) { - dec2hex[i * 16 + j] = i.toString(16) + j.toString(16); - } - } - - function createMatrixIdentity() { - return [ - [1, 0, 0], - [0, 1, 0], - [0, 0, 1] - ]; - } - - function matrixMultiply(m1, m2) { - var result = createMatrixIdentity(); - - for (var x = 0; x < 3; x++) { - for (var y = 0; y < 3; y++) { - var sum = 0; - - for (var z = 0; z < 3; z++) { - sum += m1[x][z] * m2[z][y]; - } - - result[x][y] = sum; - } - } - return result; - } - - function copyState(o1, o2) { - o2.fillStyle = o1.fillStyle; - o2.lineCap = o1.lineCap; - o2.lineJoin = o1.lineJoin; - o2.lineWidth = o1.lineWidth; - o2.miterLimit = o1.miterLimit; - o2.shadowBlur = o1.shadowBlur; - o2.shadowColor = o1.shadowColor; - o2.shadowOffsetX = o1.shadowOffsetX; - o2.shadowOffsetY = o1.shadowOffsetY; - o2.strokeStyle = o1.strokeStyle; - } - - function processStyle(styleString) { - var str, alpha = 1; - - styleString = String(styleString); - if (styleString.substring(0, 3) == "rgb") { - var start = styleString.indexOf("(", 3); - var end = styleString.indexOf(")", start + 1); - var guts = styleString.substring(start + 1, end).split(","); - - str = "#"; - for (var i = 0; i < 3; i++) { - str += dec2hex[parseInt(guts[i])]; - } - - if ((guts.length == 4) && (styleString.substr(3, 1) == "a")) { - alpha = guts[3]; - } - } else { - str = styleString; - } - - return [str, alpha]; - } - - function processLineCap(lineCap) { - switch (lineCap) { - case "butt": - return "flat"; - case "round": - return "round"; - case "square": - default: - return "square"; - } - } - - /** - * This class implements CanvasRenderingContext2D interface as described by - * the WHATWG. - * @param {HTMLElement} surfaceElement The element that the 2D context should - * be associated with - */ - function CanvasRenderingContext2D_(surfaceElement) { - this.m_ = createMatrixIdentity(); - - this.mStack_ = []; - this.aStack_ = []; - this.currentPath_ = []; - - // Canvas context properties - this.strokeStyle = "#000"; - this.fillStyle = "#ccc"; - - this.lineWidth = 1; - this.lineJoin = "miter"; - this.lineCap = "butt"; - this.miterLimit = 10; - this.globalAlpha = 1; - - var el = document.createElement('div'); - el.style.width = surfaceElement.clientWidth + 'px'; - el.style.height = surfaceElement.clientHeight + 'px'; - el.style.overflow = 'hidden'; - el.style.position = 'absolute'; - surfaceElement.appendChild(el); - - this.element_ = el; - this.arcScaleX_ = 1; - this.arcScaleY_ = 1; - }; - - var contextPrototype = CanvasRenderingContext2D_.prototype; - contextPrototype.clearRect = function() { - this.element_.innerHTML = ""; - this.currentPath_ = []; - }; - - contextPrototype.beginPath = function() { - // TODO: Branch current matrix so that save/restore has no effect - // as per safari docs. - - this.currentPath_ = []; - }; - - contextPrototype.moveTo = function(aX, aY) { - this.currentPath_.push({type: "moveTo", x: aX, y: aY}); - }; - - contextPrototype.lineTo = function(aX, aY) { - this.currentPath_.push({type: "lineTo", x: aX, y: aY}); - }; - - contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, - aCP2x, aCP2y, - aX, aY) { - this.currentPath_.push({type: "bezierCurveTo", - cp1x: aCP1x, - cp1y: aCP1y, - cp2x: aCP2x, - cp2y: aCP2y, - x: aX, - y: aY}); - }; - - contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { - // VML's qb produces different output to Firefox's - // FF's behaviour seems to have changed in 1.5.0.1, check this - this.bezierCurveTo(aCPx, aCPy, aCPx, aCPy, aX, aY); - }; - - contextPrototype.arc = function(aX, aY, aRadius, - aStartAngle, aEndAngle, aClockwise) { - aRadius *= 10; - var arcType = aClockwise ? "at" : "wa"; - - var xStart = aX + (mc(aStartAngle) * aRadius) - 5; - var yStart = aY + (ms(aStartAngle) * aRadius) - 5; - - var xEnd = aX + (mc(aEndAngle) * aRadius) - 5; - var yEnd = aY + (ms(aEndAngle) * aRadius) - 5; - - this.currentPath_.push({type: arcType, - x: aX, - y: aY, - radius: aRadius, - xStart: xStart, - yStart: yStart, - xEnd: xEnd, - yEnd: yEnd}); - - }; - - contextPrototype.rect = function(aX, aY, aWidth, aHeight) { - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - }; - - contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { - // Will destroy any existing path (same as FF behaviour) - this.beginPath(); - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - this.stroke(); - }; - - contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { - // Will destroy any existing path (same as FF behaviour) - this.beginPath(); - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - this.fill(); - }; - - contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { - var gradient = new CanvasGradient_("gradient"); - return gradient; - }; - - contextPrototype.createRadialGradient = function(aX0, aY0, - aR0, aX1, - aY1, aR1) { - var gradient = new CanvasGradient_("gradientradial"); - gradient.radius1_ = aR0; - gradient.radius2_ = aR1; - gradient.focus_.x = aX0; - gradient.focus_.y = aY0; - return gradient; - }; - - contextPrototype.drawImage = function (image, var_args) { - var dx, dy, dw, dh, sx, sy, sw, sh; - var w = image.width; - var h = image.height; - - if (arguments.length == 3) { - dx = arguments[1]; - dy = arguments[2]; - sx = sy = 0; - sw = dw = w; - sh = dh = h; - } else if (arguments.length == 5) { - dx = arguments[1]; - dy = arguments[2]; - dw = arguments[3]; - dh = arguments[4]; - sx = sy = 0; - sw = w; - sh = h; - } else if (arguments.length == 9) { - sx = arguments[1]; - sy = arguments[2]; - sw = arguments[3]; - sh = arguments[4]; - dx = arguments[5]; - dy = arguments[6]; - dw = arguments[7]; - dh = arguments[8]; - } else { - throw "Invalid number of arguments"; - } - - var d = this.getCoords_(dx, dy); - - var w2 = (sw / 2); - var h2 = (sh / 2); - - var vmlStr = []; - - // For some reason that I've now forgotten, using divs didn't work - vmlStr.push(' ' , - '', - ''); - - this.element_.insertAdjacentHTML("BeforeEnd", - vmlStr.join("")); - }; - - contextPrototype.stroke = function(aFill) { - var lineStr = []; - var lineOpen = false; - var a = processStyle(aFill ? this.fillStyle : this.strokeStyle); - var color = a[0]; - var opacity = a[1] * this.globalAlpha; - - lineStr.push(' max.x) { - max.x = c.x; - } - if (min.y == null || c.y < min.y) { - min.y = c.y; - } - if (max.y == null || c.y > max.y) { - max.y = c.y; - } - } - } - lineStr.push(' ">'); - - if (typeof this.fillStyle == "object") { - var focus = {x: "50%", y: "50%"}; - var width = (max.x - min.x); - var height = (max.y - min.y); - var dimension = (width > height) ? width : height; - - focus.x = mr((this.fillStyle.focus_.x / width) * 100 + 50) + "%"; - focus.y = mr((this.fillStyle.focus_.y / height) * 100 + 50) + "%"; - - var colors = []; - - // inside radius (%) - if (this.fillStyle.type_ == "gradientradial") { - var inside = (this.fillStyle.radius1_ / dimension * 100); - - // percentage that outside radius exceeds inside radius - var expansion = (this.fillStyle.radius2_ / dimension * 100) - inside; - } else { - var inside = 0; - var expansion = 100; - } - - var insidecolor = {offset: null, color: null}; - var outsidecolor = {offset: null, color: null}; - - // We need to sort 'colors' by percentage, from 0 > 100 otherwise ie - // won't interpret it correctly - this.fillStyle.colors_.sort(function (cs1, cs2) { - return cs1.offset - cs2.offset; - }); - - for (var i = 0; i < this.fillStyle.colors_.length; i++) { - var fs = this.fillStyle.colors_[i]; - - colors.push( (fs.offset * expansion) + inside, "% ", fs.color, ","); - - if (fs.offset > insidecolor.offset || insidecolor.offset == null) { - insidecolor.offset = fs.offset; - insidecolor.color = fs.color; - } - - if (fs.offset < outsidecolor.offset || outsidecolor.offset == null) { - outsidecolor.offset = fs.offset; - outsidecolor.color = fs.color; - } - } - colors.pop(); - - lineStr.push(''); - } else if (aFill) { - lineStr.push(''); - } else { - lineStr.push( - '' - ); - } - - lineStr.push(""); - - this.element_.insertAdjacentHTML("beforeEnd", lineStr.join("")); - - this.currentPath_ = []; - }; - - contextPrototype.fill = function() { - this.stroke(true); - } - - contextPrototype.closePath = function() { - this.currentPath_.push({type: "close"}); - }; - - /** - * @private - */ - contextPrototype.getCoords_ = function(aX, aY) { - return { - x: 10 * (aX * this.m_[0][0] + aY * this.m_[1][0] + this.m_[2][0]) - 5, - y: 10 * (aX * this.m_[0][1] + aY * this.m_[1][1] + this.m_[2][1]) - 5 - } - }; - - contextPrototype.save = function() { - var o = {}; - copyState(this, o); - this.aStack_.push(o); - this.mStack_.push(this.m_); - this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); - }; - - contextPrototype.restore = function() { - copyState(this.aStack_.pop(), this); - this.m_ = this.mStack_.pop(); - }; - - contextPrototype.translate = function(aX, aY) { - var m1 = [ - [1, 0, 0], - [0, 1, 0], - [aX, aY, 1] - ]; - - this.m_ = matrixMultiply(m1, this.m_); - }; - - contextPrototype.rotate = function(aRot) { - var c = mc(aRot); - var s = ms(aRot); - - var m1 = [ - [c, s, 0], - [-s, c, 0], - [0, 0, 1] - ]; - - this.m_ = matrixMultiply(m1, this.m_); - }; - - contextPrototype.scale = function(aX, aY) { - this.arcScaleX_ *= aX; - this.arcScaleY_ *= aY; - var m1 = [ - [aX, 0, 0], - [0, aY, 0], - [0, 0, 1] - ]; - - this.m_ = matrixMultiply(m1, this.m_); - }; - - /******** STUBS ********/ - contextPrototype.clip = function() { - // TODO: Implement - }; - - contextPrototype.arcTo = function() { - // TODO: Implement - }; - - contextPrototype.createPattern = function() { - return new CanvasPattern_; - }; - - // Gradient / Pattern Stubs - function CanvasGradient_(aType) { - this.type_ = aType; - this.radius1_ = 0; - this.radius2_ = 0; - this.colors_ = []; - this.focus_ = {x: 0, y: 0}; - } - - CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { - aColor = processStyle(aColor); - this.colors_.push({offset: 1-aOffset, color: aColor}); - }; - - function CanvasPattern_() {} - - // set up externs - G_vmlCanvasManager = G_vmlCanvasManager_; - CanvasRenderingContext2D = CanvasRenderingContext2D_; - CanvasGradient = CanvasGradient_; - CanvasPattern = CanvasPattern_; - -})(); - -} // if diff --git a/plotkit_v091/README b/plotkit_v091/README deleted file mode 100644 index 7e77bac..0000000 --- a/plotkit_v091/README +++ /dev/null @@ -1 +0,0 @@ -For more information, go to http://www.liquidx.net/plotkit/. diff --git a/plotkit_v091/doc/MochiKitAdditions.html b/plotkit_v091/doc/MochiKitAdditions.html deleted file mode 100644 index d21b157..0000000 --- a/plotkit_v091/doc/MochiKitAdditions.html +++ /dev/null @@ -1,2 +0,0 @@ -.. title: MochiKit Additions - diff --git a/plotkit_v091/doc/MochiKitAdditions.txt b/plotkit_v091/doc/MochiKitAdditions.txt deleted file mode 100644 index d21b157..0000000 --- a/plotkit_v091/doc/MochiKitAdditions.txt +++ /dev/null @@ -1,2 +0,0 @@ -.. title: MochiKit Additions - diff --git a/plotkit_v091/doc/PlotKit.Base.html b/plotkit_v091/doc/PlotKit.Base.html deleted file mode 100644 index 3cb0f7c..0000000 --- a/plotkit_v091/doc/PlotKit.Base.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - PlotKit.Base | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | >> -

- -

PlotKit Base

-

PlotKit Base contains a number of simple functions that are needed for the rest of the PlotKit libraries. -

- -

PlotKit.Base Functions

-
    -
  • - collapse() -
  • -
-

Given an array, it will collapse all the values from the passed array into one big array. -

-

[[1,2], [3,4], [5,6]] --> [1, 2, 3, 4, 5, 6] -

-
    -
  • - findPosX(element) -
  • -
-

Returns the X value of the element relative to the document in a browser independent way. -

-
    -
  • - findPosY(element) -
  • -
-

Returns the Y value of the element relative to the document in a browser independent way. -

-
    -
  • - palette(baseColor, fromLevel = -0.2, toLevel = 0.2, increment = 0.1) -
  • -
-

Takes in a base colour and generates a palette of colours based on the intensive levels. -

-
    -
  • - roundInterval(value, precision) -
  • -
-

Rounds a number to a specified precision. TODO: make more robust -

-
    -
  • - uniq(array) -
  • -
-

Acts like the UNIX uniq, takes a sorted array and returns a new array that only contains uniq elements. -

-
    -
  • - isFuncLike(obj) (PlotKit 0.9+) -
  • -
-

Returns true if it is of type function. -

-
    -
  • - usingPrototype() (PlotKit 0.9+) -
  • -
-

Checks whether the javascript runtime is polluted by prototype.js -

-
    -
  • - items(lst) (PlotKit 0.9+) -
  • -
-

A version of MochiKit.Base.items() that is aware of prototype.js -

-
    -
  • - keys(lst) (PlotKit 0.9+) -
  • -
-

A version of MochiKit.Base.keys() that is aware of prototype.js -

-
    -
  • - map(fn, lst) (PlotKit 0.9+) -
  • -
-

A version of MochiKit.Base.map() that is aware of prototype.js -

- -

Preset Styles

- -

Color Schemes

-

There are some colour schemes, which are an array of - MochiKit.Color.Colors. -

-
    -
  • - colorScheme() -
  • -
-

A default colour scheme that consists of red, orange, yellow, green, cyan, blue, purple and magenta. -

-
    -
  • - baseDarkPrimaryColors() -
  • -
-

A set of five dark colours. -

-
    -
  • - basePrimaryColors() -
  • -
-

A set of five bright primary colours. -

-
    -
  • - baseBlueColors() -
  • -
-

Three colour set that have a nice professional blue hue. -

- -

Office Style

-

These are base styles that were inspired by charts in Office 12. The - color schemes are fairly similar to those found in screenshots of - charts available online. -

-
    -
  • - officeBaseStyle -
  • -
-

Contains the basic style independent of colours. -

-
    -
  • - officeBlue() -
  • -
-

Blue colors: bluecolors -

-
    -
  • - officeRed() -
  • -
-

Red colors: redcolors -

-
    -
  • - officeGreen() -
  • -
-

Green colors: greencolors -

-
    -
  • - officePurple() -
  • -
-

Purple colors: purplecolors -

-
    -
  • - officeCyan() -
  • -
-

Cyan colors: cyancolors -

-
    -
  • - officeOrange() -
  • -
-

Orange colors: orangecolors -

-
    -
  • - officeBlack() -
  • -
-

Black colors: blackcolors -

- -

Usage

-

var layout = PlotKit.Layout("bar", officeOrange()); -

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.Base.txt b/plotkit_v091/doc/PlotKit.Base.txt deleted file mode 100644 index c0d8c3a..0000000 --- a/plotkit_v091/doc/PlotKit.Base.txt +++ /dev/null @@ -1,139 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.Base{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [>>](PlotKit.Layout.html) - -PlotKit Base -============ - -PlotKit Base contains a number of simple functions that are needed for the rest of the PlotKit libraries. - -PlotKit.Base Functions ----------------------- - -* ``collapse()`` - - Given an array, it will collapse all the values from the passed array into one big array. - - ``[[1,2], [3,4], [5,6]] --> [1, 2, 3, 4, 5, 6]`` - -* ``findPosX(element)`` - - Returns the X value of the element relative to the document in a browser independent way. - -* ``findPosY(element)`` - - Returns the Y value of the element relative to the document in a browser independent way. - -* ``palette(baseColor, fromLevel = -0.2, toLevel = 0.2, increment = 0.1)`` - - Takes in a base colour and generates a palette of colours based on the intensive levels. - -* ``roundInterval(value, precision)`` - - Rounds a number to a specified precision. __TODO: make more robust__ - -* ``uniq(array)`` - - Acts like the UNIX uniq, takes a sorted array and returns a new array that only contains uniq elements. - -* ``isFuncLike(obj)`` (PlotKit 0.9+) - - Returns true if it is of type ``function``. - -* ``usingPrototype()`` (PlotKit 0.9+) - - Checks whether the javascript runtime is polluted by prototype.js - -* ``items(lst)`` (PlotKit 0.9+) - - A version of ``MochiKit.Base.items()`` that is aware of prototype.js - -* ``keys(lst)`` (PlotKit 0.9+) - - A version of ``MochiKit.Base.keys()`` that is aware of prototype.js - -* ``map(fn, lst)`` (PlotKit 0.9+) - - A version of ``MochiKit.Base.map()`` that is aware of prototype.js - -Preset Styles -============= - -Color Schemes -------------- - -There are some colour schemes, which are an array of -MochiKit.Color.Colors. - -* ``colorScheme()`` - -A default colour scheme that consists of red, orange, yellow, green, cyan, blue, purple and magenta. - -* ``baseDarkPrimaryColors()`` - -A set of five dark colours. - -* ``basePrimaryColors()`` - -A set of five bright primary colours. - -* ``baseBlueColors()`` - -Three colour set that have a nice professional blue hue. - -Office Style ------------- - -These are base styles that were inspired by charts in Office 12. The -color schemes are fairly similar to those found in screenshots of -charts available online. - -* ``officeBaseStyle`` - - Contains the basic style independent of colours. - -* ``officeBlue()`` - - Blue colors: ![bluecolors](blue.png) - -* ``officeRed()`` - - Red colors: ![redcolors](red.png) - -* ``officeGreen()`` - - Green colors: ![greencolors](green.png) - -* ``officePurple()`` - - Purple colors: ![purplecolors](purple.png) - -* ``officeCyan()`` - - Cyan colors: ![cyancolors](cyan.png) - -* ``officeOrange()`` - - Orange colors: ![orangecolors](orange.png) - -* ``officeBlack()`` - - Black colors: ![blackcolors](black.png) - -Usage ------ - - ``var layout = PlotKit.Layout("bar", officeOrange());`` - -{% endfilter %} -
-{% endblock %} \ No newline at end of file diff --git a/plotkit_v091/doc/PlotKit.Canvas.html b/plotkit_v091/doc/PlotKit.Canvas.html deleted file mode 100644 index 4689952..0000000 --- a/plotkit_v091/doc/PlotKit.Canvas.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - PlotKit.Canvas | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | << | >> -

- -

PlotKit Canvas

-

This contains the CanvasRenderer, the default renderer and most well supported one used in PlotKit. -

-

It supports Safari 2, Firefox 1.5, Opera 9 and IE 6. Note that for IE6 - support, you will need iecanvas.htc which is included with PlotKit. -

-

Please see the Canvas/SVG Browser Support Status for bugs - with the Canvas implementation on different browsers. -

- -

PlotKit Canvas Extra Options

-

In addition to the options outlined in PlotKit.Renderer, here are additional options that the CanvasRenderer supports. -

- - - - - - - - - - - - -
Option nameDescriptionTypeDefault
IECanvasHTCPath relative to the HTML document of the iecanvas.htc file.stringiecanvas.htc
- - -

PlotKit Canvas Example

-
var options = {
-    "drawsBackground": true,
-    "drawYAxis": false,
-    "IECanvasHTC": "contrib/iecanvas.htc"
-};
-
-var layout = new Layout("bar", {});
-layout.addDataset("squares", [[0, 0], [1, 1], [2, 4], [3, 9], [4, 16]]);
-layout.evaluate()
-var renderer = new CanvasRenderer($('canvas'), layout, options);
-layout.render();
-
-

PlotKit Canvas Events/Signals

-

There is preliminary support for events in the CanvasRenderer. If enableEvents is set true in the options, you can hook into the onmousemove, onclick, onmouseover and onmouseout events via the MochiKit.Signal.connect. Note that you must have included MochiKit/Signal.js before instantiating the CanvasRenderer -

- -

PlotKit Canvas Notes

- -

IE Support

-

IE Support is done thanks to webfx's great iecanvas.htc which emulates - part of the WHATWG canvas specification. Note that alpha values and - clear() does not work in IE. -

-

Remember that iecanvas.htc must reside on the same domain as the - HTML page itself. -

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.Canvas.txt b/plotkit_v091/doc/PlotKit.Canvas.txt deleted file mode 100644 index c1e383c..0000000 --- a/plotkit_v091/doc/PlotKit.Canvas.txt +++ /dev/null @@ -1,81 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.Canvas{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [<<](PlotKit.Renderer.html) | [>>](PlotKit.SVG.html) - -PlotKit Canvas -============== - -This contains the CanvasRenderer, the default renderer and most well supported one used in PlotKit. - -It supports Safari 2, Firefox 1.5, Opera 9 and IE 6. Note that for IE6 -support, you will need iecanvas.htc which is included with PlotKit. - -Please see the [Canvas/SVG Browser Support Status][Browser] for bugs -with the Canvas implementation on different browsers. - -PlotKit Canvas Extra Options ----------------------------- - -In addition to the options outlined in [PlotKit.Renderer][], here are additional options that the CanvasRenderer supports. - - - - - - - - - - - - - -
Option nameDescriptionTypeDefault
IECanvasHTCPath relative to the HTML document of the iecanvas.htc file.stringiecanvas.htc
- -PlotKit Canvas Example ----------------------- - - var options = { - "drawsBackground": true, - "drawYAxis": false, - "IECanvasHTC": "contrib/iecanvas.htc" - }; - - var layout = new Layout("bar", {}); - layout.addDataset("squares", [[0, 0], [1, 1], [2, 4], [3, 9], [4, 16]]); - layout.evaluate() - var renderer = new CanvasRenderer($('canvas'), layout, options); - layout.render(); - -PlotKit Canvas Events/Signals ------------------------------ - -There is preliminary support for events in the CanvasRenderer. If ``enableEvents`` is set ``true`` in the options, you can hook into the ``onmousemove``, ``onclick``, ``onmouseover`` and ``onmouseout`` events via the MochiKit.Signal.connect. Note that you must have included MochiKit/Signal.js before instantiating the CanvasRenderer - -PlotKit Canvas Notes --------------------- - -### IE Support - -IE Support is done thanks to webfx's great iecanvas.htc which emulates -part of the WHATWG canvas specification. Note that alpha values and -clear() does not work in IE. - -Remember that iecanvas.htc __must__ reside on the same domain as the -HTML page itself. - -[PlotKit.Renderer]: PlotKit.Renderer.html -[Browser]: SVGCanvasCompat.html - -{% endfilter %} -
-{% endblock %} \ No newline at end of file diff --git a/plotkit_v091/doc/PlotKit.EasyPlot.html b/plotkit_v091/doc/PlotKit.EasyPlot.html deleted file mode 100644 index a9a1549..0000000 --- a/plotkit_v091/doc/PlotKit.EasyPlot.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - PlotKit.Canvas | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | << -

- -

PlotKit EasyPlot

-

EasyPlot is a wrapper around the various PlotKit classes to allow you to get a chart plotted as quick as possible with as little code as possible. Using EasyPlot, you will get a chart started with just a single line. -

- -

Constructor

-

PlotKit.EasyPlot(style, options, divElement, datasourceArray) -

-

EasyPlot object will automatically choose the supported render method, currently Canvas or SVG in that order, and render the datasources given in datasourceArray. -

- -

Arguments:

-
    -
  • - style may be line, bar or pie. -
  • - -
  • - options is an associative dictionary that is the combined options of both Layout and Renderer. -
  • - -
  • - divElement is the container that the chart should be rendered in. It is best that the width and height attribute is set in the DIV element. -
  • - -
  • - datasourceArray is an array of data sources. The elements of the array can either be a two dimensional array given in Plotkit.Layout.addDataset or it can be a string that points to the relative URL of a comma separated data file. -
  • -
- -

EasyPlot Example

-
<div id="example" style="margin: 0 auto 0 auto;" width="400" height="400"></div>
-
-<script type="text/javascript">
-var data = [[0,0], [1,2], [2,3], [3, 7], [4, 8], [5, 6]];
-var plotter = EasyPlot("line", {}, $("example"), [data, "sample.txt"]);
-</script>
-

In this example, two datasets are passed, one defined as a 2D array and another which is a comma separated text file (CSV) at the location "sample.txt". A demonstration of this is found in the QuickStartEasy example. -

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.EasyPlot.txt b/plotkit_v091/doc/PlotKit.EasyPlot.txt deleted file mode 100644 index b23bbe7..0000000 --- a/plotkit_v091/doc/PlotKit.EasyPlot.txt +++ /dev/null @@ -1,50 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.Canvas{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [<<](PlotKit.SweetSVG.html) - -PlotKit EasyPlot -================ - -EasyPlot is a wrapper around the various PlotKit classes to allow you to get a chart plotted as quick as possible with as little code as possible. Using EasyPlot, you will get a chart started with just a single line. - -Constructor ------------ -``PlotKit.EasyPlot(style, options, divElement, datasourceArray)`` - -EasyPlot object will automatically choose the supported render method, currently Canvas or SVG in that order, and render the datasources given in ``datasourceArray``. - -### Arguments: - -* ``style`` may be ``line``, ``bar`` or ``pie``. -* ``options`` is an associative dictionary that is the combined options of both ``Layout`` and ``Renderer``. -* ``divElement`` is the container that the chart should be rendered in. It is best that the ``width`` and ``height`` attribute is set in the ``DIV`` element. -* ``datasourceArray`` is an array of data sources. The elements of the array can either be a two dimensional array given in ``Plotkit.Layout.addDataset`` or it can be a string that points to the relative URL of a comma separated data file. - -EasyPlot Example ----------------- - -
- - - - -In this example, two datasets are passed, one defined as a 2D array and another which is a comma separated text file (CSV) at the location "sample.txt". A demonstration of this is found in the [QuickStartEasy][] example. - - -[QuickStartEasy]: http://media.liquidx.net/js/plotkit-tests/quickstart-easy.html - -{% endfilter %} -
-{% endblock %} \ No newline at end of file diff --git a/plotkit_v091/doc/PlotKit.Layout.html b/plotkit_v091/doc/PlotKit.Layout.html deleted file mode 100644 index 72e99cf..0000000 --- a/plotkit_v091/doc/PlotKit.Layout.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - PlotKit.Layout | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | << | >> -

- -

PlotKit Layout

-

PlotKit Layout is the core of the plotting engine. It deals exclusively with laying objects out on a virtual canvas that has the dimension of 1.0 x 1.0. -

-

The layout engine abstracts away all the complex layout problems with plotting charts and presents a list of objects that need to rendered rather than mixing this with the rendering logic. -

-

PlotKit Layout also is responsible for simple chart state querying so renderers can implement basic event support for objects on the canvas. -

- -

Constructor

-

new Layout(style, options); -

-

Layout takes the following arguments: -

-

style which can be bar, line or pie which represnts the style of the graph that is desired. -

-

options is a dictionary/associative array of layout options. Unrecognised keys are ignored. The following options are supported: -

- -

Layout Options

- -

Bar and Line Chart layout options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Option nameDescriptionTypeDefault
barWidthFillFractionAmount of space the total amount of bars should consume per X value.Real number0.75
barOrientationOrientation of a bar chart. (PlotKit 0.9+ only)String ("vertical", "horizontal")vertical
xAxisMinimum and Maximum values on the X axis.Array of 2 Real numbers. (eg. [0.0, 10.0])null
xNumberOfTicksUsed when automatically calculating axis ticks. This denotes the number of ticks there should be in the graph.integer10
xOriginIsZeroShould graph have X axis origin at 0booleantrue
xTickPrecisionThe number of decimal places we should round to for tick values.integer1
xTicksX values at which ticks should be drawn. Automatically calculated if not defined using the parameters `xNumberOfTicks` and ``xTickPrecision``.Array of {label: "somelabel", v:value}.null
yAxisMinimum and Maximum values on the Y axis.Array of 2 Real numbers. (eg. [0.0, 10.0])null
yNumberOfTicksUsed when automatically calculating axis ticks. This denotes the number of ticks there should be in the graph.integer5
yOriginIsZeroShould graph have Y axis origin at 0true
yTickPrecisionThe number of decimal places we should round to for tick values.integer1
yTicksY values at which ticks should be drawn. Automatically calculated if not defined using the parameters ``yNumberOfTicks`` and ``yTickPrecision``.Array of {label: "somelabel", v:value}.null
- - -

Pie Chart Layout Options

- - - - - - - - - - - - -
Option nameDescriptionTypeDefault
pieRadiusRadius of the circle to be drawn.Real number0.4
- - -

Layout Properties

-

There are some properties you can access, either because you are using a layout inside a renderer or if you would like additional information. Under normal operations, you will not need to, or should modify these parameters. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
styleStringThis denotes the type of chart this layout is using. Valid values are ``bar``, ``line`` or ``pie``. Renderers will use this to determine which parameter (``bars``, ``points`` or ``slices``) to access in order to get draw the chart.
barsArray of Bar.This is a list of rectangles with values that the renderer should plot. This will only be valid after ``evaluate()`` has run. The properties of ``bar`` is described here. This is only valid if style is ``bar``. This array is sorted by dataset and then x-values.
pointsArray of Point.This is a list of points with values that the renderer should plot. This will only be valid after ``evaluate()`` has run. The properties of ``bar`` is described here. This is only valid if style is ``line``. This array is sorted by dataset and then x-values.
slicesArray of Slice.This is a list of pie slices with values that the renderer should plot. This will only be valid after ``evaluate()`` has run. The properties of ``bar`` is described here. This is only valid if style is ``pie``.
xticksArray of Tick.For style in ``bar`` or ``line``, these are the ticks on the X axis. A ``tick`` is represented as a two element array with the first element representing the x position of the tick and the second element representing the string value of the label at that position.
yticksArray of Tick.For style in ``bar`` or ``line``, these are the ticks on the Y axis. A ``tick`` is represented as a two element array with the first element representing the y position of the tick and the second element representing the string value of the label at that position.
datasetsAssociative Array of datasetsThis should normally only be used to find the number of datasets by performing ``keys(layout.datasets)``. If you are looking at this in a renderer, then the layout engine needs to be extended.
- - -

Layout Types

-

Here are the definition of the types that you will encounter if you access the properties of the Layout object, specifically bars, points and slices. If you are not writing a renderer, you do not need to know this. -

- -

Bar Type

-

Represents a bar that the renderer will draw. It contains the following properties. -

- - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
x, yfloattop left position of the bar between 0.0 and 1.0.
w, hfloatwidth and height of the bar from (``x``, ``y``) between 0.0 and 1.0.
xval, yvalfloatThe actual x value and y value this bar represents.
namestringName of the dataset which this bar belongs to.
- - -

Point Type

-

This represents a point on a line chart. -

- - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
x, yfloattop left position of the point between 0.0 and 1.0.
xval, yvalfloatThe actual x value and y value this bar represents.
namestringName of the dataset which this bar belongs to.
- - -

Slice Type

-

This represents a pie slice in a pie chart. -

- - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
fractionfloatThe fractional value this slice represents. This number is between 0.0 and 1.0
xval, yvalfloatThe x and y values of this slice.
startAnglefloatThis is the angle of the start of the slice, in radians.
endAnglefloatThis is the angle of the end of the slice, in radians.
- - -

Layout Methods

-
    -
  • - addDataset(name, values) -
  • -
-

Adds a dataset to the layout engine and assigns it with name. values is an array of \[x, y\] values. -

-
    -
  • - removeDataset(name) -
  • -
-

Removes a dataset from the layout engine. In order for the new data to take effect, you must run evaluate(). -

-
    -
  • - addDatasetFromTable(name, tableElement, xcol = 0, ycol = 1, labelCol = -1) -
  • -
-

Handy function to read values off a table. name is the name to give to the dataset just like in addDataset(), tableElement is the table which contains the values. Optionally, the user may specify to extract alternative columns using xcol and ycol. -

-

New in 0.9.1: If labelCol is specified to a value greater than -1, it will take the contents of that column as the xTick labels. -

-
    -
  • - evaluate() -
  • -
-

Performs the evaluation of the layout. It is not done automatically, and you must execute this before passing the layout to a renderer. -

-
    -
  • - hitTest(x, y) -
  • -
-

Used by renderers to see if a virtual canvas position corresponds to any data. The return value varies per style. For bar charts, it will return the Bar type if it is a hit, or null if not. For line charts, it will return a value if the point is underneath the highest curve, otherwise null (TODO: expand this or change implementation). For pie charts, it will return the Slice object that is at the point, otherwise null. -

-

Note that the specification of this function is subject to change. -

- -

Layout Notes

- -

Pie Chart Data and Ticks Restrictions

-

Note that you can only use one dataset for pie charts. Only the y value of the dataset will be used, but the x value must be unique and set as it will correspond to the xTicks that are given. -

-

Labels for pie charts will only use xTicks. -

- -

Layout Examples

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.Layout.txt b/plotkit_v091/doc/PlotKit.Layout.txt deleted file mode 100644 index ec692bb..0000000 --- a/plotkit_v091/doc/PlotKit.Layout.txt +++ /dev/null @@ -1,330 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.Layout{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [<<](PlotKit.Base.html) | [>>](PlotKit.Renderer.html) - -PlotKit Layout -============== - -PlotKit Layout is the core of the plotting engine. It deals exclusively with laying objects out on a virtual canvas that has the dimension of 1.0 x 1.0. - -The layout engine abstracts away all the complex layout problems with plotting charts and presents a list of objects that need to rendered rather than mixing this with the rendering logic. - -PlotKit Layout also is responsible for simple chart state querying so renderers can implement basic event support for objects on the canvas. - -Constructor -=========== - - `new Layout(style, options);` - -Layout takes the following arguments: - -__style__ which can be `bar`, `line` or `pie` which represnts the style of the graph that is desired. - -__options__ is a dictionary/associative array of layout options. Unrecognised keys are ignored. The following options are supported: - -Layout Options -============== - -Bar and Line Chart layout options ---------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Option nameDescriptionTypeDefault
barWidthFillFractionAmount of space the total amount of bars should consume per X value.Real number0.75
barOrientationOrientation of a bar chart. (PlotKit 0.9+ only)String ("vertical", "horizontal")vertical
xAxisMinimum and Maximum values on the X axis.Array of 2 Real numbers. (eg. [0.0, 10.0])null
xNumberOfTicksUsed when automatically calculating axis ticks. This denotes the number of ticks there should be in the graph.integer10
xOriginIsZeroShould graph have X axis origin at 0booleantrue
xTickPrecisionThe number of decimal places we should round to for tick values.integer1
xTicksX values at which ticks should be drawn. Automatically calculated if not defined using the parameters `xNumberOfTicks` and ``xTickPrecision``.Array of {label: "somelabel", v:value}.null
yAxisMinimum and Maximum values on the Y axis.Array of 2 Real numbers. (eg. [0.0, 10.0])null
yNumberOfTicksUsed when automatically calculating axis ticks. This denotes the number of ticks there should be in the graph.integer5
yOriginIsZeroShould graph have Y axis origin at 0true
yTickPrecisionThe number of decimal places we should round to for tick values.integer1
yTicksY values at which ticks should be drawn. Automatically calculated if not defined using the parameters ``yNumberOfTicks`` and ``yTickPrecision``.Array of {label: "somelabel", v:value}.null
- -Pie Chart Layout Options ------------------------- - - - - - - - - - - - - - -
Option nameDescriptionTypeDefault
pieRadiusRadius of the circle to be drawn.Real number0.4
- -Layout Properties -================= - -There are some properties you can access, either because you are using a layout inside a renderer or if you would like additional information. Under normal operations, you will not need to, or should modify these parameters. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
styleStringThis denotes the type of chart this layout is using. Valid values are ``bar``, ``line`` or ``pie``. Renderers will use this to determine which parameter (``bars``, ``points`` or ``slices``) to access in order to get draw the chart.
barsArray of Bar.This is a list of rectangles with values that the renderer should plot. This will only be valid after ``evaluate()`` has run. The properties of ``bar`` is described here. This is only valid if style is ``bar``. This array is sorted by dataset and then x-values.
pointsArray of Point.This is a list of points with values that the renderer should plot. This will only be valid after ``evaluate()`` has run. The properties of ``bar`` is described here. This is only valid if style is ``line``. This array is sorted by dataset and then x-values.
slicesArray of Slice.This is a list of pie slices with values that the renderer should plot. This will only be valid after ``evaluate()`` has run. The properties of ``bar`` is described here. This is only valid if style is ``pie``.
xticksArray of Tick.For style in ``bar`` or ``line``, these are the ticks on the X axis. A ``tick`` is represented as a two element array with the first element representing the x position of the tick and the second element representing the string value of the label at that position.
yticksArray of Tick.For style in ``bar`` or ``line``, these are the ticks on the Y axis. A ``tick`` is represented as a two element array with the first element representing the y position of the tick and the second element representing the string value of the label at that position.
datasetsAssociative Array of datasetsThis should normally only be used to find the number of datasets by performing ``keys(layout.datasets)``. If you are looking at this in a renderer, then the layout engine needs to be extended.
- -Layout Types -============ - -Here are the definition of the types that you will encounter if you access the properties of the Layout object, specifically ``bars``, ``points`` and ``slices``. If you are not writing a renderer, you do not need to know this. - -Bar Type --------- - -Represents a bar that the renderer will draw. It contains the following properties. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
x, yfloattop left position of the bar between 0.0 and 1.0.
w, hfloatwidth and height of the bar from (``x``, ``y``) between 0.0 and 1.0.
xval, yvalfloatThe actual x value and y value this bar represents.
namestringName of the dataset which this bar belongs to.
- -Point Type ----------- - -This represents a point on a line chart. - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
x, yfloattop left position of the point between 0.0 and 1.0.
xval, yvalfloatThe actual x value and y value this bar represents.
namestringName of the dataset which this bar belongs to.
- -Slice Type ----------- - -This represents a pie slice in a pie chart. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
fractionfloatThe fractional value this slice represents. This number is between 0.0 and 1.0
xval, yvalfloatThe x and y values of this slice.
startAnglefloatThis is the angle of the start of the slice, in radians.
endAnglefloatThis is the angle of the end of the slice, in radians.
- -Layout Methods -============== - -* ``addDataset(name, values)`` - - Adds a dataset to the layout engine and assigns it with ``name``. ``values`` is an array of ``\[x, y\]`` values. - -* ``removeDataset(name)`` - - Removes a dataset from the layout engine. In order for the new data to take effect, you must run ``evaluate()``. - -* ``addDatasetFromTable(name, tableElement, xcol = 0, ycol = 1, labelCol = -1)`` - - Handy function to read values off a table. ``name`` is the name to give to the dataset just like in ``addDataset()``, ``tableElement`` is the table which contains the values. Optionally, the user may specify to extract alternative columns using ``xcol`` and ``ycol``. - - **New in 0.9.1:** If ``labelCol`` is specified to a value greater than -1, it will take the contents of that column as the xTick labels. - -* ``evaluate()`` - - Performs the evaluation of the layout. It is not done automatically, and you __must__ execute this before passing the layout to a renderer. - -* hitTest(x, y) - - Used by renderers to see if a virtual canvas position corresponds to any data. The return value varies per style. For ``bar`` charts, it will return the Bar type if it is a hit, or null if not. For ``line`` charts, it will return a value if the point is underneath the highest curve, otherwise null __(TODO: expand this or change implementation)__. For ``pie`` charts, it will return the Slice object that is at the point, otherwise null. - - __Note that the specification of this function is subject to change__. - -Layout Notes -============ - -Pie Chart Data and Ticks Restrictions -------------------------------------- - -Note that you can only use one dataset for pie charts. Only the y value of the dataset will be used, but the x value must be unique and set as it will correspond to the xTicks that are given. - -Labels for pie charts will only use xTicks. - -Layout Examples -=============== - -{% endfilter %} -
-{% endblock %} - - - diff --git a/plotkit_v091/doc/PlotKit.QuickStart.html b/plotkit_v091/doc/PlotKit.QuickStart.html deleted file mode 100644 index 20635c6..0000000 --- a/plotkit_v091/doc/PlotKit.QuickStart.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - - PlotKit Quick Start | liquidx - - - - - - - - - - - - - - - - - - - - - -
-
- - -

PlotKit Quick Start

-

This is just a quick guide on how to get started with PlotKit. If you - want to delve in deeper, be sure to check out the - documentation. -

- -

Canvas or SVG

-

Before we start, you should know a little about HTML Canvas and SVG - support in the real browser world. For a more indepth coverage, please - check the SVG/Canvas Browser Support Status. -

-

Basically, Canvas and SVG have similar support across modern - browsers. Canvas is supported by Opera 9, Safari 2 and Firefox 1.5, - which probably only accounts for 10% of browsers. PlotKit also supports - a degraded Emulated Canvas mode under IE which means you can achieve - nearly 90% browser support using this technology. -

-

However, the future is in SVG where Firefox 1.5 and Opera 8 have - support it, and IE6 with the Adobe SVG Viewer (ASV) install means you - get around the same coverage as HTML Canvas. -

-

PlotKit plans to support both to maximise compatiblity. Canvas has a - simplier rendering engine, but can do the equivalent to what SVG can - apart from animation. SVG has wider support, but is more complex and - support for key features varies widely across different - implementations. -

- -

Graphing with Canvas

-

Download the latest PlotKit and MochiKit and extract it on to - your web server and make sure plotkit-0.8/PlotKit and - mochikit/MochiKit is visible. -

- -

Preparing the HTML

-

Add the script headers for PlotKit to work. -

-
<script type="text/javascript" src="/mochikit/MochiKit.js"></script>
-<script type="text/javascript" src="/plotkit/Base.js"></script>
-<script type="text/javascript" src="/plotkit/Layout.js"></script>
-<script type="text/javascript" src="/plotkit/Canvas.js"></script>
-<script type="text/javascript" src="/plotkit/SweetCanvas.js"></script>
-

MochiKit.js is an autoloader for all the elements of MochiKit. You can - reduce the size of it by making your own packed version or just - including the script headers individually. -

-

The other four PlotKit javascript files deal with some basic - functionality, the layout engine and two renderers, Canvas and - SweetCanvas. -

-

Now we add the <canvas> tag to where we want the graph to - appear. Note PlotKit requires the <canvas> tag is enclosed - inside a

tags for labels to work. -

-
 <div><canvas id="graph" height="300" width="300"></canvas></div>
-

This will create a blank canvas of 300 by 300 pixels. -

- -

Javascript

-

There are only two simple steps to draw a chart, first is the create a - layout with our data and second is to create the renderer. So lets - start off with creating the layout. -

- -

Layout and Data

-
var layout = new PlotKit.Layout("bar", {});
-layout.addDataset("sqrt", [[0, 0], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]);
-layout.evaluate();
-

There, it is that simple. Lets explain what each line is doing: -

-
    -
  1. var layout = new PlotKit.Layout("bar", {}); -

    -

    We create a new layout object, and tell it that we want a bar chart in the first parameter. The second parameter allows us to pass additional options, which we will go on to later. It can be left null, or in this case just an empty array. -

    - -
  2. - -
  3. layout.addDataset("sqrt", [[0, 0], [1, 1]...) -

    -

    This will add a new dataset to the layout. You can add multiple datasets by specifying a different name in the first parameter for each dataset. The dataset consists of an array of (x, y) values. These must be numeric, either floating point or integers. -

    -

    Note that PlotKit does not deal with negative numbers at the moment. -

    - -
  4. - -
  5. layout.evaluate(); -

    -

    This will be the last command you make on the layout before passing it to the renderer. This will tell the layout to calculate the layout of the chart so the renderer can draw it. It is an expensive operation, so do not call it frequently, only unless the data or options have been changed. -

    - -
  6. -
- -

Renderer

-
 var canvas = MochiKit.DOM.getElement("graph");
- var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, {});
- plotter.render();
-
    -
  1. var canvas = MochiKit.DOM.getElement("graph"); -

    -

    This line will get the HTML element we defined earlier. -

    - -
  2. - -
  3. var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, {}); -

    -

    This will create the renderer to work on the object passed, and also with the data in the layout we created earlier. Again, the third parameter here is for options to relates to the look of the graph. We will show you some things you can do with this in the following section. -

    - -
  4. - -
  5. plotter.render() -

    -

    This line will render the graph. -

    - -
  6. -
- -

Putting it altogether

-
function drawGraph() {
-    var layout = new PlotKit.Layout("bar", {});
-    layout.addDataset("sqrt", [[0, 0], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]);
-    layout.evaluate();
-    var canvas = MochiKit.DOM.getElement("graph");
-    var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, {});
-    plotter.render();
-}
-MochiKit.DOM.addLoadEvent(drawGraph);
-

This is a sample of what you would use to plot the graph of sqare roots for 0 to 4. Make sure you plot the graph on the load event because the DOM will not be ready if when the Javascript is first loaded. -

-

See this in an [HTML example here][example1]. -

- -

Additional Options

-

We mentioned that both the layout and renderer may take some additional options. In order to take advantage of that, we can use a simple options dictionary to store options for both layout and the renderer, in this way: -

-
var options = {
-   "IECanvasHTC": "/plotkit/iecanvas.htc",
-   "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),
-   "padding": {left: 0, right: 0, top: 10, bottom: 30},
-   "xTicks": [{v:0, label:"zero"}, 
-          {v:1, label:"one"}, 
-          {v:2, label:"two"},
-          {v:3, label:"three"},
-          {v:4, label:"four"}],
-   "drawYAxis": false
-};
-
-function drawGraph() {
-    var layout = new PlotKit.Layout("bar", options);
-    layout.addDataset("sqrt", [[0, 0], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]);
-    layout.evaluate();
-    var canvas = MochiKit.DOM.getElement("graph");
-    var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, options);
-    plotter.render();
-}
-MochiKit.DOM.addLoadEvent(drawGraph);
-

Here we define some additional options to affect how our graph is rendered. -

-
    -
  1. - First line defines where the IECanvasHTC behaviour file is so that we can have IE support. -
  2. - -
  3. - Second line defines a new colorScheme to use. Here we are just using another preset color scheme that creates a palette out of the 6th preset base colour. -
  4. - -
  5. - Third line defines some custom labels we would like by giving the mapping from X value to label. -
  6. - -
  7. - Fourth line tells the renderer not to draw the Y axis. -
  8. -
- -

Demonstration

-

To show you that is how it works, below is the graph defined exactly how it is presented in this quick start guide. On the left is a PNG of what you should expect and on the right is what it actually renders to. -

- -

Bar charts

-
-
screenshot of graph
-
-
 
-
- - -

Pie Charts

-
-
screenshot of graph
-
-
 
-
- - -

Author

-

Alastair Tse - Last Updated: 17th March 2006 -

- - -
- -
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.QuickStart.txt b/plotkit_v091/doc/PlotKit.QuickStart.txt deleted file mode 100644 index 44e6593..0000000 --- a/plotkit_v091/doc/PlotKit.QuickStart.txt +++ /dev/null @@ -1,256 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block title %}PlotKit Quick Start{% endblock %} -{% block headers %} - - - - - - -{% endblock %} - - -{% block content %} -
-{% filter markdown %} -PlotKit Quick Start -=================== - -This is just a quick guide on how to get started with PlotKit. If you -want to delve in deeper, be sure to check out the -[documentation][docs]. - -Canvas or SVG -============= - -Before we start, you should know a little about HTML Canvas and SVG -support in the real browser world. For a more indepth coverage, please -check the [SVG/Canvas Browser Support Status][Browser]. - -Basically, Canvas and SVG have similar support across modern -browsers. Canvas is supported by Opera 9, Safari 2 and Firefox 1.5, -which probably only accounts for 10% of browsers. PlotKit also supports -a degraded Emulated Canvas mode under IE which means you can achieve -nearly 90% browser support using this technology. - -However, the future is in SVG where Firefox 1.5 and Opera 8 have -support it, and IE6 with the Adobe SVG Viewer (ASV) install means you -get around the same coverage as HTML Canvas. - -PlotKit plans to support both to maximise compatiblity. Canvas has a -simplier rendering engine, but can do the equivalent to what SVG can -apart from animation. SVG has wider support, but is more complex and -support for key features varies widely across different -implementations. - -Graphing with Canvas -==================== - -Download the latest [PlotKit][] and [MochiKit][] and extract it on to -your web server and make sure ``plotkit-0.8/PlotKit`` and -``mochikit/MochiKit`` is visible. - -Preparing the HTML ------------------- - -Add the script headers for PlotKit to work. - - - - - - - -MochiKit.js is an autoloader for all the elements of MochiKit. You can -reduce the size of it by making your own packed version or just -including the script headers individually. - -The other four PlotKit javascript files deal with some basic -functionality, the layout engine and two renderers, Canvas and -SweetCanvas. - -Now we add the ```` tag to where we want the graph to -appear. Note PlotKit __requires__ the ```` tag is enclosed -inside a
tags for labels to work. - -
- -This will create a blank canvas of 300 by 300 pixels. - -Javascript ----------- - -There are only two simple steps to draw a chart, first is the create a -layout with our data and second is to create the renderer. So lets -start off with creating the layout. - -### Layout and Data - - var layout = new PlotKit.Layout("bar", {}); - layout.addDataset("sqrt", [[0, 0], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]); - layout.evaluate(); - -There, it is that simple. Lets explain what each line is doing: - -1. ``var layout = new PlotKit.Layout("bar", {});`` - - We create a new layout object, and tell it that we want a bar chart in the first parameter. The second parameter allows us to pass additional options, which we will go on to later. It can be left null, or in this case just an empty array. - -2. ``layout.addDataset("sqrt", [[0, 0], [1, 1]...)`` - - This will add a new dataset to the layout. You can add multiple datasets by specifying a different name in the first parameter for each dataset. The dataset consists of an array of (x, y) values. These must be numeric, either floating point or integers. - - Note that PlotKit does not deal with negative numbers at the moment. - -3. ``layout.evaluate();`` - - This will be the last command you make on the layout before passing it to the renderer. This will tell the layout to calculate the layout of the chart so the renderer can draw it. It is an expensive operation, so do not call it frequently, only unless the data or options have been changed. - -### Renderer - - var canvas = MochiKit.DOM.getElement("graph"); - var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, {}); - plotter.render(); - -1. ``var canvas = MochiKit.DOM.getElement("graph");`` - - This line will get the HTML element we defined earlier. - -2. ``var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, {});`` - - This will create the renderer to work on the object passed, and also with the data in the layout we created earlier. Again, the third parameter here is for options to relates to the look of the graph. We will show you some things you can do with this in the following section. - -3. ``plotter.render()`` - - This line will render the graph. - -### Putting it altogether - - function drawGraph() { - var layout = new PlotKit.Layout("bar", {}); - layout.addDataset("sqrt", [[0, 0], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]); - layout.evaluate(); - var canvas = MochiKit.DOM.getElement("graph"); - var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, {}); - plotter.render(); - } - MochiKit.DOM.addLoadEvent(drawGraph); - -This is a sample of what you would use to plot the graph of sqare roots for 0 to 4. Make sure you plot the graph on the load event because the DOM will not be ready if when the Javascript is first loaded. - -See this in an [HTML example here][example1]. - -### Additional Options - -We mentioned that both the layout and renderer may take some additional options. In order to take advantage of that, we can use a simple options dictionary to store options for both layout and the renderer, in this way: - - var options = { - "IECanvasHTC": "/plotkit/iecanvas.htc", - "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[0]), - "padding": {left: 0, right: 0, top: 10, bottom: 30}, - "xTicks": [{v:0, label:"zero"}, - {v:1, label:"one"}, - {v:2, label:"two"}, - {v:3, label:"three"}, - {v:4, label:"four"}], - "drawYAxis": false - }; - - function drawGraph() { - var layout = new PlotKit.Layout("bar", options); - layout.addDataset("sqrt", [[0, 0], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]); - layout.evaluate(); - var canvas = MochiKit.DOM.getElement("graph"); - var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, options); - plotter.render(); - } - MochiKit.DOM.addLoadEvent(drawGraph); - - -Here we define some additional options to affect how our graph is rendered. - -1. First line defines where the ``IECanvasHTC`` behaviour file is so that we can have IE support. -2. Second line defines a new colorScheme to use. Here we are just using another preset color scheme that creates a palette out of the 6th preset base colour. -3. Third line defines some custom labels we would like by giving the mapping from X value to label. -4. Fourth line tells the renderer not to draw the Y axis. - -Demonstration -============= - -To show you that is how it works, below is the graph defined exactly how it is presented in this quick start guide. On the left is a PNG of what you should expect and on the right is what it actually renders to. - -### Bar charts - -
-
screenshot of graph
-
-
 
-
- -### Pie Charts - -
-
screenshot of graph
-
-
 
-
- -Author -====== - -Alastair Tse - Last Updated: 17th March 2006 - -[docs]: PlotKit.html -[Browser]: SVGCanvasCompat.html -[PlotKit]: http://www.liquidx.net/plotkit/ -[MochiKit]: http://www.mochikit.com/ - -{% endfilter %} -
- -{% endblock %} \ No newline at end of file diff --git a/plotkit_v091/doc/PlotKit.Renderer.html b/plotkit_v091/doc/PlotKit.Renderer.html deleted file mode 100644 index 49ad300..0000000 --- a/plotkit_v091/doc/PlotKit.Renderer.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - - PlotKit.Renderer | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | << | >> -

- -

PlotKit Renderer

-

A Renderer is responsible for translating the layout calculated by PlotKit.Layout and draw it on to a HTML Canvas, SVG object or any other way. One way to use the renderer is to allow theming of graphs by tweaking the layout. -

-

PlotKit includes some common basic renderers, so you do not need to customise anything if you just plan to change the spacing, colors, fonts, or layout. -

-

PlotKit Renderers should follow an informal protocol to allow users to plug and play different renderers. Below is the informal protocol: -

- -

PlotKit Renderer Protocol

-
    -
  • - Constructor: new Renderer(element, layout, options = {}) -
  • -
-

element is the element which this renderer will perform on, layout is the PlotKit.Layout object and options is an associative dictionary described below. -

-
    -
  • - class function: isSupported() -
  • -
-

Optional check that returns true if the renderer is supported in the current browser. -

-
    -
  • - object method: render() -
  • -
-

Renders to canvas, can be called multiple times, but clear() must be called between invokations. -

-
    -
  • - object method: clear() -
  • -
-

Clear the canvas. -

- -

PlotKit Renderer Options

-

To allow some basic flexibility of the output, a renderer should - accept and act on the following options passed in the constructor. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Option nameDescriptionTypeDefault
backgroundColorcolor to use for backgroundMochiKit.Color.ColorColor.whiteColor()
colorSchemeColor scheme usedArray of MochiKit.Color.Coloroutput of PlotKit.Base.colorScheme()
strokeColorColor used stroking. If set to null, the renderer will - attempt to use strokeColorTransformMochiKit.Color.Color or nullnull
strokeColorTransformName of the method to call to transform Color into stroke color.string (name of a function that accepts no arguments)"asStrokeColor"
drawBackgroundWhether the background should be drawnbooleantrue
shouldFillShould fill in area under chartbooleantrue
shouldStrokeShould stroke the borders of shapes in chartbooleantrue
strokeWidthWidth of stroke used (if shouldStroke is set)float0.1
paddingPadding of the graph drawn (excluding labels)Object with properties: top, bottom, left, right.{left: 30, right:20, top: 10, bottom: 10}
drawYAxisdraw Y Axisbooleantrue
drawXAxisdraw X Axisbooleantrue
axisLineColorColor of axes line.MochiKit.Color.ColorColor.blackColor()
axisLineWidthaxis line widthfloat0.5
axisTickSizelength or height of a tick on the y and x axis respectively, in pixelsfloat3.0
axisLabelColorcolor of text label on axis.MochiKit.Color.ColorColor.blackColor()
axisLabelFontSizeFont size of labels in pixels integer9
axisLabelWidthWidth of labels on ticks, in pixelsinteger50
enableEventsEnable events (if supported)booleantrue
- - -

Internal Renderer Methods and Style

-

The default renderers that are available follow a rough structure. If - you plan to write a new renderer, you should think about using a - similar structure. -

-

Also, it is important that you follow an Object Orientated style and - split up the rendering methods as much as logically possible to allow - other developers to extend the work by using a "psuedo subclassing" - method described below. -

- -

Subclassing

-

PlotKit Renderers should adopt a Javascript subclassing structure to - allow developers/themers to customise certain aspects of the - rendering. Here is an example of what is expected: -

-
MyRenderer = function(element, layout, options) {
-    if (arguments.length  > 0)
-       this.__init__(element, layout, options);
-};
-
-MyRenderer.prototype.__init__ = function(element, layout, options) {
-  ....
-};
-

In this case, the default javascript constructor acts only when passed - arguments. MyRenderer.prototype.__init__ is the real - constructor. It is named in similar vein to Python's constructor. -

-

For users who would like to subclass, they will need to use the - following snippet of code: -

-
 MyAlternateRenderer = function(element, layout. options) {
-   if (arguments.length > 0) 
-      this.__init__(element, layout, options);
- };
- MyAlternateRenderer.prototype = new MyRenderer();
- MyAlternateRenderer.prototype.constructor = MyAlternateRenderer;
- MyAlternateRenderer.__super__ = MyRenderer.prototype;
-
- MyAlternateRenderer.prototype.__init__ = function(element, layout, options) {
-     MyAlternateRenderer.__super__.__init__.call(this, element, layout, options);
- };
-

For subclasses, they will need the following magic in order to - initialise their subclass. But after that, you can either override - MyAlternateRenderer.prototype.__init__ with your own - implementation or just leave the superclass to deal with the - constructor. -

-

A more thorough example can be found in the PlotKit source for - Canvas.js and SweetCanvas.js respectively. -

- -

Internal Renderer Properties

-

The bundled renderers are have the following common properties to - allow standard access by all subclasses: -

-
    -
  • - this.layout -
  • -
-

The PlotKit.Layout object passed by the user. -

-
    -
  • - this.element -
  • -
-

The HTML element to use, either a Canvas Element or SVG Element depending - on whether a Canvas Renderer or SVG Renderer is in use. -

-
    -
  • - this.options -
  • -
-

A dictionary of options that are applicable to the rendering style. -

-
    -
  • - this.xlabels -
  • -
-

A list of elements that represent the axis. Should be cleared whenever - clear() is executed. -

-
    -
  • - this.ylabels -
  • -
-

A list of elements that represent the axis. Should be cleared whenever - clear() is executed. -

- -

Internal Renderer Methods

-
    -
  • - _renderBarChart() -
  • -
-

Renders only the bars of a bar chart on the element by looking at - this.layout.bars for the bars to render. Will only be called if - this.layout.style == "bars" -

-
    -
  • - _renderLineChart() -
  • -
-

Renders only the lines of a line chart on the element by looking at - this.layout.points for the points to render. Will only be called if - this.layout.style == "line" -

-
    -
  • - _renderPieChart() -
  • -
-

Renders only the slices of the pie in this.layout.slices. - Will only be called if this.layout.style == "pie" -

-
    -
  • - _renderBarAxis() -
  • -
-

Renders the axis for a bar chart by looking at the - this.layout.xticks and this.layout.yticks. -

-
    -
  • - _renderLineAxis() -
  • -
-

Renders the axis for a line chart by looking at the - this.layout.xticks and this.layout.yticks. -

-
    -
  • - _renderPieAxis() -
  • -
-

Renders the labels for a pie chart by looking at - this.layout.xticks only. -

-
    -
  • - _renderBackground() -
  • -
-

Called to render the background of the chart. Should check whether - this.options.drawsBackground is set before proceeding. -

- -

Events from the Chart

-

There is preliminary support for events from the chart for the Canvas - Renderer but the API is not stablised and subject to change. (TODO). -

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.Renderer.txt b/plotkit_v091/doc/PlotKit.Renderer.txt deleted file mode 100644 index 6b58e87..0000000 --- a/plotkit_v091/doc/PlotKit.Renderer.txt +++ /dev/null @@ -1,299 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.Renderer{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [<<](PlotKit.Layout.html) | [>>](PlotKit.Canvas.html) - -PlotKit Renderer -================ - -A Renderer is responsible for translating the layout calculated by PlotKit.Layout and draw it on to a HTML Canvas, SVG object or any other way. One way to use the renderer is to allow theming of graphs by tweaking the layout. - -PlotKit includes some common basic renderers, so you do not need to customise anything if you just plan to change the spacing, colors, fonts, or layout. - -PlotKit Renderers should follow an informal protocol to allow users to plug and play different renderers. Below is the informal protocol: - -PlotKit Renderer Protocol -------------------------- -* Constructor: ``new Renderer(element, layout, options = {})`` - - ``element`` is the element which this renderer will perform on, ``layout`` is the PlotKit.Layout object and ``options`` is an associative dictionary described below. - -* class function: ``isSupported()`` - - Optional check that returns ``true`` if the renderer is supported in the current browser. - -* object method: ``render()`` - - Renders to canvas, can be called multiple times, but ``clear()`` must be called between invokations. - -* object method: ``clear()`` - - Clear the canvas. - -PlotKit Renderer Options ------------------------- -To allow some basic flexibility of the output, a renderer should -accept and act on the following options passed in the constructor. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Option nameDescriptionTypeDefault
backgroundColorcolor to use for backgroundMochiKit.Color.ColorColor.whiteColor()
colorSchemeColor scheme usedArray of MochiKit.Color.Coloroutput of PlotKit.Base.colorScheme()
strokeColorColor used stroking. If set to null, the renderer will - attempt to use strokeColorTransformMochiKit.Color.Color or nullnull
strokeColorTransformName of the method to call to transform Color into stroke color.string (name of a function that accepts no arguments)"asStrokeColor"
drawBackgroundWhether the background should be drawnbooleantrue
shouldFillShould fill in area under chartbooleantrue
shouldStrokeShould stroke the borders of shapes in chartbooleantrue
strokeWidthWidth of stroke used (if shouldStroke is set)float0.1
paddingPadding of the graph drawn (excluding labels)Object with properties: top, bottom, left, right.{left: 30, right:20, top: 10, bottom: 10}
drawYAxisdraw Y Axisbooleantrue
drawXAxisdraw X Axisbooleantrue
axisLineColorColor of axes line.MochiKit.Color.ColorColor.blackColor()
axisLineWidthaxis line widthfloat0.5
axisTickSizelength or height of a tick on the y and x axis respectively, in pixelsfloat3.0
axisLabelColorcolor of text label on axis.MochiKit.Color.ColorColor.blackColor()
axisLabelFontSizeFont size of labels in pixels integer9
axisLabelWidthWidth of labels on ticks, in pixelsinteger50
enableEventsEnable events (if supported)booleantrue
- -Internal Renderer Methods and Style -=================================== - -The default renderers that are available follow a rough structure. If -you plan to write a new renderer, you should think about using a -similar structure. - -Also, it is important that you follow an Object Orientated style and -split up the rendering methods as much as logically possible to allow -other developers to extend the work by using a "psuedo subclassing" -method described below. - -Subclassing ------------ - -PlotKit Renderers should adopt a Javascript subclassing structure to -allow developers/themers to customise certain aspects of the -rendering. Here is an example of what is expected: - - MyRenderer = function(element, layout, options) { - if (arguments.length > 0) - this.__init__(element, layout, options); - }; - - MyRenderer.prototype.__init__ = function(element, layout, options) { - .... - }; - -In this case, the default javascript constructor acts only when passed -arguments. ``MyRenderer.prototype.__init__`` is the real -constructor. It is named in similar vein to Python's constructor. - -For users who would like to subclass, they will need to use the -following snippet of code: - - MyAlternateRenderer = function(element, layout. options) { - if (arguments.length > 0) - this.__init__(element, layout, options); - }; - MyAlternateRenderer.prototype = new MyRenderer(); - MyAlternateRenderer.prototype.constructor = MyAlternateRenderer; - MyAlternateRenderer.__super__ = MyRenderer.prototype; - - MyAlternateRenderer.prototype.__init__ = function(element, layout, options) { - MyAlternateRenderer.__super__.__init__.call(this, element, layout, options); - }; - - -For subclasses, they will need the following magic in order to -initialise their subclass. But after that, you can either override -``MyAlternateRenderer.prototype.__init__`` with your own -implementation or just leave the superclass to deal with the -constructor. - -A more thorough example can be found in the PlotKit source for -``Canvas.js`` and ``SweetCanvas.js`` respectively. - -Internal Renderer Properties ----------------------------- - -The bundled renderers are have the following common properties to -allow standard access by all subclasses: - -* ``this.layout`` - -The PlotKit.Layout object passed by the user. - -* ``this.element`` - -The HTML element to use, either a Canvas Element or SVG Element depending -on whether a Canvas Renderer or SVG Renderer is in use. - -* ``this.options`` - -A dictionary of options that are applicable to the rendering style. - -* ``this.xlabels`` - -A list of elements that represent the axis. Should be cleared whenever -``clear()`` is executed. - -* ``this.ylabels`` - -A list of elements that represent the axis. Should be cleared whenever -``clear()`` is executed. - -Internal Renderer Methods -------------------------- - -* ``_renderBarChart()`` - -Renders only the bars of a bar chart on the element by looking at -``this.layout.bars`` for the bars to render. Will only be called if -``this.layout.style == "bars"`` - -* ``_renderLineChart()`` - -Renders only the lines of a line chart on the element by looking at -``this.layout.points`` for the points to render. Will only be called if -``this.layout.style == "line"`` - -* ``_renderPieChart()`` - -Renders only the slices of the pie in ``this.layout.slices``. -Will only be called if ``this.layout.style == "pie"`` - -* ``_renderBarAxis()`` - -Renders the axis for a bar chart by looking at the -``this.layout.xticks`` and ``this.layout.yticks``. - -* ``_renderLineAxis()`` - -Renders the axis for a line chart by looking at the -``this.layout.xticks`` and ``this.layout.yticks``. - -* ``_renderPieAxis()`` - -Renders the labels for a pie chart by looking at -``this.layout.xticks`` only. - -* ``_renderBackground()`` - -Called to render the background of the chart. Should check whether -``this.options.drawsBackground`` is set before proceeding. - - -Events from the Chart -===================== - -There is preliminary support for events from the chart for the Canvas -Renderer but the API is not stablised and subject to change. __(TODO)__. - -{% endfilter %} -
-{% endblock %} diff --git a/plotkit_v091/doc/PlotKit.SVG.html b/plotkit_v091/doc/PlotKit.SVG.html deleted file mode 100644 index 1ca29d1..0000000 --- a/plotkit_v091/doc/PlotKit.SVG.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - PlotKit.SVG | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | << | >> -

- -

PlotKit SVG

-

PlotKit SVG includes the SVGRenderer which allows chart plotting on SVG capable browsers such as Firefox 1.5 and Opera 9.0. It should support Adobe SVG plugin, but is current untested. -

- -

Important Implementation Requirements

-

In order to use the SVG Renderer, the file and webserver must support inline SVG files. This means the following conditions must exist: -

- -

The HTML file must be XHTML compliant.

-

So it should start off with this: -

-
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html
-xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
-xmlns:svg="http://www.w3.org/2000/svg"
-xmlns:xlink="http://www.w3.org/1999/xlink">
-<head>        
-  <object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2" width="1" height="1"></object>
-  <?import namespace="svg" implementation="#AdobeSVG"?>
-...
-
-

Correct XHTML Mime-Type

-

Firefox and MSIE are fussy about the mimetype to do in-line - SVG. Firefox requires that either the URL ends in .html or that the - file is returned as mime type application/xhtml+xml in the HTTP - headers. -

-

However, MSIE does not recognise application/xhtml+xml and will - work fine with regular text/html mimetype for XHTML. -

- -

Non XHTML Compliant javascript includes

-

You cannot use the autoloading MochiKit.js, but instead include all the JS files individually or use the packed MochiKit. This is because MochiKit's way of autoloading is not XHTML compliant. -

-

An example of this is in the tests. -

- -

PlotKit SVG Options

-

There are no additional options for the SVG Renderer apart from the default Renderer options. -

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.SVG.txt b/plotkit_v091/doc/PlotKit.SVG.txt deleted file mode 100644 index a590d9a..0000000 --- a/plotkit_v091/doc/PlotKit.SVG.txt +++ /dev/null @@ -1,64 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.SVG{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [<<](PlotKit.Canvas.html) | [>>](PlotKit.SweetCanvas.html) - -PlotKit SVG -=========== - -PlotKit SVG includes the SVGRenderer which allows chart plotting on SVG capable browsers such as Firefox 1.5 and Opera 9.0. It should support Adobe SVG plugin, but is current untested. - -Important Implementation Requirements -------------------------------------- - -In order to use the SVG Renderer, the file and webserver must support inline SVG files. This means the following conditions must exist: - -###The HTML file must be XHTML compliant. - -So it should start off with this: - - - - - - - - ... - -###Correct XHTML Mime-Type - -Firefox and MSIE are fussy about the mimetype to do in-line -SVG. Firefox requires that either the URL ends in .html or that the -file is returned as mime type ``application/xhtml+xml`` in the HTTP -headers. - -However, MSIE does not recognise ``application/xhtml+xml`` and will -work fine with regular ``text/html`` mimetype for XHTML. - -###Non XHTML Compliant javascript includes - -You cannot use the autoloading MochiKit.js, but instead include all the JS files individually or use the packed MochiKit. This is because MochiKit's way of autoloading is not XHTML compliant. - -An example of this is in the tests. - - -PlotKit SVG Options -------------------- - -There are no additional options for the SVG Renderer apart from the default Renderer options. - -{% endfilter %} -
-{% endblock %} \ No newline at end of file diff --git a/plotkit_v091/doc/PlotKit.SweetCanvas.html b/plotkit_v091/doc/PlotKit.SweetCanvas.html deleted file mode 100644 index ae170df..0000000 --- a/plotkit_v091/doc/PlotKit.SweetCanvas.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - PlotKit.SweetCanvas | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | << | >> -

- -

PlotKit Sweet Canvas Renderer

-

This renderer is an extension of the basic Canvas Renderer to show off - what you can do to make graphs pretty without learning any graph - layout code. -

-

There are no extra methods or options to use. The interface is exactly - the same as PlotKit.Canvas's CanvasRenderer. -

-

SweetCanvasRenderer adds a fake shadow around bars, lines and circles - along with a 2.0 width white outline and a etched light coloured - background. -

- -

Example

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.SweetCanvas.txt b/plotkit_v091/doc/PlotKit.SweetCanvas.txt deleted file mode 100644 index 6f9e6b0..0000000 --- a/plotkit_v091/doc/PlotKit.SweetCanvas.txt +++ /dev/null @@ -1,34 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.SweetCanvas{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [<<](PlotKit.SVG.html) | [>>](PlotKit.SweetSVG.html) - -PlotKit Sweet Canvas Renderer -============================= - -This renderer is an extension of the basic Canvas Renderer to show off -what you can do to make graphs pretty without learning any graph -layout code. - -There are no extra methods or options to use. The interface is exactly -the same as ``PlotKit.Canvas``'s CanvasRenderer. - -SweetCanvasRenderer adds a fake shadow around bars, lines and circles -along with a 2.0 width white outline and a etched light coloured -background. - -Example -======= - -{% endfilter %} -
-{% endblock %} - diff --git a/plotkit_v091/doc/PlotKit.SweetSVG.html b/plotkit_v091/doc/PlotKit.SweetSVG.html deleted file mode 100644 index 0e9c4ff..0000000 --- a/plotkit_v091/doc/PlotKit.SweetSVG.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - PlotKit.SweetSVG | liquidx - - - - - - - - - - - - - - - - -
-
- -

PlotKit Home | << | >> -

- -

PlotKit Sweet SVG Renderer

-

This renderer is an extension of the basic SVG Renderer to show off - what you can do to make graphs pretty without learning any graph - layout code. -

-

There are no extra methods or options to use. The interface is exactly - the same as PlotKit.SVG's SVGRenderer. -

-

SweetSVGRenderer adds a fake shadow around bars, lines and circles - along with a 2.0 width white outline and a etched light coloured - background. -

- -

Example

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.SweetSVG.txt b/plotkit_v091/doc/PlotKit.SweetSVG.txt deleted file mode 100644 index 0af13df..0000000 --- a/plotkit_v091/doc/PlotKit.SweetSVG.txt +++ /dev/null @@ -1,34 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block headers %} - -{% endblock %} -{% block title %}PlotKit.SweetSVG{% endblock %} - -{% block content %} -
-{% filter markdown %} -[PlotKit Home](PlotKit.html) | [<<](PlotKit.SweetCanvas.html) | [>>](PlotKit.EasyPlot.html) - -PlotKit Sweet SVG Renderer -============================= - -This renderer is an extension of the basic SVG Renderer to show off -what you can do to make graphs pretty without learning any graph -layout code. - -There are no extra methods or options to use. The interface is exactly -the same as ``PlotKit.SVG``'s SVGRenderer. - -SweetSVGRenderer adds a fake shadow around bars, lines and circles -along with a 2.0 width white outline and a etched light coloured -background. - -Example -======= - -{% endfilter %} -
-{% endblock %} - diff --git a/plotkit_v091/doc/PlotKit.html b/plotkit_v091/doc/PlotKit.html deleted file mode 100644 index 5d9827c..0000000 --- a/plotkit_v091/doc/PlotKit.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - PlotKit Documentation | liquidx - - - - - - - - - - - - - - - - -
-
- - -

PlotKit

-

PlotKit is a Javascript graph plotting library. It is aimed at web - applications that require plotting series of data in modern web - browsers. -

-

PlotKit requires MochiKit. (1.3 or higher) -

-

PlotKit supports both HTML Canvas and SVG, along with an - emulated canvas for Internet Explorer. -

-

PlotKit is easily extensible to include other rendering engines, - styles and layouts. Please pursue the documentation for more - information. -

-

PlotKit is licensed under the BSD License, so you can include it in - your free or commercial applications without worrying. -

- -

PlotKit Components

- -

Base Classes

-
    -
  • - Base : Common functionality that is used in other classes, - including default styles. -
  • - -
  • - Layout : The default chart layout engine, supports bar, line and - pie charts. -
  • - -
  • - Renderer: Customising the look of the output -
  • -
- -

Renderer Specific Implementations

-
    -
  • - CanvasRenderer: Basic renderer using an HTML Canvas. -
  • - -
  • - SVGRenderer: Basic renderer using SVG. -
  • - -
  • - SweetCanvasRenderer: Customised Renderer that builds on CanvasRenderer to provide nicer looking charts. -
  • - -
  • - SweetSVGRenderer: Customised renderer that builds on SVGRenderer to provide nicer looking charts. -
  • -
- -

Utility Classes

-
    -
  • - EasyPlot: Simple Wrapper around classes to provide one-line plotting. -
  • -
- -

Getting Started

- - -

More Demos

- - -

Version History

- -

PlotKit 0.8

- - -

PlotKit 0.9

-
    -
  • - Fixed some redraw issues with clear() -
  • - -
  • - Replaced IECanvas.HTC with ExplorerCanvas -
  • - -
  • - Added auto import and packed versions just like MochiKit. -
  • - -
  • - Added horizontal bar chart rendering mode. -
  • - -
  • - Added awareness of prototype.js and workaround Array/Object mutilation issues with MochiKit. -
  • - -
  • - Added EasyPlot for single line plotting with Ajax support. -
  • - -
  • - More tests, dynamic charting and quickstart demos. -
  • -
- -

PlotKit 0.9.1

-
    -
  • - Make Sweet{Canvas/SVG}Renderers respect shouldFill. -
  • - -
  • - Fixed ignoring of maximum x and y values when setting xAxis/yAxis. -
  • - -
  • - Fixed typo for calculating yrange in Layout.js (thanks to - HubrisSonic). -
  • - -
  • - Changed SweetCanvasRenderer to use axisLineColor for drawing lines over - background (thanks to HubrisSonic). -
  • - -
  • - Fixed bug in y-axis tick drawing (thanks to Cliff). -
  • - -
  • - Fixed x-axis calculation bug when xAxisIsZero is false (thanks to - Loic Jeannin) -
  • - -
  • - Fixed xTicks drawing that exceed the bounds of the chart (thanks to - Cliff) -
  • - -
  • - Fixed barchart drawing with only 2 values (thanks to HubrisSonic) -
  • - -
  • - Hide pie chart labels of 0% (thanks to Attiks) -
  • - -
  • - Added optional field to addDatasetFromTable to include x-axis labels. -
  • - -
  • - Updated excanvas.js version to fix possible printing issues. -
  • -
- -

Road Map

- -

Version 0.9

-
    -
  • - AutoSelectRenderer, automatically choose Canvas or SVG by auto detecting browser support. -
  • -
- -

Version 0.10

-
    -
  • - Point plots -
  • - -
  • - Defined Event System Support -
  • - -
  • - Animation support. -
  • -
- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/PlotKit.txt b/plotkit_v091/doc/PlotKit.txt deleted file mode 100644 index 03a5dd7..0000000 --- a/plotkit_v091/doc/PlotKit.txt +++ /dev/null @@ -1,151 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block title %}PlotKit Documentation{% endblock %} -{% block headers %} - -{% endblock %} - - -{% block content %} -
-{% filter markdown %} -PlotKit -======= - -[PlotKit][] is a Javascript graph plotting library. It is aimed at web -applications that require plotting series of data in modern web -browsers. - -PlotKit requires [MochiKit][]. (1.3 or higher) - -PlotKit supports both HTML Canvas and SVG, along with an -[emulated canvas for Internet Explorer][IECanvas]. - -PlotKit is easily extensible to include other rendering engines, -styles and layouts. Please pursue the documentation for more -information. - -PlotKit is licensed under the BSD License, so you can include it in -your free or commercial applications without worrying. - -PlotKit Components -================== - -Base Classes ------------- - -* [Base][] : Common functionality that is used in other classes, - including default styles. -* [Layout][] : The default chart layout engine, supports bar, line and - pie charts. -* [Renderer][]: Customising the look of the output - -Renderer Specific Implementations ---------------------------------- - -* [CanvasRenderer][]: Basic renderer using an HTML Canvas. -* [SVGRenderer][]: Basic renderer using SVG. -* [SweetCanvasRenderer][]: Customised Renderer that builds on CanvasRenderer to provide nicer looking charts. -* [SweetSVGRenderer][]: Customised renderer that builds on SVGRenderer to provide nicer looking charts. - -Utility Classes ---------------- - -* [EasyPlot][]: Simple Wrapper around classes to provide one-line plotting. - -Getting Started -=============== - -* [PlotKit Quick Start][QuickStart] - A thorough quick start to getting charts working for Safari, Mozilla, Firefox, Opera and IE. -* [SVG/Canvas Browser Support Status][Browser] - Quirks about browser support that you should know about. -* [Simple Canvas Demo][QuickstartCanvasDemo] - Very basic Canvas demo all contained in an HTML file. -* [Simple SVG Demo][QuickstartSVGDemo] - Very basic SVG demo all contained in an HTML file. - -More Demos -========== - -* Unit Tests [Canvas][CanvasTest], [SVG][SVGTest], [SweetCanvas][SCanvasTest], [SweetSVG][SSVGTest]. -* [Dynamic Charting][DynamicTest]. -* [Labels Example][]. Thanks to Christopher Armstrong. -* [Labels with Images][]. -* [Axis Restrictions][]. - -Version History -=============== - - -###PlotKit 0.8 - -* Total rewrite from [CanvasGraph 0.7][CanvasGraph] - -###PlotKit 0.9 - -* Fixed some redraw issues with clear() -* Replaced IECanvas.HTC with ExplorerCanvas -* Added auto import and packed versions just like MochiKit. -* Added horizontal bar chart rendering mode. -* Added awareness of prototype.js and workaround Array/Object mutilation issues with MochiKit. -* Added EasyPlot for single line plotting with Ajax support. -* More tests, [dynamic charting][DynamicTest] and quickstart demos. - -###PlotKit 0.9.1 - -* Make Sweet{Canvas/SVG}Renderers respect shouldFill. -* Fixed ignoring of maximum x and y values when setting xAxis/yAxis. -* Fixed typo for calculating yrange in Layout.js (thanks to - HubrisSonic). -* Changed SweetCanvasRenderer to use axisLineColor for drawing lines over - background (thanks to HubrisSonic). -* Fixed bug in y-axis tick drawing (thanks to Cliff). -* Fixed x-axis calculation bug when xAxisIsZero is false (thanks to - Loic Jeannin) -* Fixed xTicks drawing that exceed the bounds of the chart (thanks to - Cliff) -* Fixed barchart drawing with only 2 values (thanks to HubrisSonic) -* Hide pie chart labels of 0% (thanks to Attiks) -* Added optional field to addDatasetFromTable to include x-axis labels. -* Updated excanvas.js version to fix possible printing issues. - -Road Map -======== -###Version 0.9 - -* AutoSelectRenderer, automatically choose Canvas or SVG by auto detecting browser support. - -###Version 0.10 - -* Point plots -* Defined Event System Support -* Animation support. - -[QuickStart]: PlotKit.QuickStart.html -[CanvasGraph]: http://www.liquidx.net/canvasgraphjs/ -[PlotKit]: http://www.liquidx.net/plotkit/ -[MochiKit]: http://mochikit.com/ -[IECanvas]: http://me.eae.net/archive/2005/12/29/canvas-in-ie/ -[Base]: PlotKit.Base.html -[Styles]: PlotKit.Styles.html -[Layout]: PlotKit.Layout.html -[Renderer]: PlotKit.Renderer.html -[CanvasRenderer]: PlotKit.Canvas.html -[SVGRenderer]: PlotKit.SVG.html -[SweetCanvasRenderer]: PlotKit.SweetCanvas.html -[SweetSVGRenderer]: PlotKit.SweetSVG.html -[EasyPlot]: PlotKit.EasyPlot.html -[Browser]: SVGCanvasCompat.html -[CanvasTest]: http://media.liquidx.net/js/plotkit-tests/basic.html -[SVGTest]: http://media.liquidx.net/js/plotkit-tests/svg.html -[SCanvasTest]: http://media.liquidx.net/js/plotkit-tests/sweet.html -[SSVGTest]: http://media.liquidx.net/js/plotkit-tests/sweet-svg.html -[QuickstartCanvasDemo]: http://media.liquidx.net/js/plotkit-tests/quickstart.html -[QuickstartSVGDemo]: http://media.liquidx.net/js/plotkit-tests/quickstart-svg.html -[QuickstartEasyDemo]: http://media.liquidx.net/js/plotkit-tests/quickstart-easy.html -[DynamicTest]: http://media.liquidx.net/js/plotkit-tests/dynamic.html -[Labels Example]: http://media.liquidx.net/js/plotkit-tests/labels.html -[Labels with Images]: http://media.liquidx.net/js/plotkit-tests/labels-img.html -[Axis Restrictions]: http://media.liquidx.net/js/plotkit-tests/axis.html - -{% endfilter %} -
-{% endblock %} diff --git a/plotkit_v091/doc/SVGCanvasCompat.html b/plotkit_v091/doc/SVGCanvasCompat.html deleted file mode 100644 index 58e7d64..0000000 --- a/plotkit_v091/doc/SVGCanvasCompat.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - SVG and Canvas Support Status in Various Browsers. | liquidx - - - - - - - - - - - - - - - - -
-
- - -

State of SVG and Canvas in Modern Browsers

-

By: Alastair Tse - Last Updated: 27 April 2006 -

-

My friends, just like HTML and CSS, different browsers support - different subsections of the SVG and Canvas specification. As part of - my work on PlotKit, the next generation javascript plotting library, - I've decided to summarise all the quirks in SVG and Canvas support. -

- -

Browsers Considered

-

I am looking at browsers that are considered "modern" as of - March 2006. These include: -

- -

I am also looking at some experiemental browsers as of March 2006. -

- - -

Canvas

- - -

Supporting Browsers

-
    -
  • - Safari 2.0 and above. -
  • - -
  • - Opera 9.0 and above. -
  • - -
  • - Firefox 1.5 and above. -
  • -
- -

Quirks

-
    -
  • Safari will forget a path after fill() or stroke() has - been called. Therefore, if you need to fill and stroke the same - path, you must draw the path out twice. -

    - -
  • - -
  • Opera will not obey stroke() for arc paths. -

    - -
  • - -
  • Firefox and Opera will not draw shadows even with - shadowStyle or shadowOffset is set on the context object. -

    - -
  • -
- -

SVG

-
    -
  • - SVG support is either provided natively, or through the Adobe SVG - Viewer (ASV). -
  • -
- -

Supporting Browsers (Inline)

-
    -
  • - Safari 2.0 + ASV -
  • - -
  • - Internet Explorer 6 + ASV -
  • - -
  • - Safari Webkit+SVG Nightly -
  • - -
  • - Opera 9.0 and above -
  • - -
  • - Mozilla Firefox 1.5 and above -
  • -
- -

Quirks (Inline)

-
    -
  • Safari Nightly will not render any text elements when - inlined. (Will do so if using embed) -

    - -
  • - -
  • Safari 2.0 + ASV will not respect inlined SVG. -

    - -
  • - -
  • Internet Explorer 6 + ASV will only parse inlined SVG if the - following is added to the HTML and all SVG elements are in the - correct namespace svg:. -

    - -
  • -
-

following is added to the HTML and all SVG elements are in the - correct namespace svg:. -

-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
-xmlns:svg="http://www.w3.org/2000/svg"
-xmlns:xlink="http://www.w3.org/1999/xlink">
-...
-<body>
-<!-- START Required for IE to support  inlined SVG -->
-<object id="AdobeSVG"
-classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2" width="1"
-height="1"></object>
-<?import namespace="svg" implementation="#AdobeSVG"?>
-<!-- END   Required for IE to support inlined SVG -->
-<svg:svg width="300" height="300" baseProfile="full" version="1.1"></svg:svg>
-</body>
-</html>
-
    -
  • Mozilla Firefox (1.5 and nightly) on Mac will not render - text elements when inlined. Note that it does for Linux and Windows. -

    - -
  • - -
  • Opera 9 will refuse to draw an element if attribute filter - is defined. -

    - -
  • -
-

is defined. -

-
    -
  • - Internet Explorer 7b2p + ASV will not work with the Adobe SVG Viewer. -
  • -
- -

Disclaimer

-

The above is presented as-is with my own findings. There may be - errors. Please do not use this to base your multi-million dollar - business decisions. -

- -

Contact

-

If you have anything to add or modify, please contact me at - alastair@liquidx.net. -

- - -
-
- - - - - - - - - - - - - diff --git a/plotkit_v091/doc/SVGCanvasCompat.txt b/plotkit_v091/doc/SVGCanvasCompat.txt deleted file mode 100644 index 4be4cd3..0000000 --- a/plotkit_v091/doc/SVGCanvasCompat.txt +++ /dev/null @@ -1,144 +0,0 @@ -{% extends "basex.html" %} -{% load markup %} -{% block pageid %}code{% endblock %} -{% block title %}SVG and Canvas Support Status in Various Browsers.{% endblock %} -{% block headers %} - -{% endblock %} - - -{% block content %} -
-{% filter markdown %} -State of SVG and Canvas in Modern Browsers -========================================== - -__By: Alastair Tse - Last Updated: 27 April 2006__ - - -My friends, just like HTML and CSS, different browsers support -different subsections of the SVG and Canvas specification. As part of -my work on PlotKit, the next generation javascript plotting library, -I've decided to summarise all the quirks in SVG and Canvas support. - -Browsers Considered -=================== - -I am looking at browsers that are considered "modern" as of -March 2006. These include: - -* [Safari 2.0.x][Safari] (W/ [Adobe SVG Plugin][ASV]) -* [Firefox 1.5.x][Firefox] -* [Opera 9.0 Preview 2][OperaSnapshot] -* [Internet Explorer 6][IE6] (w/ [Adobe SVG Plugin][ASV]) - -I am also looking at some experiemental browsers as of March 2006. - -* [Internet Explorer 7 beta 2 preview + ASV][IE7] -* [Safari WebKit+SVG Nightly 2006-03-11][WebkitNightly] -* [Firefox Deerpark Nightly 2006-03-11][FirefoxNightly] - -[Safari]: http://apple.com/safari/ -[Firefox]: http://www.mozilla.com/firefox/ -[OperaSnapshot]: http://snapshot.opera.com/ -[IE6]: http://www.microsoft.com/windows/ie/ -[ASV]: http://www.adobe.com/svg/ -[IE7]: http://www.microsoft.com/windows/IE/ie7/default.mspx -[WebkitNightly]: http://nightly.webkit.org/ -[FirefoxNightly]: http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ - - -Canvas -====== - -* Canvas is defined by the WHATWG in what is known as the - [Web Applications 1.0 specification][WHATWG] - -Supporting Browsers -------------------- - -* Safari 2.0 and above. -* Opera 9.0 and above. -* Firefox 1.5 and above. - -Quirks ------- - -* __Safari__ will forget a path after ``fill()`` or ``stroke()`` has - been called. Therefore, if you need to fill and stroke the same - path, you must draw the path out twice. - -* __Opera__ will not obey ``stroke()`` for arc paths. - -* __Firefox__ and __Opera__ will not draw shadows even with - ``shadowStyle`` or ``shadowOffset`` is set on the context object. - -SVG -=== - -* SVG support is either provided natively, or through the Adobe SVG - Viewer (ASV). - -Supporting Browsers (Inline) ----------------------------- - -* Safari 2.0 + ASV -* Internet Explorer 6 + ASV -* Safari Webkit+SVG Nightly -* Opera 9.0 and above -* Mozilla Firefox 1.5 and above - -Quirks (Inline) ---------------- - -* __Safari Nightly__ will not render any ``text`` elements when - inlined. (Will do so if using ``embed``) - -* __Safari 2.0 + ASV__ will not respect inlined SVG. - -* __Internet Explorer 6 + ASV__ will only parse inlined SVG if the - following is added to the HTML and all SVG elements are in the - correct namespace ``svg:``. - - - ... - - - - - - - - - -* __Mozilla Firefox (1.5 and nightly) on Mac__ will not render - ``text`` elements when inlined. Note that it does for Linux and Windows. - -* __Opera 9__ will refuse to draw an element if attribute ``filter`` - is defined. - -* __Internet Explorer 7b2p + ASV__ will not work with the Adobe SVG Viewer. - - -Disclaimer -========== - -The above is presented as-is with my own findings. There may be -errors. Please do not use this to base your multi-million dollar -business decisions. - -Contact -======= - -If you have anything to add or modify, please contact me at -. - -[WHATWG]: http://whatwg.org/specs/web-apps/current-work/ - -{% endfilter %} -
-{% endblock %} \ No newline at end of file diff --git a/plotkit_v091/doc/barsample.png b/plotkit_v091/doc/barsample.png deleted file mode 100644 index f11e1ed3c49878920b8a51388b696cbfb0bcb439..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2752 zcmeH}e>l@?AIBHTBGIqIp{#Lr^b|=tg<<7KT4+wE{9aCouvnJgX6YIw#UqC$%}z;@ za5TS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k)+1=W1k?(X=ZUee`dmEPv}uK5Myk$#ysAn{Yf0`;GKR>p`+ zhIZn6H-PZoyUT2!Y0`SGuhk3b!bmed+7)~Oc(d4As7#o5vLIk2N$HMYff-wis0k&= z8BuqDk$CV!kD~kGYl?2BpwlBVS=A0;sAsxHPdy19$I9W)874i7ofx0N?A5PPIL^KuCt*|TcSIP z=a|79z&@}r6Z0b6#LK0JBRR_lhsiPFmT3{u)D5~1E_AIXkUr|U@=nj-@!uUsTiFQf>3HmC z_|d$jXC}43w)LF{-eOXQHn(cqC$16_7r)Z&PfexAeR7I^aJl5-Qfp){$8WHbbUHn~ qz8!PX8N7;LW+eVubKvcwR1NJWx=y}LyT8_Jf)LK9ohluExc)Ed6$r)v diff --git a/plotkit_v091/doc/black.png b/plotkit_v091/doc/black.png deleted file mode 100644 index 9825e8fd7f1e3ae87d1e1b566ed9fd02129fc0f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^E-WR}DYhhUcNd2LAh=-f^2tCE&H|6f zVxTG^5N5n|x9$&6kiEpy*OmPmvw)bC%;H|gZlKU)PZ!4!kK=F8EAkyt5O4@Avo-Z~ zDBxu&UtoUl%Hvb41wU?GD`H;9w3XGt|QW`6N``WBxKaP#>e^<`y&t3b~g0JV}wp_zw$0NN~8mc|d zSu6Yh;T&(x^{=&-`dt3vRxgskz$|fqfz6=d=SKd`u@)zU-fuVnbRL7JtDnm{r-UW| D=woBo diff --git a/plotkit_v091/doc/blue.png b/plotkit_v091/doc/blue.png deleted file mode 100644 index cde1bd37fce05654361f6a330e3897299756c261..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^As{vf6Oi1|ac?D%VoUONcVYMsf(!O8p9~b?Ebxdd zW?J;WTzrILz`~8|9jY)6z*Wb~(Z+uv1-~T_GpMMGV zVb}Kf^h%3+@Ba^tKrny)d`A6*#H5rX%4d(9IMES)@BvE?4^K}|k55a?xlf<|mfKvC zxBDX?nj}{=@Bhcw@1MV~ultjHczsW2B1?1N`TnZ9E1wt7lmGf>#dCLC`&T~`IT>tu W-Om`^+_VhnLk3S*KbLh*2~7Y1RF&KS diff --git a/plotkit_v091/doc/cyan.png b/plotkit_v091/doc/cyan.png deleted file mode 100644 index ff946d660cbd8f12ab7ec86bf78c8abb6392f257..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^{y@yZ!2~4DxlLJt6kC$Fy9>jA5L~c#`DCC7XMsm# zF#`j)5C}6~x?A@LD9B#o>FdgVjafiUQuk(EP!UjQrl*Tzh{fsTn(v?ane#sUyKAke z$H!=QZ^pdH-TE=klmCAI`}+0P&5{xlPhO`l_Wb+*v-RbWy+#Lq9+>?7 %s' % (src, dst) - c = Context({}) - filled = loader.render_to_string(src, {}) - open(dst, 'w').write(filled) - -if __name__ == "__main__": - for dirname, dirs, files in os.walk('.'): - if re.search('/\.svn', dirname): - continue - for f in files: - if f[-4:] == ".txt": - newname = f.replace('.txt', '.html') - make(os.path.join(dirname, f), os.path.join(dirname, newname)) diff --git a/plotkit_v091/doc/green.png b/plotkit_v091/doc/green.png deleted file mode 100644 index 33f7da393819bf1aa8e148d4ce5028e9f7b0082e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 277 zcmeAS@N?(olHy`uVBq!ia0vp^E-WR}DYhhUcNd2LAh=-f^2tCE&H|6f zVxTG^5N5n|x9$&6kiEpy*OmPmvw)b0iYU*N*+8L1o-U3d9>XQuF#3rqg}`}uywWT}^dWzWAp3{C%hA*H_V zw{)UOaPYxTZ$7h5k6Y_D`R|{9;axwi^!)BQ_gC5fuj$kI`u=@=+xkQMj)m_3SGV&= z5i2vBz~gIEo^P-F{O;-e`ujhA{8VW2;W^CFQj!2~3=KG_@vQfx`y?k)`fL2$v|<�u1s;*b z3=G^tAk28_ZrvZCAbW|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FGQ$=0h=e;wmUm-pZU(2lB;RGiv0UTrkdj-K;P>{{R+N@EQUDRk3N%$sf1jAj>?1Ck}GmO?fEL!+Ud$SSVg%h%Xp{5GaNi z2?WMm(X+R;!Yr(kjY;6!^t>0z7P$-&)Tr9Y$SR2vP#9R009iC@V7zpmggb3X@={ zGKYfN$1|#AW9=AoQusE?4e~mOnmBm==s$%qvY)9@;qvboT>e$d{7=P9jDZ=ekq0K2 z_i)eBlz~Oe{YWId^7WPFqvGykIS6$ zVPUZx&pNl%q|`cp34js9V{aoJTkNk^v7`ZNv&DsSZhxKM|EV6DTz<*)0Yv+N=zQ{> z!Pq$Tb?NVo2$}{}>vtsYLzVz)aXkVt6_p}SB*|KU8clII?=_@SZ106OPrG4jhXnV9 z(|@7UtZ2cnT@X^g`$-n0jue;XzWdW(a`?BXUHcjUDoe66ZdYTjSExabt1xK!{IBt!XAXLn*wlY@N;RS+d2PcWGKo zG4>}NnVUce)JjqI>R&HjDO3_-Gef=yNq*z=Zb2ev*;YG GLH`S%(t@A> diff --git a/plotkit_v091/doc/purple.png b/plotkit_v091/doc/purple.png deleted file mode 100644 index 952edf11344f258a33403fc2eb4faf047bee7b1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^K0wUH!2~2He$nRzQfx`y?k)`fL2$v|<&%LToCO|{ z#S9GGLLkg|>2BR0pdfpRr>`sfHD&=Z8Sy06`c|OOJWm(L5Rc=@e||iZW;Xlq?{9To zVjiR8zpgXigxSw8Jo)d}=f5}B>hkdL1cr%b1l9ll`>|_V*LmJub-ym&X_J+Zs$a6T z>eY-Da*@@KuY9x4*c4w^qcczN#M#4JYtQ}UUmqaz?frdwv3>U+R{GiR`)jxHrP;FP zr6DX=eN^K2*Zlr`Ti(vjE=5zVO_0IO*7DWKK>xm~qAQaZ&y)G8lE=VsdXLTX7yoTn Q0A0%9>FVdQ&MBb@0Ik(;S^xk5 diff --git a/plotkit_v091/doc/red.png b/plotkit_v091/doc/red.png deleted file mode 100644 index 678cacb231019421c58eea19a33ca755d91f4055..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^{y@yb!2~4N%qkZKQfx`y?k)`fL2$v|<&%LToCO|{ z#S9GGLLkg|>2BR0pdfpRr>`sfHD&=ZVeM0&nE;HYUcYmw- z6cz0p4@wqp4FC4Vaq{0^-|zpKt}iJeu}n*QvFG1^|Kqi7@2=hR=j}r0>68Uco?W^0X!EwZ@1LIje}Dhy&mRV&28KN<2Cr@h-tYTWc4hnGeX?KQuE=+gTe~DWM4fZK;Iu diff --git a/plotkit_v091/scripts/pack.py b/plotkit_v091/scripts/pack.py deleted file mode 100755 index 566bf33..0000000 --- a/plotkit_v091/scripts/pack.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -# custom_rhino.jar from: -# http://dojotoolkit.org/svn/dojo/buildscripts/lib/custom_rhino.jar -# - -import os -import re -import sys -import shutil -import subprocess -mk = file('PlotKit/PlotKit.js').read() -if len(sys.argv) > 1: - outf = sys.stdout -else: - outf = file('PlotKit/PlotKit_Packed.js', 'w') -VERSION = re.search( - r"""(?mxs)PlotKit.PlotKit.VERSION\s*=\s*['"]([^'"]+)""", - mk -).group(1) -if len(sys.argv) > 1: - SUBMODULES = sys.argv[1:] -else: - SUBMODULES = map(str.strip, re.search( - r"""(?mxs)PlotKit.PlotKit.SUBMODULES\s*=\s*\[([^\]]+)""", - mk - ).group(1).replace(' ', '').replace('"', '').split(',')) - -alltext = '\n'.join( - [file('PlotKit/%s.js' % m).read() for m in SUBMODULES]) - -tf = file('_scratch.js', 'w') -tf.write(alltext) -tf.flush() - -p = subprocess.Popen( - ['java', '-jar', 'scripts/custom_rhino.jar', '-c', tf.name], - stdout=subprocess.PIPE, -) -print >>outf, """/*** - - PlotKit.PlotKit %(VERSION)s : PACKED VERSION - - THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please - diff against the source tree, not this file. - - For more information, . - - Copyright (c) 2006. Alastair Tse. - -***/ -""" % locals() -shutil.copyfileobj(p.stdout, outf) -outf.write('\n') -outf.flush() -outf.close() -tf.close() -os.remove(tf.name) diff --git a/plotkit_v091/tests/axis.html b/plotkit_v091/tests/axis.html deleted file mode 100644 index b8fb420..0000000 --- a/plotkit_v091/tests/axis.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - PlotKit: Axis Test - - - - - - - - - - -
-

Axis Test

- -
- - -
- - -
- diff --git a/plotkit_v091/tests/basic.html b/plotkit_v091/tests/basic.html deleted file mode 100644 index 8c6d25c..0000000 --- a/plotkit_v091/tests/basic.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - PlotKit : Basic Unit Tests - - - - - - - - - - -
-

Basic Unit Tests for PlotKit

- -
-
- - -
- diff --git a/plotkit_v091/tests/basic.js b/plotkit_v091/tests/basic.js deleted file mode 100644 index 147c0eb..0000000 --- a/plotkit_v091/tests/basic.js +++ /dev/null @@ -1,143 +0,0 @@ -/* actual tests */ - -var opts = { - "IECanvasHTC": "../plotkit/iecanvas.htc", - "enableEvents": true, - "strokeColor": null -}; - -function alert_val(e) { - alert("x:" + e.chart.xval + "y:" + e.chart.yval); -} - -function genericTest(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - var success = l.addDatasetFromTable("data" + num, $("test" + num)); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.CanvasRenderer(c, l, opts); - g.render(); - - // test events - MochiKit.Signal.connect(g, "onclick", alert_val); -} - -function genericTestAndClear(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - l.addDatasetFromTable("data" + num, $("test" + num)); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.CanvasRenderer(c, l, opts); - g.render(); - g.clear(); -} - -function dualDataSet(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - l.addDatasetFromTable("data1." + num, $("test" + num), 0, 1); - l.addDatasetFromTable("data2." + num, $("test" + num), 0, 2); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.CanvasRenderer(c, l, opts); - g.render(); -} - - -/* create HTML for tests */ - -function makeTableRow(list) { - return TR({}, map(partial(TD, null), list)); -} - -function generateTestTable(num, data) { - var tableid = "test" + num; - var tablehead = THEAD(null, map(makeTableRow, [["x", "y"]])); - var tablebody = TBODY(null, map(makeTableRow, data)); - - var table = TABLE({"class": "data", "id": tableid}, [tablehead, tablebody]); - return table; -} - -function generateCanvas(num) { - var canvasid = "test" + num + "canvas"; - var canvas = CANVAS({"id":canvasid, "width": "400", "height": "200"}, ""); - return canvas -} - -function generateUnitTest(num, func, data, type, desc) { - var table = DIV({"class": "data"}, generateTestTable(num, data)); - var canvas = DIV({"class": "canvas"}, generateCanvas(num)); - var ending = DIV({"class":"ending"}, desc); - - addLoadEvent(partial(func, num, type)); - - return DIV({"class": "unit"}, [table, canvas, ending]); -} - -function generateTests() { - var tests = $('tests'); - - // datasets - var simpleData1 = [[0, 0], [1, 1], [2, 2], [3, 3]]; - var simpleData2 = [[1, 2], [2, 3], [3, 4], [4, 5]]; - var singleData = [[1, 1]]; - - var ninety = [[1, 9], [2, 1]]; - - var floatData1 = [[0, 0.5], [1, 0.4], [2, 0.3]]; - var missingData = [[0, 1], [1, 4], [3, 16], [5, 17]]; - - var dualData = [[0,0,0], [1,2,1], [2,4,4], [3,8,9], [4,16,16], [5,32,25], [6, 64, 36], [7, 128, 49]]; - - tests.appendChild(H2(null, "Simple Tests")); - - tests.appendChild(generateUnitTest(1, genericTest, simpleData1, - "bar", "")); - - tests.appendChild(generateUnitTest(2, genericTest, simpleData1, - "line", "")); - - tests.appendChild(generateUnitTest(3, genericTest, simpleData2, - "pie", "")); - - tests.appendChild(H2(null, "One Value Set")); - - tests.appendChild(generateUnitTest(4, genericTest, singleData, - "bar", "")); - tests.appendChild(generateUnitTest(5, genericTest, singleData, - "line", "")); - tests.appendChild(generateUnitTest(6, genericTest, singleData, - "pie", "")); - - tests.appendChild(H2(null, "Float Values Set")); - tests.appendChild(generateUnitTest(7, genericTest, floatData1, - "bar", "")); - tests.appendChild(generateUnitTest(8, genericTest, floatData1, - "line", "")); - tests.appendChild(generateUnitTest(9, genericTest, floatData1, - "pie", "")); - - tests.appendChild(H2(null, "Dual Value Set")); - tests.appendChild(generateUnitTest(10, dualDataSet, dualData, - "bar", "")); - tests.appendChild(generateUnitTest(11, dualDataSet, dualData, - "line", "")); - - tests.appendChild(H2(null, "Drawing and Clearing")); - tests.appendChild(generateUnitTest(12, genericTest, floatData1, -"bar", "")); - tests.appendChild(generateUnitTest(13, genericTestAndClear, floatData1, -"bar", "")); - tests.appendChild(generateUnitTest(14, genericTest, floatData1, - "pie", "")); - tests.appendChild(generateUnitTest(15, genericTestAndClear, floatData1, - "pie", "")); - - tests.appendChild(H2(null, "Testing Circle Drawing")); - - tests.appendChild(generateUnitTest(16, genericTest, ninety, - "pie", "")); - -} - -addLoadEvent(generateTests); diff --git a/plotkit_v091/tests/debug.html b/plotkit_v091/tests/debug.html deleted file mode 100644 index e1ecd8b..0000000 --- a/plotkit_v091/tests/debug.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - PlotKit: Debug - - - - - - - - - - - - - - -
-

Debug

- -
-
- - -
- - -
- diff --git a/plotkit_v091/tests/demo-svg.html b/plotkit_v091/tests/demo-svg.html deleted file mode 100644 index 1b2c114..0000000 --- a/plotkit_v091/tests/demo-svg.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - PlotKit: SVGRenderer Test - - - - - - - - - - - - -
-

PlotKit Demo Page (SVG)

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- diff --git a/plotkit_v091/tests/demo-svg.js b/plotkit_v091/tests/demo-svg.js deleted file mode 100644 index 2e58a46..0000000 --- a/plotkit_v091/tests/demo-svg.js +++ /dev/null @@ -1,133 +0,0 @@ -/* actual tests */ - -function drawDemo(element, layout, options) { - var renderer = new PlotKit.SVGRenderer(element, layout, options); - renderer.render(); -} - -function demoWithStyle(style) { - // datasets - var dataset = [ - [0,1], - [1,4], - [2,16], - [3,8], - [4,16], - [5,4], - [6,1] - ]; - - var dataset_rev = [ - [6,0], - [5,1], - [4,4], - [3,9], - [2,16], - [1,25], - [0,36] - ]; - - var options = { - "drawBackground": false, - "shouldFill": true, - "shouldStroke": true, - "drawXAxis": true, - "drawYAxis": true, - "padding": {left: 40, right: 10, top: 10, bottom: 20}, - "axisLabelUseDiv": false - }; - - if (style == "pie") { - options["padding"] = {left: 50, right: 50, top: 50, bottom: 50} - } - - var layout = new PlotKit.Layout(style, options); - layout.addDataset("noname", dataset); - layout.evaluate(); - - // stroke/fill toggle - drawDemo($('test1'), layout, options); - options["shouldFill"] = false; - drawDemo($('test2'), layout, options); - options["shouldStroke"] = false; - options["shouldFill"] = true; - drawDemo($('test3'), layout, options); - - // drawing axis - options["shouldFill"] = true; - options["shouldStroke"] = true; - options["drawXAxis"] = false; - options["drawYAxis"] = false; - drawDemo($('test4'), layout, options); - options["drawXAxis"] = true; - drawDemo($('test5'), layout, options); - options["drawYAxis"] = true; - options["drawXAxis"] = false; - drawDemo($('test6'), layout, options); - - // changing background color and axis color - options["drawXAxis"] = true; - options["colorScheme"] = PlotKit.Base.colorScheme().reverse() - drawDemo($('test7'), layout, options); - options["drawBackground"] = true; - options["backgroundColor"] = Color.blueColor().lighterColorWithLevel(0.45); - drawDemo($('test8'), layout, options); - options["drawBackground"] = false; - options["axisLineColor"] = Color.grayColor(); - options["axisLabelColor"] = Color.grayColor(); - options["axisLabelFontSize"] = 9; - drawDemo($('test9'), layout, options); - - // layout customisation - options["colorScheme"] = PlotKit.Base.colorScheme(); - options["axisLineColor"] = Color.blackColor(); - options["axisLabelColor"] = Color.blackColor(); - options["axisLabelFontSize"] = 9; - options["yNumberOfTicks"] = 3; - - layout.options.yNumberOfTicks = 3; - layout.evaluate(); - drawDemo($('test10'), layout, options); - - layout.options.xNumberOfTicks = 3; - layout.evaluate(); - drawDemo($('test11'), layout, options); - - layout.options.barWidthFillFraction = 0.5; - layout.evaluate(); - drawDemo($('test12'), layout, options); - - - // custom labels - layout.options.barWidthFillFraction = 0.75; - layout.options.yTicks = [{v:10}, {v:20}, {v:30}, {v:40}]; - layout.evaluate(); - drawDemo($('test13'), layout, options); - - layout.options.xTicks = [ - {v:1, label:"one"}, - {v:2, label:"two"}, - {v:3, label:"three"}, - {v:4, label:"four"}, - {v:5, label:"five"}, - {v:6, label:"six"}]; - layout.evaluate(); - drawDemo($('test14'), layout, options); - - layout.addDataset("reversed", dataset_rev); - layout.options.yTicks = null; - layout.options.xTicks = null; - layout.options.xNumberOfTicks = 10; - layout.options.yNumberOfTicks = 5; - layout.options.xTicks = null; - layout.options.yTicks = null; - layout.evaluate(); - drawDemo($('test15'), layout, options); - -} - -function demo() { - demoWithStyle("bar"); -} - -addLoadEvent(demo); diff --git a/plotkit_v091/tests/demo.html b/plotkit_v091/tests/demo.html deleted file mode 100644 index dde591f..0000000 --- a/plotkit_v091/tests/demo.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - PlotKit : Demo - - - - - - - - - - - - -
-

PlotKit Demo Page

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- diff --git a/plotkit_v091/tests/demo.js b/plotkit_v091/tests/demo.js deleted file mode 100644 index c43d542..0000000 --- a/plotkit_v091/tests/demo.js +++ /dev/null @@ -1,136 +0,0 @@ -/* actual tests */ - -function drawDemo(element, layout, options) { - var renderer = new PlotKit.CanvasRenderer(element, layout, options); - renderer.render(); -} - -function demoWithStyle(style) { - // datasets - var dataset = [ - [0,1], - [1,4], - [2,16], - [3,8], - [4,16], - [5,4], - [6,1] - ]; - - var dataset_rev = [ - [6,0], - [5,1], - [4,4], - [3,9], - [2,16], - [1,25], - [0,36] - ]; - - - var options = { - "IECanvasHTC": "../plotkit/iecanvas.htc", - "drawBackground": false, - "shouldFill": true, - "shouldStroke": true, - "drawXAxis": true, - "drawYAxis": true, - "padding": {left: 40, right: 10, top: 10, bottom: 20}, - "strokeColor": null, - "strokeColorTransform": "asStrokeColor" - }; - - if (style == "pie") { - options["padding"] = {left: 50, right: 50, top: 50, bottom: 50} - } - - var layout = new PlotKit.Layout(style, options); - layout.addDataset("noname", dataset); - layout.evaluate(); - - // stroke/fill toggle - drawDemo($('test1'), layout, options); - options["shouldFill"] = false; - drawDemo($('test2'), layout, options); - options["shouldStroke"] = false; - options["shouldFill"] = true; - drawDemo($('test3'), layout, options); - - // drawing axis - options["shouldFill"] = true; - options["shouldStroke"] = true; - options["drawXAxis"] = false; - options["drawYAxis"] = false; - drawDemo($('test4'), layout, options); - options["drawXAxis"] = true; - drawDemo($('test5'), layout, options); - options["drawYAxis"] = true; - options["drawXAxis"] = false; - drawDemo($('test6'), layout, options); - - // changing background color and axis color - options["drawXAxis"] = true; - options["colorScheme"] = PlotKit.Base.colorScheme().reverse() - drawDemo($('test7'), layout, options); - options["drawBackground"] = true; - options["backgroundColor"] = Color.blueColor().lighterColorWithLevel(0.4); - drawDemo($('test8'), layout, options); - options["drawBackground"] = false; - options["axisLineColor"] = Color.grayColor(); - options["axisLabelColor"] = Color.grayColor(); - options["axisLabelFontSize"] = 8; - drawDemo($('test9'), layout, options); - - // layout customisation - options["colorScheme"] = PlotKit.Base.colorScheme(); - options["axisLineColor"] = Color.blackColor(); - options["axisLabelColor"] = Color.blackColor(); - options["axisLabelFontSize"] = 9; - options["yNumberOfTicks"] = 3; - - layout.options.yNumberOfTicks = 3; - layout.evaluate(); - drawDemo($('test10'), layout, options); - - layout.options.xNumberOfTicks = 3; - layout.evaluate(); - drawDemo($('test11'), layout, options); - - layout.options.barWidthFillFraction = 0.5; - layout.evaluate(); - drawDemo($('test12'), layout, options); - - - // custom labels - layout.options.barWidthFillFraction = 0.75; - layout.options.yTicks = [{v:10}, {v:20}, {v:30}, {v:40}]; - layout.evaluate(); - drawDemo($('test13'), layout, options); - - layout.options.xTicks = [ - {v:1, label:"one"}, - {v:2, label:"two"}, - {v:3, label:"three"}, - {v:4, label:"four"}, - {v:5, label:"five"}, - {v:6, label:"six"}]; - layout.evaluate(); - drawDemo($('test14'), layout, options); - - layout.addDataset("reversed", dataset_rev); - layout.options.yTicks = null; - layout.options.xTicks = null; - layout.options.xNumberOfTicks = 10; - layout.options.yNumberOfTicks = 5; - layout.options.xTicks = null; - layout.options.yTicks = null; - layout.evaluate(); - drawDemo($('test15'), layout, options); - -} - -function demo() { - demoWithStyle("pie"); -} - -addLoadEvent(demo); diff --git a/plotkit_v091/tests/dynamic.html b/plotkit_v091/tests/dynamic.html deleted file mode 100644 index 8a5ad0e..0000000 --- a/plotkit_v091/tests/dynamic.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - PlotKit : Basic Unit Tests - - - - - - - - - - -
-

PlotKit Dynamic Test

- -
-
- Chart Style: - - - Colors: - - - -
-
- -
- - - - - - - - - - -
XY
- -
-
-
-
- -
 
- - -
- diff --git a/plotkit_v091/tests/img/firefox.png b/plotkit_v091/tests/img/firefox.png deleted file mode 100644 index d7cc60339b72df47e71ce76a4bdfb1129bda8d80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1198 zcmXw(eNfW{7{|Z+?S+XyKtN?na46zSH+76CK|3}N74s!BO+8;A&7mD4Cw8GRe&9?o z#mFp34YAX-EF>)l>aod7;z{!b35tY)D6$QP%)KyvFU`FEc%JV)&)xIA&mZ4=4yG($ z6yX1gKY)P6$w@1GI_5=*MZPX`aPRwMR95oZY+!WAi{jmXm`D4Tf^_vVHSo)k+>v*_ z^v#i*lUFPQ_Cy2uI$)UdX&>;B0a4Dt?TsP%$CL9N^v{wU+svD z&&MWS@Rk`153PLg+nI3N{a-7zy(h+GG)mJiOf_aPCGxsYGPmtteKApa{pzi{O2saY z%A2UsN6)REyd`JX=Ca)C>$1pviF($YgtO+Ng0rU;&4>EQ!%Kf66O(ij%|zB{Je_GY zPM6;p?3MBBT2E1u`nUg#IdgnNy63jBw$d$koO|m1*aaTcsNsmnkk^7SY#~I>W`Iw_ z%byCa^9r8-QHHu}HE6Rs@n~om&%7+|$h9aoC4dhai(dBz&YDDQAqwM7YcIr^4t4gq z^`apr{zSrPS!q4l({@@ z4U>LUDE^N{5X^T(a|2yqcmgm(P7pMUKyfdQnF!R6Ujf?gfspUT6Cn?w{zAB&EIKU& z#)ooH$pzzxmp1)QhR@jSV1)qf;qbJ>g}kZ(+$3YcO!ozarZK`2u+uyYk1(LyTVR{Q z0CE8;?}_+CVV_kOR7-8-2Y6gXUG1wiBF%f_McNKM89pzUw3eMyu6%g@1G6Eow99TV zkf#is#;nyA-FUY@@h%fi{?koK@sfowTLj$>vjZ3!0!jKII4T?&aYEEi`W|zG`;ZlJ zAIc$B@O>MYkN503EMu8bBq#&Fc1a>famJL*bovo zo`s@cFc#x_?qJ)%c^rRh5aUv219k>`547NNqjMD@K3QBPY#Ops>&wg)PF+Fk{9<*= zk%*@~9GQ_?C1qLfoxvbU@lxATvMGU*wmlvzF=f(?=1cpmjV1bN5j;YifvBh`eR*+1 zNB8F?O&fOC#AN-bh#5S;Gj{N^>{!L67&J#r;73_0QD8MiUNdFIPTAf?dAtqVvdcS4 zz!Svg2bV@Cwbe(YPsr6ik-7RO>7E#5q-u$@twADfTeU{AvC^SzqF$}7WOVfnve|*3 z5-o|aFacv!X?zv7ic;crk)b8WW{f_yXXf2d?|P2i8LOnzJ-^p`t$tCrn<*;MVbEZSTJd+70Re diff --git a/plotkit_v091/tests/img/konqueror.png b/plotkit_v091/tests/img/konqueror.png deleted file mode 100644 index 637751f61157dbd76767fa7c3d930fedf74d5e23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7776 zcmX9@dpuMB|3ACCj48K`FkO|~W|jK5Z0m{&MTLsFOJdzbWSh$U?-=(L|^~pc*K1zf!Becm6S`i1%UNQRkBOdG5+-}E3P+3CIWI{*^za`*A$iixGUa`06c zdB)+$kq`crNcqU#nvY9^jo-#d$3QYeCIwd(LD0V~y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DPTac9vaW5^Bud2vmo zoqC3a*~uNbjOo7NPm~S==KVg#|7h-h;Hl{2zt6H+6_6)Wc;ze{$Ab>?Oe1#VA9$#z*q{2$i~@Ao0G_omk+M$@I%;iM$1Xy8{)B|I4}=3H6gYxkb(x#h z+q0kVw;a#o07cKVx07R5+?f?J) diff --git a/plotkit_v091/tests/img/mozilla.ico b/plotkit_v091/tests/img/mozilla.ico deleted file mode 100644 index d44438903b751f4732f5365783eb0229b0501f9a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmZvcze^lJ6vy9y;f`fV)+?@Ze|W?Y>#3{^YAe`S+YM=~Z34NW`?g{0%{Gm#-zuW37pASug&9hEW%I5<8GkmQYMp$Ony#e@#BjuEiFmE-c}V zrd^0bcjyk?p*!@r%%gjB&%~p9bOs6N0X?7xgn+KhmAQuGZ0RljmPD3CR#cKborS@| zU}3N@BqSIt3>F3pgM}es!eC*rFjyEY3<(_u3xkEh!eC*riUx;;!$uC(Q~?ymczRl( zp~pvt#bNF+awK)Iq%v^Rap7Qbu%xoU;oxv^I5->}sZ?+{7#s`^hFCfWhl9bv5b#p^ zR6=~ZlX)s{tPWIod!kaQ@%AuzOg#o3CXcu0rYDKV+vAsduroh z@GyAl5Vwu0q^Cz=q>tN34FY}vwg5-KFKun)paubs5IK0TwB0NUumo5F5COyV3cwOr z7zhdo0TzBV@~|fXmJsWaSmN6dcL5Csg+XCZ7!(GDA-zs81Q-+sg(1K|8XEC1C=3dN z!a!;oIt&Vf!k_>s{()r5LM6zN!!dVoXv!U9oUF=cIXF0wqoX4^K0cO{lM^{VKbNz! zGr7FHl<9OTS65eZb8{oNx3_YCe=mzaDxXeI`5%v|Zu}3#fqZEe^Tw%4_Mf9?On&&F zi}beZwkZd!>yBC3w&vx-=SH%5uQV+Iv+k~DdEGL9UJhoPqdUoZxoMl$(3xtsdZBU89L3N8 diff --git a/plotkit_v091/tests/img/msie.gif b/plotkit_v091/tests/img/msie.gif deleted file mode 100644 index 5101477f27162b48493c3d1438485878ff376305..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1556 zcmV+v2J87pNk%w1VK)Fb0M!5han0`)cgrP<;3Avhgxm91inkPOxz*zBC57H_uFw4Z z{33*|C8Xt6smUUd-;(F~O4RWgh|*KK@2$q%C2_Mgt=7fb=D5=0QhSbKc(26F)0)NJXTsx}w9<#L+6qmXroGjhy3yU{?X9h?LY~2T zqQxkJ!7H!pWo2aa_xLlq?gDjXnx7AP01GDlrFu3ms-ZT1FNWG<-xVBMA)+EV((myb(D7g^WoDA;C~fG!{C! z4J6Lb8Xg`M3@oNtwSmyt64$^2`tS7=;#0t><}6<@YVwn0Szii7MfX0G0P1A z1Rgvf0AO7^ckirOV=%x$02eJ{b(_%Q$r29bNC*@NfP@DU2Q?&A$e`qad3X*ODIr1} zh+6>#5+H$Vjs|uj$paHn=9-5-I4l zLqtD-u)_isvp@kV{lG&YfxX~B0xBHfh^H%7=iJA#|9=4;IWofqJi4rV~RB zxIn>~Vo)GPngIlG<&FrvDZrN~(v`vqlT}CohHCYMRhxhY+NPWfW*4UbH{7rtkUz8# z!g?(%z(AiS5e65Dgccg-rZwC^!DQX2A%ajANK%bpR>7AbrkidmKn)+baAGTJc;&-) zlA>y5P*OlmTIV`O)PN!n7O(-Y*JT&L4nh@i+6Fpz25Zj*C18vZ98mCHXT4RaoeL-& z5CaV~@FjH4*41D(&j3Bpfg(wiU@)^H7Oh~M0T^Hd1tElB1Icds=78Bxrwu>{iXovu z2nI*s0tN=;xTBRG*KGjGWWRbg+5r)ez*b18U_$`(w4j33IzDdbuQ~(%0pFKB+YWdj`kdU_8BNX0t>=D>tlm#{zKd^y)jt(8TMgt5hpdY&dNz;Q5 zP%wiNpsZE%yByDaM-UPuKnKC_!TFegf!I;NC;_Vw3PLb4<;Cd+3Y35dogo48-Q!|R zNMD;Um?9x4U;++vff)Lhs6^c&0UemYT-JjH6Z~&0_fmifW{`milz;~TAI^hN1!(&R_ G0suQ=y`x$H diff --git a/plotkit_v091/tests/img/opera.ico b/plotkit_v091/tests/img/opera.ico deleted file mode 100644 index 0e69e4ca29e257113a4b1209592e941ea9670f47..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3638 zcmeH}eNa?Y7{;HwsIV?y!m@jpW%<};R}|%IRWyiiqBarT70oX+)D)LNP{YxLaSdv_5P`@Fj zo|*Rpa`FzLU(`MX^Shx@??FV^O6at8$jkcz8|r>T(+qB3b|aamKa48(z~oz zI0-jG#%aThQpkGCRU!xujTB=hlgop|7n#n`mqI4OZv7qSIvz7|U5Y6SFI1|OeARM)3L9b|((Bn$Z#3k-(2R12H2cmMBLUMnEi z{tt$xTt-ZEDPWbxPK%ppsMwN+BtsSPAy~vyKH#Y4M@XfaZ z>fiYn))Gefr(ldc0-de_etxyIc0LNnjHVht2S&pI3?BLuQmubtO4&8McYxtY3&YGx zhGfg12nuX~UYkUBLNnbF$6!u6hwOqYs9b*?$4*?wnl~8IMqiy~`h>kvjQMOhrSlW)Q+b&{b{Y9*Q#fcYdE}?qOuc%&q9!r=1 z40};4Qc@1nocjGWk3@2 zp;lV+Gbnl|VNUTv49^;eG|PF69XT1+X}=>_Jrg0?8rY|`&|PHMoPAi5k02@9ar*TB^O1H{LEkIEIlU`WnanEKQi)V=;AN|*hO>`B*=WBHWs(&Lyg zpJ8qNb>x={D15pDE2}<2W=1pK*>eU7iES8`aS>IU1dPaSMoio}Bt7heW8Gh9KHQGh z)9q+%ynw}vzQ)KAhY;OwANof%AwBgZCQUkv-3{&d`qX8dIC%-1H@Bgw=^{SZcOIXA zasRIE_78iHg#W9vT~+9=-$qZh&zv=D&eL~Fq*9wTsBn64advj`yz<)}MEecOw3$^! zIVDz=F>>Xan;k?6Yt3r&m`4~Z)tM>-SJ&Jyh?L{JwQ5uPD8h`{pHU{fpr7nExUf%@ z*<{w_iJZJkR>a4S+aMWSm<#Ev;x*RCCCvFa4Al{FwOd`0=~^lK5-2H@HWDAwDVAzmu2Q=r}a_(*7imtdBnK0sSML zTp{xGx;Jm+GyjO#VF3?6<`xvi#Lb(!F!KwK8Jd_g)~!Tk(`nqaJ;r>)1}3IHB>j1i zXCZImGuF?)DW8Q77&2Hj#;wRHonL-4X1eIXDs#R|$}Cp#8S`&RXRJSc1N=165Td2; z`o-HY8B$Dq%8VzUoUPS7n^DpYGxlIM9ZIn+n^!GZdIwB1Kd3Q25t;hb+&fd(=I-W6 zHNe#vCkSn*5F7|&;Qg*5+0%)k9&IS)4q^)DpkERW2e3ry91c1>;Y1i1Dj+y+>jx`1 ep|iJDcnEFf9)dI3Q@9F0;Tpo|_eq6&RpCF}h-D-I diff --git a/plotkit_v091/tests/img/safari.gif b/plotkit_v091/tests/img/safari.gif deleted file mode 100644 index 677f4236fa960ba90a487cceb5c7a8c09a2dcf57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1166 zcmV;91abRENk%w1VH5xq0QUg^s;H-^sHld9hlhuWd3t&}JUq9zxT&eCuCA}3prMS6 zjsO4uW@c!@!oq-ofuW(Ju&}Y5oSd<-vPH%JMa2KBvAJ}i&R%0>fQz7GWMrtPr#Cq| zVus9!iHK;||9zXhetv&%Z*Zfdr1Cf}uBtP9vxxVf62sJ7|<+0@ZXPf*s)$32kB%W!=$H&SmE-xjj`Nqb^sl47Bir%K!`A&buy}iEW z<>j5w@_L)gl#`Q-+x!e^$f&5Ph>fyai^D#s=ZcY^h>41dii+gx|AB#moTRsJp3G8I zRJ63Ve0+S6kda=J#f*%Mp}y#^udb4hi=LgEpPieaprfj)s%mO!>+0!NzV4=^p^J-* zE@ZhkZKFc8^+dk^Pqg>E&DgWEw9d1%K4z7m;s1}g>r}$;-`?IqLqm~4RG+roZlvfi zh0dAL>@t$t)M#RZgN0GX`B2LLS;6y+)cgDR_}k&=X~6P4KS5Hn{a3yG?&#!1&i}E& z)RegE;^5z#y5qz6|9X0THM##*f4owf*;$s_UY*#=$jYZO2E||D&(RiQoT^kBq^~>p7w4JbAc~kB}Qxt&fnIIE&%V%Ew?~ zVXdvLO|k#({{Mr6gPf?vldg@8jFrIja=qy}IyyQ#Jfx(hWrMPzprDYCjbGgVi=WMih>3}biC4b!tE;O= zcfzKor@6VhA^8LW00031EC2ui02BZe000R800RgdIOk5L0|OH(OekT%pgIU3ESwl1 z!L~448enOVzyQSn2u#FS0ifQ4Jif;9L%8q&7(hU5!FdMm+nQnTvOe&=|2o$728p5ddHqlTJo59mRApQAX(lpFi^i z_E8{+UK)0BEbx+oNfI^=Ij-E$Cs09$DXn{Wo$k5DRD z%z!cSQmL7lTRv6^Orhb|mtL-3!BA4D6FgjMx=_)>K;XI-VC-DVHKdjeVW0v%GBoYe zpA!Q8u&D7O3Zg_yv@{x}$-^NPCE{Ic4q$))fpErf?3+MA6t{b`I4#&w0KvcqavY4X zgu*`N{(5>NcFK?vti gBtixSgp!0h7l@ - - - PlotKit: Image Labels Example - - - - - - - - - - -
-

Image Labels Example.

- -
- - -
- - -
- diff --git a/plotkit_v091/tests/labels.html b/plotkit_v091/tests/labels.html deleted file mode 100644 index fedaf6d..0000000 --- a/plotkit_v091/tests/labels.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - PlotKit: X Label Demo - - - - - - - - - - - - - - -
-

Label Demo

- -
-
- - -
- - -
- diff --git a/plotkit_v091/tests/prototype_compat.html b/plotkit_v091/tests/prototype_compat.html deleted file mode 100644 index 7ce3e5a..0000000 --- a/plotkit_v091/tests/prototype_compat.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - PlotKit: SweetCanvasRenderer Test - - - - - - - - - - - - - - -
-

Sweet Canvas Renderer Tests

- -
-
- - -
- diff --git a/plotkit_v091/tests/quickstart-easy.html b/plotkit_v091/tests/quickstart-easy.html deleted file mode 100644 index d4eab21..0000000 --- a/plotkit_v091/tests/quickstart-easy.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - PlotKit: Quickstart Demo - - - - - - - - - - -
-

Quickstart EasyPlot Demo

- -
- - -
- - -
- diff --git a/plotkit_v091/tests/quickstart-horiz.html b/plotkit_v091/tests/quickstart-horiz.html deleted file mode 100644 index 76d67b0..0000000 --- a/plotkit_v091/tests/quickstart-horiz.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - PlotKit: Quickstart Demo - - - - - - - - - - - -
-

Quickstart Demo

- -
-
- -
- - - - - - - - - - - - - - -
xy1y2
003
11020
2510
367
478
567
678
- - -
- - -
- diff --git a/plotkit_v091/tests/quickstart-neg.html b/plotkit_v091/tests/quickstart-neg.html deleted file mode 100644 index 18b65b1..0000000 --- a/plotkit_v091/tests/quickstart-neg.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - PlotKit: Quickstart Demo - - - - - - - - - - -
-

Quickstart EasyPlot Demo

- -
- - -
- - -
- diff --git a/plotkit_v091/tests/quickstart-svg.html b/plotkit_v091/tests/quickstart-svg.html deleted file mode 100644 index 1d742a0..0000000 --- a/plotkit_v091/tests/quickstart-svg.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - PlotKit: Quickstart SVG Demo - - - - - - - - - -
-

Quickstart SVG Demo

- -
-
-
- - - - - - - - - - - - - - -
xy1y2
003
11020
2510
367
478
567
678
- -

Note: With SVG, the most compatible way is NOT to put in SVG tags, but create the SVG element with Javascript. Therefore, instead of adding <svg> tag, we just have a <div> container and create the SVG element using SVGRenderer.SVG().

- - -
- - -
- diff --git a/plotkit_v091/tests/quickstart.html b/plotkit_v091/tests/quickstart.html deleted file mode 100644 index f0e6176..0000000 --- a/plotkit_v091/tests/quickstart.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - PlotKit: Quickstart Demo - - - - - - - - - - - - - - -
-

Quickstart Demo

- -
-
- -
- - - - - - - - - - - - - - -
xy1y2
003
11020
2510
367
478
567
678
- - -
- - -
- diff --git a/plotkit_v091/tests/sample.txt b/plotkit_v091/tests/sample.txt deleted file mode 100644 index 1703e81..0000000 --- a/plotkit_v091/tests/sample.txt +++ /dev/null @@ -1,6 +0,0 @@ -0,0 -1,1 -2,4 -3,8 -4,7 -5,8 diff --git a/plotkit_v091/tests/svg-sweet.html b/plotkit_v091/tests/svg-sweet.html deleted file mode 100644 index 46faa75..0000000 --- a/plotkit_v091/tests/svg-sweet.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -PlotKit: SVGRenderer Test - - - - - - - - - - - - - - - - - - -
-

SVG Renderer Tests

-
- -
- diff --git a/plotkit_v091/tests/svg-sweet.js b/plotkit_v091/tests/svg-sweet.js deleted file mode 100644 index f08f59e..0000000 --- a/plotkit_v091/tests/svg-sweet.js +++ /dev/null @@ -1,141 +0,0 @@ -/* actual tests */ - -var options = { - "axisLabelUseDiv": false -}; -MochiKit.Base.update(options, PlotKit.Base.officeBlue()); - - -function genericTest(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - var success = l.addDatasetFromTable("data" + num, $("test" + num)); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SweetSVGRenderer(c, l, options); - g.render(); -} - -function genericTestAndClear(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - l.addDatasetFromTable("data" + num, $("test" + num)); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SweetSVGRenderer(c, l, options); - g.render(); - g.clear(); -} - -function dualDataSet(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - l.addDatasetFromTable("data1." + num, $("test" + num), 0, 1); - l.addDatasetFromTable("data2." + num, $("test" + num), 0, 2); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SweetSVGRenderer(c, l, options); - g.render(); -} - - -/* create HTML for tests */ - -function makeTableRow(list) { - return TR({}, map(partial(TD, null), list)); -} - -function generateTestTable(num, data) { - var tableid = "test" + num; - var tablehead = THEAD(null, map(makeTableRow, [["x", "y"]])); - var tablebody = TBODY(null, map(makeTableRow, data)); - - var table = TABLE({"class": "data", "id": tableid}, [tablehead, tablebody]); - return table; -} - -function generateCanvas(num) { - var canvasid = "test" + num + "canvas"; - var canvasopts = { - "id": canvasid, - "width": 400, - "height": 200, - "version": "1.1", - "baseProfile": "full" - }; - - var canvas = PlotKit.SVGRenderer.SVG(canvasopts, ""); - return canvas -} - -function generateUnitTest(num, func, data, type, desc) { - var table = DIV({"class": "data"}, generateTestTable(num, data)); - var canvas = DIV({"class": "canvas"}, generateCanvas(num)); - var ending = DIV({"class":"ending"}, desc); - - addLoadEvent(partial(func, num, type)); - - return DIV({"class": "unit"}, [table, canvas, ending]); - return DIV({"class": "unit"}, [table, ending]); -} - -function generateTests() { - var tests = $('tests'); - - // datasets - var simpleData1 = [[0, 0], [1, 1], [2, 2], [3, 3]]; - var simpleData2 = [[1, 2], [2, 3], [3, 4], [4, 5]]; - var singleData = [[1, 1]]; - - var ninety = [[1, 9], [2, 1]]; - - var floatData1 = [[0, 0.5], [1, 0.4], [2, 0.3]]; - var missingData = [[0, 1], [1, 4], [3, 16], [5, 17]]; - - var dualData = [[0,0,0], [1,2,1], [2,4,4], [3,8,9], [4,16,16], [5,32,25], [6, 64, 36], [7, 128, 49]]; - - tests.appendChild(H2(null, "Simple Tests")); - - tests.appendChild(generateUnitTest(1, genericTest, simpleData1, "bar", "")); - tests.appendChild(generateUnitTest(2, genericTest, simpleData1, - "line", "")); - tests.appendChild(generateUnitTest(3, genericTest, simpleData2, - "pie", "")); - - tests.appendChild(H2(null, "One Value Set")); - - tests.appendChild(generateUnitTest(4, genericTest, singleData, - "bar", "")); - tests.appendChild(generateUnitTest(5, genericTest, singleData, - "line", "")); - tests.appendChild(generateUnitTest(6, genericTest, singleData, - "pie", "")); - - tests.appendChild(H2(null, "Float Values Set")); - tests.appendChild(generateUnitTest(7, genericTest, floatData1, - "bar", "")); - tests.appendChild(generateUnitTest(8, genericTest, floatData1, - "line", "")); - tests.appendChild(generateUnitTest(9, genericTest, floatData1, - "pie", "")); - - tests.appendChild(H2(null, "Dual Value Set")); - tests.appendChild(generateUnitTest(10, dualDataSet, dualData, - "bar", "")); - tests.appendChild(generateUnitTest(11, dualDataSet, dualData, - "line", "")); - - tests.appendChild(H2(null, "Drawing and Clearing")); - tests.appendChild(generateUnitTest(12, genericTest, floatData1, - "bar", "")); - tests.appendChild(generateUnitTest(13, genericTestAndClear, floatData1, - "bar", "")); - tests.appendChild(generateUnitTest(14, genericTest, floatData1, - "pie", "")); - tests.appendChild(generateUnitTest(15, genericTestAndClear, floatData1, - "pie", "")); - - tests.appendChild(H2(null, "Testing Circle Drawing")); - - tests.appendChild(generateUnitTest(16, genericTest, ninety, - "pie", "")); -} - -addLoadEvent(generateTests); diff --git a/plotkit_v091/tests/svg.html b/plotkit_v091/tests/svg.html deleted file mode 100644 index cc8ac7a..0000000 --- a/plotkit_v091/tests/svg.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - -PlotKit: SVGRenderer Test - - - - - - - - - - - - - - - -
-

SVG Renderer Tests

-
- -
- diff --git a/plotkit_v091/tests/svg.js b/plotkit_v091/tests/svg.js deleted file mode 100644 index 45dae8b..0000000 --- a/plotkit_v091/tests/svg.js +++ /dev/null @@ -1,147 +0,0 @@ -/* actual tests */ - -var options = { - "axisLineWidth": 2.0, - "axisLabelColor": Color.grayColor(), - "axisLineColor": Color.blackColor(), - "padding": {top: 5, bottom: 20, left: 40, right: 10}, - "backgroundColor": Color.whiteColor(), - "strokeColor": null, - "axisLabelUseDiv": false -}; - -function genericTest(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - var success = l.addDatasetFromTable("data" + num, $("test" + num)); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SVGRenderer(c, l, options); - g.render(); -} - -function genericTestAndClear(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - l.addDatasetFromTable("data" + num, $("test" + num)); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SVGRenderer(c, l, {}); - g.render(); - g.clear(); -} - -function dualDataSet(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - l.addDatasetFromTable("data1." + num, $("test" + num), 0, 1); - l.addDatasetFromTable("data2." + num, $("test" + num), 0, 2); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SVGRenderer(c, l, options); - g.render(); -} - - -/* create HTML for tests */ - -function makeTableRow(list) { - return TR({}, map(partial(TD, null), list)); -} - -function generateTestTable(num, data) { - var tableid = "test" + num; - var tablehead = THEAD(null, map(makeTableRow, [["x", "y"]])); - var tablebody = TBODY(null, map(makeTableRow, data)); - - var table = TABLE({"class": "data", "id": tableid}, [tablehead, tablebody]); - return table; -} - -function generateCanvas(num) { - var canvasid = "test" + num + "canvas"; - var canvasopts = { - "id": canvasid, - "width": 400, - "height": 200, - "version": "1.1", - "baseProfile": "full" - }; - - var canvas = PlotKit.SVGRenderer.SVG(canvasopts, ""); - return canvas -} - -function generateUnitTest(num, func, data, type, desc) { - var table = DIV({"class": "data"}, generateTestTable(num, data)); - var canvas = DIV({"class": "canvas"}, generateCanvas(num)); - var ending = DIV({"class":"ending"}, desc); - - addLoadEvent(partial(func, num, type)); - - return DIV({"class": "unit"}, [table, canvas, ending]); - return DIV({"class": "unit"}, [table, ending]); -} - -function generateTests() { - var tests = $('tests'); - - // datasets - var simpleData1 = [[0, 0], [1, 1], [2, 2], [3, 3]]; - var simpleData2 = [[1, 2], [2, 3], [3, 4], [4, 5]]; - var singleData = [[1, 1]]; - - var ninety = [[1, 9], [2, 1]]; - - var floatData1 = [[0, 0.5], [1, 0.4], [2, 0.3]]; - var missingData = [[0, 1], [1, 4], [3, 16], [5, 17]]; - - var dualData = [[0,0,0], [1,2,1], [2,4,4], [3,8,9], [4,16,16], [5,32,25], [6, 64, 36], [7, 128, 49]]; - - tests.appendChild(H2(null, "Simple Tests")); - - tests.appendChild(generateUnitTest(1, genericTest, simpleData1, "bar", "")); - - tests.appendChild(generateUnitTest(2, genericTest, simpleData1, - "line", "")); - tests.appendChild(generateUnitTest(3, genericTest, simpleData2, - "pie", "")); - - tests.appendChild(H2(null, "One Value Set")); - - tests.appendChild(generateUnitTest(4, genericTest, singleData, - "bar", "")); - tests.appendChild(generateUnitTest(5, genericTest, singleData, - "line", "")); - tests.appendChild(generateUnitTest(6, genericTest, singleData, - "pie", "")); - - tests.appendChild(H2(null, "Float Values Set")); - tests.appendChild(generateUnitTest(7, genericTest, floatData1, - "bar", "")); - tests.appendChild(generateUnitTest(8, genericTest, floatData1, - "line", "")); - tests.appendChild(generateUnitTest(9, genericTest, floatData1, - "pie", "")); - - tests.appendChild(H2(null, "Dual Value Set")); - tests.appendChild(generateUnitTest(10, dualDataSet, dualData, - "bar", "")); - tests.appendChild(generateUnitTest(11, dualDataSet, dualData, - "line", "")); - - tests.appendChild(H2(null, "Drawing and Clearing")); - tests.appendChild(generateUnitTest(12, genericTest, floatData1, - "bar", "")); - tests.appendChild(generateUnitTest(13, genericTestAndClear, floatData1, - "bar", "")); - tests.appendChild(generateUnitTest(14, genericTest, floatData1, - "pie", "")); - tests.appendChild(generateUnitTest(15, genericTestAndClear, floatData1, - "pie", "")); - - tests.appendChild(H2(null, "Testing Circle Drawing")); - - tests.appendChild(generateUnitTest(16, genericTest, ninety, - "pie", "")); - -} - -addLoadEvent(generateTests); diff --git a/plotkit_v091/tests/sweet.html b/plotkit_v091/tests/sweet.html deleted file mode 100644 index 9e7685b..0000000 --- a/plotkit_v091/tests/sweet.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - PlotKit: SweetCanvasRenderer Test - - - - - - - - - - -
-

Sweet Canvas Renderer Tests

- -
-
- - -
- diff --git a/plotkit_v091/tests/sweet.js b/plotkit_v091/tests/sweet.js deleted file mode 100644 index 44e174c..0000000 --- a/plotkit_v091/tests/sweet.js +++ /dev/null @@ -1,89 +0,0 @@ -/* actual tests */ - -var opts = { - "enableEvents": false -}; - -function genericTest(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - var success = l.addDatasetFromTable("data" + num, $("test" + num)); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SweetCanvasRenderer(c, l, opts); - g.render(); -} - -function dualDataSet(num, plotStyle) { - var l = new PlotKit.Layout(plotStyle, {}); - l.addDatasetFromTable("data1." + num, $("test" + num), 0, 1); - l.addDatasetFromTable("data2." + num, $("test" + num), 0, 2); - l.evaluate(); - var c = $("test" + num + "canvas"); - var g = new PlotKit.SweetCanvasRenderer(c, l, opts); - g.render(); -} - - -/* create HTML for tests */ - -function makeTableRow(list) { - return TR({}, map(partial(TD, null), list)); -} - -function generateTestTable(num, data) { - var tableid = "test" + num; - var tablehead = THEAD(null, map(makeTableRow, [["x", "y"]])); - var tablebody = TBODY(null, map(makeTableRow, data)); - - var table = TABLE({"class": "data", "id": tableid}, [tablehead, tablebody]); - return table; -} - -function generateCanvas(num) { - var canvasid = "test" + num + "canvas"; - var canvas = CANVAS({"id":canvasid, "width": "400", "height": "200"}, ""); - return canvas -} - -function generateUnitTest(num, func, data, type, desc) { - var table = DIV({"class": "data"}, generateTestTable(num, data)); - var canvas = DIV({"class": "canvas"}, generateCanvas(num)); - var ending = DIV({"class":"ending"}, desc); - - addLoadEvent(partial(func, num, type)); - - return DIV({"class": "unit"}, [table, canvas, ending]); - -} - -function generateTests() { - var tests = $('tests'); - - // datasets - var simpleData1 = [[0, 0], [1, 1], [2, 2], [3, 3]]; - var simpleData2 = [[1, 2], [2, 3], [3, 4], [4, 5]]; - var singleData = [[1, 1]]; - - var floatData1 = [[0, 0.5], [1, 0.4], [2, 0.3]]; - var missingData = [[0, 1], [1, 4], [3, 16], [5, 17]]; - - var dualData = [[0,0,0], [1,2,1], [2,4,4], [3,8,9], [4,16,16], [5,32,25], [6, 64, 36], [7, 128, 49]]; - - tests.appendChild(H2(null, "Simple Tests")); - - tests.appendChild(generateUnitTest(1, genericTest, simpleData1, - "bar", "")); - tests.appendChild(generateUnitTest(2, dualDataSet, dualData, - "bar", "")); - - tests.appendChild(generateUnitTest(3, genericTest, simpleData1, - "line", "")); - tests.appendChild(generateUnitTest(4, dualDataSet, dualData, - "line", "")); - - tests.appendChild(generateUnitTest(5, genericTest, simpleData1, - "pie", "")); - -} - -addLoadEvent(generateTests); diff --git a/plotkit_v091/tests/tests.css b/plotkit_v091/tests/tests.css deleted file mode 100644 index 2816106..0000000 --- a/plotkit_v091/tests/tests.css +++ /dev/null @@ -1,66 +0,0 @@ -table#dynamicTable { - margin: 10px auto 10px auto; -} - -table.data td { - margin: 5px; - padding: 5px; - width: 50px; -} - -table.data thead td { - background-color: #eee; -} - -table.data thead th { - background-color: #eee; - border-bottom: 1px solid #ddd; - padding: 5px; - text-align: left; -} - -table.data tbody td { - padding: 5px; - vertical-align: top; - text-align: left; - border-bottom: 1px solid #eee; -} - -table.data { - width: 200px; -} - -.center { - margin-left: auto; - margin-right: auto; -} - -h3 { - font-size: large; - color: #666; - background-color: #eee; - border-bottom: 1px solid #ddd; - padding: 3px; -} - -h4 { - font-size: medium; - margin: 5px; -} - -div.data, div.canvas { - float: left; - margin: 5px; -} - -div.ending { - clear: both; - margin: 10px; -} - -div.unit { - border: 1px solid #eee; - margin: 10px; - padding: 10px; -} - diff --git a/plotkit_v091/tests/testsvg.html b/plotkit_v091/tests/testsvg.html deleted file mode 100644 index 008d669..0000000 --- a/plotkit_v091/tests/testsvg.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - SVG Test - - - - - - - - - - - diff --git a/plotkit_v091/tests/testsvg.js b/plotkit_v091/tests/testsvg.js deleted file mode 100644 index 3bcd3ef..0000000 --- a/plotkit_v091/tests/testsvg.js +++ /dev/null @@ -1,31 +0,0 @@ -function testsvg() { - var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1); - var ieVersion = navigator.appVersion.match(/MSIE (\d\.\d)/); - var safariVersion = navigator.userAgent.match(/AppleWebKit\/(\d+)/); - var operaVersion = navigator.userAgent.match(/Opera\/(\d*\.\d*)/); - var mozillaVersion = navigator.userAgent.match(/rv:(\d*\.\d*).*Gecko/); - - - if (ieVersion && (ieVersion[1] >= 6) && !isOpera) { - var dummysvg = document.createElement(''); - try { - dummysvg.getSVGDocument(); - dummysvg = null; - return true; - } - catch (e) { - return false; - } - } - - if (safariVersion && (safariVersion[1] > 419)) - return true; - - if (operaVersion && (operaVersion[1] > 8.9)) - return true - - if (mozillaVersion && (mozillaVersion > 1.7)) - return true; - - return false; -} \ No newline at end of file -- 2.7.4