Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1034)

Side by Side Diff: third_party/flot/jquery.flot.categories.min.js

Issue 1235773002: Add jquery and flot to catapult/third_party. (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: Rebased Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/flot/jquery.flot.categories.js ('k') | third_party/flot/jquery.flot.crosshair.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Javascript plotting library for jQuery, version 0.8.3.
2
3 Copyright (c) 2007-2014 IOLA and Ole Laursen.
4 Licensed under the MIT license.
5
6 */
7 (function($){var options={xaxis:{categories:null},yaxis:{categories:null}};funct ion processRawData(plot,series,data,datapoints){var xCategories=series.xaxis.opt ions.mode=="categories",yCategories=series.yaxis.options.mode=="categories";if(! (xCategories||yCategories))return;var format=datapoints.format;if(!format){var s =series;format=[];format.push({x:true,number:true,required:true});format.push({y :true,number:true,required:true});if(s.bars.show||s.lines.show&&s.lines.fill){va r autoscale=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);format.push ({y:true,number:true,required:false,defaultValue:0,autoscale:autoscale});if(s.ba rs.horizontal){delete format[format.length-1].y;format[format.length-1].x=true}} datapoints.format=format}for(var m=0;m<format.length;++m){if(format[m].x&&xCateg ories)format[m].number=false;if(format[m].y&&yCategories)format[m].number=false} }function getNextIndex(categories){var index=-1;for(var v in categories)if(categ ories[v]>index)index=categories[v];return index+1}function categoriesTickGenerat or(axis){var res=[];for(var label in axis.categories){var v=axis.categories[labe l];if(v>=axis.min&&v<=axis.max)res.push([v,label])}res.sort(function(a,b){return a[0]-b[0]});return res}function setupCategoriesForAxis(series,axis,datapoints){ if(series[axis].options.mode!="categories")return;if(!series[axis].categories){v ar c={},o=series[axis].options.categories||{};if($.isArray(o)){for(var i=0;i<o.l ength;++i)c[o[i]]=i}else{for(var v in o)c[v]=o[v]}series[axis].categories=c}if(! series[axis].options.ticks)series[axis].options.ticks=categoriesTickGenerator;tr ansformPointsOnAxis(datapoints,axis,series[axis].categories)}function transformP ointsOnAxis(datapoints,axis,categories){var points=datapoints.points,ps=datapoin ts.pointsize,format=datapoints.format,formatColumn=axis.charAt(0),index=getNextI ndex(categories);for(var i=0;i<points.length;i+=ps){if(points[i]==null)continue; for(var m=0;m<ps;++m){var val=points[i+m];if(val==null||!format[m][formatColumn] )continue;if(!(val in categories)){categories[val]=index;++index}points[i+m]=cat egories[val]}}}function processDatapoints(plot,series,datapoints){setupCategorie sForAxis(series,"xaxis",datapoints);setupCategoriesForAxis(series,"yaxis",datapo ints)}function init(plot){plot.hooks.processRawData.push(processRawData);plot.ho oks.processDatapoints.push(processDatapoints)}$.plot.plugins.push({init:init,opt ions:options,name:"categories",version:"1.0"})})(jQuery);
OLDNEW
« no previous file with comments | « third_party/flot/jquery.flot.categories.js ('k') | third_party/flot/jquery.flot.crosshair.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698