Changeset 33
- Timestamp:
- 04/06/06 20:17:37 (2 years ago)
- Files:
-
- plotkit/trunk/PlotKit/Base.js (modified) (2 diffs)
- plotkit/trunk/PlotKit/EasyPlot.js (modified) (3 diffs)
- plotkit/trunk/PlotKit/PlotKit_Packed.js (modified) (4 diffs)
- plotkit/trunk/PlotKit/SweetCanvas.js (modified) (2 diffs)
- plotkit/trunk/doc/PlotKit.Base.txt (modified) (1 diff)
- plotkit/trunk/tests/basic.js (modified) (2 diffs)
- plotkit/trunk/tests/sweet.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plotkit/trunk/PlotKit/Base.js
r32 r33 89 89 // Detect whether we are using prototype.js 90 90 PlotKit.Base.usingPrototype = function() { 91 return (typeof(Object.extend) == 'function'); 91 try { 92 return (typeof(Object.extend) == 'function'); 93 } 94 catch (e) { 95 return false; 96 } 92 97 } 93 98 … … 275 280 } 276 281 else { 277 return MochiKit.Base. items(lst);282 return MochiKit.Base.keys(lst); 278 283 } 279 284 }; plotkit/trunk/PlotKit/EasyPlot.js
r32 r33 78 78 throw "Passed datasources are not Array like"; 79 79 } 80 80 81 81 // setup canvas to render 82 82 … … 98 98 } 99 99 100 if ((this.deferredCount == 0) && ( this.layout.datasets.length > 0)) {100 if ((this.deferredCount == 0) && (PlotKit.Base.keys(this.layout.datasets).length > 0)) { 101 101 this.layout.evaluate(); 102 102 this.renderer.clear(); … … 121 121 this.deferredCount--; 122 122 123 if ((this.deferredCount == 0) && ( this.layout.datasets.length > 0)) {123 if ((this.deferredCount == 0) && (PlotKit.Base.keys(this.layout.datasets).length > 0)) { 124 124 this.layout.evaluate(); 125 125 this.renderer.clear(); plotkit/trunk/PlotKit/PlotKit_Packed.js
r32 r33 50 50 }; 51 51 PlotKit.Base.usingPrototype=function(){ 52 try{ 52 53 return (typeof (Object.extend)=="function"); 54 } 55 catch(e){ 56 return false; 57 } 53 58 }; 54 59 MochiKit.Base.update(PlotKit.Base,{roundInterval:function(_1,_2,_3){ … … 194 199 return _39; 195 200 }else{ 196 return MochiKit.Base. items(lst);201 return MochiKit.Base.keys(lst); 197 202 } 198 203 }; … … 1722 1727 this._renderBarChartWrap(this.layout.bars,bind(_338,this)); 1723 1728 }; 1724 PlotKit. CanvasRenderer.prototype._renderLineChart=function(){1729 PlotKit.SweetCanvasRenderer.prototype._renderLineChart=function(){ 1725 1730 var _340=this.element.getContext("2d"); 1726 1731 var _341=this.options.colorScheme.length; … … 1775 1780 } 1776 1781 }; 1777 PlotKit. CanvasRenderer.prototype._renderPieChart=function(){1782 PlotKit.SweetCanvasRenderer.prototype._renderPieChart=function(){ 1778 1783 var _351=this.element.getContext("2d"); 1779 1784 var _352=this.options.colorScheme.length; plotkit/trunk/PlotKit/SweetCanvas.js
r32 r33 131 131 }; 132 132 133 PlotKit. CanvasRenderer.prototype._renderLineChart = function() {133 PlotKit.SweetCanvasRenderer.prototype._renderLineChart = function() { 134 134 var context = this.element.getContext("2d"); 135 135 var colorCount = this.options.colorScheme.length; … … 197 197 }; 198 198 199 PlotKit. CanvasRenderer.prototype._renderPieChart = function() {199 PlotKit.SweetCanvasRenderer.prototype._renderPieChart = function() { 200 200 var context = this.element.getContext("2d"); 201 201 plotkit/trunk/doc/PlotKit.Base.txt
r32 r33 46 46 Acts like the UNIX uniq, takes a sorted array and returns a new array that only contains uniq elements. 47 47 48 * ``isFuncLike(obj)`` 48 * ``isFuncLike(obj)`` (PlotKit 0.9+) 49 49 50 50 Returns true if it is of type ``function``. 51 51 52 * ``usingPrototype()`` 52 * ``usingPrototype()`` (PlotKit 0.9+) 53 53 54 54 Checks whether the javascript runtime is polluted by prototype.js 55 55 56 * ``items(lst)`` 56 * ``items(lst)`` (PlotKit 0.9+) 57 57 58 58 A version of ``MochiKit.Base.items()`` that is aware of prototype.js 59 59 60 * ``keys(lst)`` 60 * ``keys(lst)`` (PlotKit 0.9+) 61 61 62 62 A version of ``MochiKit.Base.keys()`` that is aware of prototype.js 63 63 64 * ``map(fn, lst)`` 64 * ``map(fn, lst)`` (PlotKit 0.9+) 65 65 66 66 A version of ``MochiKit.Base.map()`` that is aware of prototype.js plotkit/trunk/tests/basic.js
r32 r33 123 123 tests.appendChild(generateUnitTest(11, dualDataSet, dualData, 124 124 "line", "")); 125 /* 125 126 126 tests.appendChild(H2(null, "Drawing and Clearing")); 127 127 tests.appendChild(generateUnitTest(12, genericTest, floatData1, … … 138 138 tests.appendChild(generateUnitTest(16, genericTest, ninety, 139 139 "pie", "")); 140 */141 140 142 141 } plotkit/trunk/tests/sweet.html
r18 r33 9 9 <script src="/js/mochi/MochiKit.js" type="text/javascript"></script> 10 10 <script src="/js/plotkit-svn/excanvas.js" type="text/javascript"></script> 11 <script src="/js/plotkit-svn/Base.js" type="text/javascript"></script> 12 <script src="/js/plotkit-svn/Layout.js" type="text/javascript"></script> 13 <script src="/js/plotkit-svn/Canvas.js" type="text/javascript"></script> 14 <script src="/js/plotkit-svn/SweetCanvas.js" type="text/javascript"></script> 11 <script src="/js/plotkit-svn/PlotKit_Packed.js" type="text/javascript"></script> 15 12 <script src="/js/plotkit-tests/sweet.js" type="text/javascript"></script> 16 13 </head>




Atom Feed for the Blog Entries