32 lines
35 KiB
JavaScript
32 lines
35 KiB
JavaScript
!function(){return function(e,o,t){if("undefined"==typeof Bokeh)throw new Error("Cannot find Bokeh. You have to load it prior to loading plugins.");var l=Bokeh._;for(var r in e)Bokeh.require.modules[r]=e[r];for(var s=0;s<t.length;s++){var n=Bokeh.require(t[s]);l.isObject(n.models)&&Bokeh.Models.register_locations(n.models),l.extend(Bokeh,l.omit(n,"models"))}}({api:[function(e,o,t){var l;l=e("underscore"),o.exports={LinAlg:e("./api/linalg"),Charts:e("./api/charts"),Plotting:e("./api/plotting"),Document:e("./document").Document,sprintf:e("sprintf")},l.extend(o.exports,e("./api/models"))},{"./api/charts":"api/charts","./api/linalg":"api/linalg","./api/models":"api/models","./api/plotting":"api/plotting","./document":"document",sprintf:"sprintf",underscore:"underscore"}],"api/charts":[function(e,o,t){var l,r,s,n,a,i,d,c,u,m,_,p,h,g;s=e("underscore"),l=e("jquery"),h=e("sprintf"),r=e("../document").Document,i=e("../embed"),u=e("./models"),_=e("../palettes/palettes"),g=function(e){return e.reduce(function(e){return function(e,o){return e+o}}(this),0)},a=function(e){var o;return o=[],e.reduce(function(e,t,l){return o[l]=e+t},0),o},m=function(e){return h("#%06x",e)},d=function(e){var o,t,l;return l=parseInt(e.substr(1,2),16),t=parseInt(e.substr(3,2),16),o=parseInt(e.substr(5,2),16),[l,t,o]},c=function(e){var o,t,l,r;return r=e[0],t=e[1],o=e[2],l=1-(.299*r+.587*t+.114*o)/255,l>=.6},p=function(e,o){var t,l,r,n,i,p,f,y,x,k,w,v,b,M,T,S,z,R,A,B,C,D,P,L,q,j,G,F,I,O,U,W,H,E,Z,Q,N,$,X,Y,K,V,J,ee,oe;for(null==o&&(o={}),z=[],J=[],M=S=0,L=Math.min(e.labels.length,e.values.length);0<=L?S<L:S>L;M=0<=L?++S:--S)e.values[M]>0&&(z.push(e.labels[M]),J.push(e.values[M]));return H=null!=(q=o.start_angle)?q:0,p=null!=(j=o.end_angle)?j:H+2*Math.PI,t=Math.abs(p-H),Y=function(e){return t*e},V=g(J),R=J.map(function(e){return e/V}),r=a(R),f=r.map(function(e){return H+Y(e)}),E=[H].concat(f.slice(0,-1)),w=s.zip(E,f).map(function(e){return function(e){var o,t;return t=e[0],o=e[1],(t+o)/2}}(this)),null==o.center?(n=0,i=0):s.isArray(o.center)?(n=o.center[0],i=o.center[1]):(n=o.center.x,i=o.center.y),T=null!=(G=o.inner_radius)?G:0,A=null!=(F=o.outer_radius)?F:1,B=s.isArray(o.palette)?o.palette:_[null!=(I=o.palette)?I:"Spectral11"].map(m),l=function(){var e,o,t;for(t=[],M=e=0,o=R.length;0<=o?e<o:e>o;M=0<=o?++e:--e)t.push(B[M%B.length]);return t}(),Q=l.map(function(e){return c(d(e))?"white":"black"}),X=function(e,o){return[e*Math.cos(o),e*Math.sin(o)]},v=(T+A)/2,O=s.unzip(w.map(function(e){return function(e){return X(v,e)}}(this))),N=O[0],$=O[1],N=N.map(function(e){return e+n}),$=$.map(function(e){return e+i}),Z=w.map(function(e){return e>=Math.PI/2&&e<=3*Math.PI/2?e+Math.PI:e}),W=new Bokeh.ColumnDataSource({data:{labels:z,values:J,percentages:R.map(function(e){return function(e){return h("%.2f%%",100*e)}}(this)),start_angles:E,end_angles:f,text_angles:Z,colors:l,text_colors:Q,text_cx:N,text_cy:$}}),y=new u.AnnularWedge({x:n,y:i,inner_radius:T,outer_radius:A,start_angle:{field:"start_angles"},end_angle:{field:"end_angles"},line_color:null,line_width:1,fill_color:{field:"colors"}}),k=new u.AnnularWedge({x:n,y:i,inner_radius:T,outer_radius:A,start_angle:{field:"start_angles"},end_angle:{field:"end_angles"},line_color:null,line_width:1,fill_color:{field:"colors"},fill_alpha:.8}),D=new u.GlyphRenderer({data_source:W,glyph:y,hover_glyph:k}),x=new u.Text({x:{field:"text_cx"},y:{field:"text_cy"},text:{field:null!=(U=o.slice_labels)?U:"labels"},angle:{field:"text_angles"},text_align:"center",text_baseline:"middle",text_color:{field:"text_colors"},text_font_size:"9pt"}),P=new u.GlyphRenderer({data_source:W,glyph:x}),ee=new u.DataRange1d({renderers:[D],range_padding:.2}),oe=new u.DataRange1d({renderers:[D],range_padding:.2}),C=new u.Plot({x_range:ee,y_range:oe}),null!=o.width&&(C.plot_width=o.width),null!=o.height&&(C.plot_height=o.height),C.add_renderers(D,P),K="<div>@labels</div><div><b>@values</b> (@percentages)</div>",b=new u.HoverTool({renderers:[D],tooltips:K}),C.add_tools(b),C},n=function(e,o){var t,l,r,n,a,i,d,c,p,h,g,f,y,x,k,w,v,b,M,T,S,z,R,A,B,C,D,P,L,q,j,G,F,I,O,U,W,H,E,Z,Q,N,$,X,Y,K,V,J,ee,oe,te,le,re,se;for(null==o&&(o={}),n=e[0],$=e.slice(1),a=function(){var e,o,t;for(t=[],e=0,o=n.length;e<o;e++)z=n[e],t.push([]);return t}(),g=0,k=$.length;g<k;g++)for(N=$[g],p=T=0,w=N.length;T<w;p=++T)ee=N[p],a[p].push(ee);if(y=s.map(a[0],function(e){return e.toString()}),a=a.slice(1),re=new u.CategoricalAxis,se=new u.FactorRange({factors:y}),le=null!=o.axis_number_format?new u.NumeralTickFormatter({format:o.axis_number_format}):new u.BasicTickFormatter,oe=new u.LinearAxis({formatter:le}),te=new u.DataRange1d({start:0}),C=s.isArray(o.palette)?o.palette:_[null!=(j=o.palette)?j:"Spectral11"].map(m),K=null!=(G=o.stacked)&&G,A=null!=(F=o.orientation)?F:"horizontal",Z=[],K)for(x=[],Q=[],p=S=0,I=a.length;0<=I?S<I:S>I;p=0<=I?++S:--S){for(r=[],J=[],h=R=0,v=y.length;R<v;h=++R)f=y[h],0===p?(x.push(0),Q.push(a[p][h])):(x[h]+=a[p-1][h],Q[h]+=a[p][h]),r.push(f+":0"),J.push(f+":1");Y=new Bokeh.ColumnDataSource({data:{left:s.clone(x),right:s.clone(Q),top:J,bottom:r,labels:y,values:a[p],columns:function(){var e,o,t,l;for(t=a[p],l=[],o=0,e=t.length;o<e;o++)ee=t[o],l.push(n[p+1]);return l}()}}),d=new u.Quad({left:{field:"left"},bottom:{field:"bottom"},right:{field:"right"},top:{field:"top"},line_color:null,fill_color:C[p%C.length]}),q=new u.GlyphRenderer({data_source:Y,glyph:d}),Z.push(q)}else for(i=1/a.length,p=B=0,O=a.length;0<=O?B<O:B>O;p=0<=O?++B:--B){for(x=[],Q=[],r=[],J=[],h=P=0,b=y.length;P<b;h=++P)f=y[h],x.push(0),Q.push(a[p][h]),r.push(f+":"+p*i),J.push(f+":"+(p+1)*i);Y=new Bokeh.ColumnDataSource({data:{left:x,right:Q,top:J,bottom:r,labels:y,values:a[p],columns:function(){var e,o,t,l;for(o=a[p],t=[],l=0,e=o.length;l<e;l++)ee=o[l],t.push(n[p+1]);return t}()}}),d=new u.Quad({left:{field:"left"},bottom:{field:"bottom"},right:{field:"right"},top:{field:"top"},line_color:null,fill_color:C[p%C.length]}),q=new u.GlyphRenderer({data_source:Y,glyph:d}),Z.push(q)}if("vertical"===A)for(U=[se,te],te=U[0],se=U[1],W=[re,oe],oe=W[0],re=W[1],X=0,M=Z.length;X<M;X++)L=Z[X],e=L.data_source.data,H=[e.bottom,e.left],e.left=H[0],e.bottom=H[1],E=[e.top,e.right],e.right=E[0],e.top=E[1];return D=new u.Plot({x_range:te,y_range:se}),null!=o.width&&(D.plot_width=o.width),null!=o.height&&(D.plot_height=o.height),D.add_renderers.apply(D,Z),D.add_layout(re,"left"),D.add_layout(oe,"below"),V="<div>@labels</div><div>@columns: <b>@values</b></div>","horizontal"===A?(t="right_center",l="horizontal"):(t="top_center",l="vertical"),c=new u.HoverTool({renderers:Z,tooltips:V,point_policy:"snap_to_data",anchor:t,attachment:l,show_arrow:o.show_arrow}),D.add_tools(c),D},o.exports={pie:p,bar:n}},{"../document":"document","../embed":"embed","../palettes/palettes":"palettes/palettes","./models":"api/models",jquery:"jquery",sprintf:"sprintf",underscore:"underscore"}],"api/linalg":[function(e,o,t){"use strict";function l(e){for(var o=e.length,t=e[0].length,l=[],r=0;r<t;r++){l[r]=[];for(var s=0;s<o;s++)l[r][s]=e[s][r]}return l}function r(e,o,t){void 0===t&&(t=100);for(var l=(o-e)/(t-1),r=new Array(t),s=0;s<t;s++)r[s]=e+l*s;return r}function s(e,o,t){void 0===t&&(t=1);for(var l=Math.ceil((o-e)/t),r=new Array(l),s=0;s<l;s++)r[s]=e+t*s;return r}t.transpose=l,t.linspace=r,t.arange=s},{}],"api/models":[function(e,o,t){o.exports={Arrow:e("../models/annotations/arrow").Model,OpenHead:e("../models/annotations/arrow_head").OpenHead,NormalHead:e("../models/annotations/arrow_head").NormalHead,VeeHead:e("../models/annotations/arrow_head").VeeHead,BoxAnnotation:e("../models/annotations/box_annotation").Model,ColorBar:e("../models/annotations/color_bar").Model,Label:e("../models/annotations/label").Model,LabelSet:e("../models/annotations/label_set").Model,Legend:e("../models/annotations/legend").Model,PolyAnnotation:e("../models/annotations/poly_annotation").Model,Span:e("../models/annotations/span").Model,Title:e("../models/annotations/title").Model,Tooltip:e("../models/annotations/tooltip").Model,Axis:e("../models/axes/axis").Model,ContinuousAxis:e("../models/axes/continuous_axis").Model,LinearAxis:e("../models/axes/linear_axis").Model,LogAxis:e("../models/axes/log_axis").Model,CategoricalAxis:e("../models/axes/categorical_axis").Model,DatetimeAxis:e("../models/axes/datetime_axis").Model,OpenURL:e("../models/callbacks/open_url").Model,CustomJS:e("../models/callbacks/customjs").Model,TickFormatter:e("../models/formatters/tick_formatter").Model,BasicTickFormatter:e("../models/formatters/basic_tick_formatter").Model,LogTickFormatter:e("../models/formatters/basic_tick_formatter").Model,CategoricalTickFormatter:e("../models/formatters/categorical_tick_formatter").Model,DatetimeTickFormatter:e("../models/formatters/datetime_tick_formatter").Model,FuncTickFormatter:e("../models/formatters/func_tick_formatter").Model,NumeralTickFormatter:e("../models/formatters/numeral_tick_formatter").Model,PrintfTickFormatter:e("../models/formatters/printf_tick_formatter").Model,Glyph:e("../models/glyphs/glyph").Model,AnnularWedge:e("../models/glyphs/annular_wedge").Model,Annulus:e("../models/glyphs/annulus").Model,Arc:e("../models/glyphs/arc").Model,Bezier:e("../models/glyphs/bezier").Model,Circle:e("../models/glyphs/circle").Model,Ellipse:e("../models/glyphs/ellipse").Model,ImageRGBA:e("../models/glyphs/image_rgba").Model,Image:e("../models/glyphs/image").Model,ImageURL:e("../models/glyphs/image_url").Model,Line:e("../models/glyphs/line").Model,MultiLine:e("../models/glyphs/multi_line").Model,Oval:e("../models/glyphs/oval").Model,Patch:e("../models/glyphs/patch").Model,Patches:e("../models/glyphs/patches").Model,Quad:e("../models/glyphs/quad").Model,Quadratic:e("../models/glyphs/quadratic").Model,Ray:e("../models/glyphs/ray").Model,Rect:e("../models/glyphs/rect").Model,Segment:e("../models/glyphs/segment").Model,Text:e("../models/glyphs/text").Model,Wedge:e("../models/glyphs/wedge").Model,Gear:e("../models/glyphs/gear").Model,Grid:e("../models/grids/grid").Model,ImageSource:e("../models/tiles/image_source").Model,LayoutDOM:e("../models/layouts/layout_dom").Model,Row:e("../models/layouts/row").Model,Column:e("../models/layouts/column").Model,Spacer:e("../models/layouts/spacer").Model,WidgetBox:e("../models/layouts/widget_box").Model,GMapPlot:e("../models/plots/gmap_plot").Model,LinearColorMapper:e("../models/mappers/linear_color_mapper").Model,markers:[e("../models/markers/index")],Model:e("../model").Model,Plot:e("../models/plots/plot").Model,Range:e("../models/ranges/range").Model,Range1d:e("../models/ranges/range1d").Model,DataRange:e("../models/ranges/data_range").Model,DataRange1d:e("../models/ranges/data_range1d").Model,FactorRange:e("../models/ranges/factor_range").Model,Renderer:e("../models/renderers/renderer").Model,TileRenderer:e("../models/tiles/tile_renderer").Model,DynamicImageRenderer:e("../models/tiles/dynamic_image_renderer").Model,GlyphRenderer:e("../models/renderers/glyph_renderer").Model,GuideRenderer:e("../models/renderers/guide_renderer").Model,DataSource:e("../models/sources/data_source").Model,ColumnDataSource:e("../models/sources/column_data_source").Model,AjaxDataSource:e("../models/sources/ajax_data_source").Model,Ticker:e("../models/tickers/ticker").Model,ContinuousTicker:e("../models/tickers/continuous_ticker").Model,FixedTicker:e("../models/tickers/fixed_ticker").Model,AdaptiveTicker:e("../models/tickers/adaptive_ticker").Model,CompositeTicker:e("../models/tickers/composite_ticker").Model,SingleIntervalTicker:e("../models/tickers/single_interval_ticker").Model,DaysTicker:e("../models/tickers/days_ticker").Model,MonthsTicker:e("../models/tickers/months_ticker").Model,YearsTicker:e("../models/tickers/years_ticker").Model,BasicTicker:e("../models/tickers/basic_ticker").Model,LogTicker:e("../models/tickers/log_ticker").Model,CategoricalTicker:e("../models/tickers/categorical_ticker").Model,DatetimeTicker:e("../models/tickers/datetime_ticker").Model,TileSource:e("../models/tiles/tile_source").Model,MercatorTileSource:e("../models/tiles/mercator_tile_source").Model,TMSTileSource:e("../models/tiles/tms_tile_source").Model,WMTSTileSource:e("../models/tiles/wmts_tile_source").Model,QUADKEYTileSource:e("../models/tiles/quadkey_tile_source").Model,BBoxTileSource:e("../models/tiles/bbox_tile_source").Model,ToolbarBase:e("../models/tools/toolbar_base").Model,Toolbar:e("../models/tools/toolbar").Model,ToolbarBox:e("../models/tools/toolbar_box").Model,ToolEvents:e("../common/tool_events").Model,Tool:e("../models/tools/tool").Model,PanTool:e("../models/tools/gestures/pan_tool").Model,WheelZoomTool:e("../models/tools/gestures/wheel_zoom_tool").Model,SaveTool:e("../models/tools/actions/save_tool").Model,UndoTool:e("../models/tools/actions/undo_tool").Model,RedoTool:e("../models/tools/actions/redo_tool").Model,ResetTool:e("../models/tools/actions/reset_tool").Model,ResizeTool:e("../models/tools/gestures/resize_tool").Model,CrosshairTool:e("../models/tools/inspectors/crosshair_tool").Model,BoxZoomTool:e("../models/tools/gestures/box_zoom_tool").Model,BoxSelectTool:e("../models/tools/gestures/box_select_tool").Model,LassoSelectTool:e("../models/tools/gestures/lasso_select_tool").Model,PolySelectTool:e("../models/tools/gestures/poly_select_tool").Model,TapTool:e("../models/tools/gestures/tap_tool").Model,HoverTool:e("../models/tools/inspectors/hover_tool").Model,HelpTool:e("../models/tools/actions/help_tool").Model}},{"../common/tool_events":"common/tool_events","../model":"model","../models/annotations/arrow":"models/annotations/arrow","../models/annotations/arrow_head":"models/annotations/arrow_head","../models/annotations/box_annotation":"models/annotations/box_annotation","../models/annotations/color_bar":"models/annotations/color_bar","../models/annotations/label":"models/annotations/label","../models/annotations/label_set":"models/annotations/label_set","../models/annotations/legend":"models/annotations/legend","../models/annotations/poly_annotation":"models/annotations/poly_annotation","../models/annotations/span":"models/annotations/span","../models/annotations/title":"models/annotations/title","../models/annotations/tooltip":"models/annotations/tooltip","../models/axes/axis":"models/axes/axis","../models/axes/categorical_axis":"models/axes/categorical_axis","../models/axes/continuous_axis":"models/axes/continuous_axis","../models/axes/datetime_axis":"models/axes/datetime_axis","../models/axes/linear_axis":"models/axes/linear_axis","../models/axes/log_axis":"models/axes/log_axis","../models/callbacks/customjs":"models/callbacks/customjs","../models/callbacks/open_url":"models/callbacks/open_url","../models/formatters/basic_tick_formatter":"models/formatters/basic_tick_formatter","../models/formatters/categorical_tick_formatter":"models/formatters/categorical_tick_formatter","../models/formatters/datetime_tick_formatter":"models/formatters/datetime_tick_formatter","../models/formatters/func_tick_formatter":"models/formatters/func_tick_formatter","../models/formatters/numeral_tick_formatter":"models/formatters/numeral_tick_formatter","../models/formatters/printf_tick_formatter":"models/formatters/printf_tick_formatter","../models/formatters/tick_formatter":"models/formatters/tick_formatter","../models/glyphs/annular_wedge":"models/glyphs/annular_wedge","../models/glyphs/annulus":"models/glyphs/annulus","../models/glyphs/arc":"models/glyphs/arc","../models/glyphs/bezier":"models/glyphs/bezier","../models/glyphs/circle":"models/glyphs/circle","../models/glyphs/ellipse":"models/glyphs/ellipse","../models/glyphs/gear":"models/glyphs/gear","../models/glyphs/glyph":"models/glyphs/glyph","../models/glyphs/image":"models/glyphs/image","../models/glyphs/image_rgba":"models/glyphs/image_rgba","../models/glyphs/image_url":"models/glyphs/image_url","../models/glyphs/line":"models/glyphs/line","../models/glyphs/multi_line":"models/glyphs/multi_line","../models/glyphs/oval":"models/glyphs/oval","../models/glyphs/patch":"models/glyphs/patch","../models/glyphs/patches":"models/glyphs/patches","../models/glyphs/quad":"models/glyphs/quad","../models/glyphs/quadratic":"models/glyphs/quadratic","../models/glyphs/ray":"models/glyphs/ray","../models/glyphs/rect":"models/glyphs/rect","../models/glyphs/segment":"models/glyphs/segment","../models/glyphs/text":"models/glyphs/text","../models/glyphs/wedge":"models/glyphs/wedge","../models/grids/grid":"models/grids/grid","../models/layouts/column":"models/layouts/column","../models/layouts/layout_dom":"models/layouts/layout_dom","../models/layouts/row":"models/layouts/row","../models/layouts/spacer":"models/layouts/spacer","../models/layouts/widget_box":"models/layouts/widget_box","../models/mappers/linear_color_mapper":"models/mappers/linear_color_mapper","../models/markers/index":"models/markers/index","../models/plots/gmap_plot":"models/plots/gmap_plot","../models/plots/plot":"models/plots/plot","../models/ranges/data_range":"models/ranges/data_range","../models/ranges/data_range1d":"models/ranges/data_range1d","../models/ranges/factor_range":"models/ranges/factor_range","../models/ranges/range":"models/ranges/range","../models/ranges/range1d":"models/ranges/range1d","../models/renderers/glyph_renderer":"models/renderers/glyph_renderer","../models/renderers/guide_renderer":"models/renderers/guide_renderer","../models/renderers/renderer":"models/renderers/renderer","../models/sources/ajax_data_source":"models/sources/ajax_data_source","../models/sources/column_data_source":"models/sources/column_data_source","../models/sources/data_source":"models/sources/data_source","../models/tickers/adaptive_ticker":"models/tickers/adaptive_ticker","../models/tickers/basic_ticker":"models/tickers/basic_ticker","../models/tickers/categorical_ticker":"models/tickers/categorical_ticker","../models/tickers/composite_ticker":"models/tickers/composite_ticker","../models/tickers/continuous_ticker":"models/tickers/continuous_ticker","../models/tickers/datetime_ticker":"models/tickers/datetime_ticker","../models/tickers/days_ticker":"models/tickers/days_ticker","../models/tickers/fixed_ticker":"models/tickers/fixed_ticker","../models/tickers/log_ticker":"models/tickers/log_ticker","../models/tickers/months_ticker":"models/tickers/months_ticker","../models/tickers/single_interval_ticker":"models/tickers/single_interval_ticker","../models/tickers/ticker":"models/tickers/ticker","../models/tickers/years_ticker":"models/tickers/years_ticker","../models/tiles/bbox_tile_source":"models/tiles/bbox_tile_source","../models/tiles/dynamic_image_renderer":"models/tiles/dynamic_image_renderer","../models/tiles/image_source":"models/tiles/image_source","../models/tiles/mercator_tile_source":"models/tiles/mercator_tile_source","../models/tiles/quadkey_tile_source":"models/tiles/quadkey_tile_source","../models/tiles/tile_renderer":"models/tiles/tile_renderer","../models/tiles/tile_source":"models/tiles/tile_source","../models/tiles/tms_tile_source":"models/tiles/tms_tile_source","../models/tiles/wmts_tile_source":"models/tiles/wmts_tile_source","../models/tools/actions/help_tool":"models/tools/actions/help_tool","../models/tools/actions/redo_tool":"models/tools/actions/redo_tool","../models/tools/actions/reset_tool":"models/tools/actions/reset_tool","../models/tools/actions/save_tool":"models/tools/actions/save_tool","../models/tools/actions/undo_tool":"models/tools/actions/undo_tool","../models/tools/gestures/box_select_tool":"models/tools/gestures/box_select_tool","../models/tools/gestures/box_zoom_tool":"models/tools/gestures/box_zoom_tool","../models/tools/gestures/lasso_select_tool":"models/tools/gestures/lasso_select_tool","../models/tools/gestures/pan_tool":"models/tools/gestures/pan_tool","../models/tools/gestures/poly_select_tool":"models/tools/gestures/poly_select_tool","../models/tools/gestures/resize_tool":"models/tools/gestures/resize_tool","../models/tools/gestures/tap_tool":"models/tools/gestures/tap_tool","../models/tools/gestures/wheel_zoom_tool":"models/tools/gestures/wheel_zoom_tool","../models/tools/inspectors/crosshair_tool":"models/tools/inspectors/crosshair_tool","../models/tools/inspectors/hover_tool":"models/tools/inspectors/hover_tool","../models/tools/tool":"models/tools/tool","../models/tools/toolbar":"models/tools/toolbar","../models/tools/toolbar_base":"models/tools/toolbar_base","../models/tools/toolbar_box":"models/tools/toolbar_box"}],"api/plotting":[function(e,o,t){var l,r,s,n,a,i,d,c,u,m,_,p,h,g,f,y,x=function(e,o){function t(){this.constructor=e}for(var l in o)k.call(o,l)&&(e[l]=o[l]);return t.prototype=o.prototype,e.prototype=new t,e.__super__=o.prototype,e},k={}.hasOwnProperty,w=[].slice;a=e("underscore"),l=e("jquery"),y=e("sprintf"),s=e("../document").Document,_=e("../embed"),r=e("../embed").BOKEH_ROOT,g=e("./models"),d=[["index","$index"],["data (x, y)","($x, $y)"],["canvas (x, y)","($sx, $sy)"]],i="pan,wheel_zoom,box_zoom,save,reset,help",c={pan:function(e){return new g.PanTool({plot:e,dimensions:["width","height"]})},xpan:function(e){return new g.PanTool({plot:e,dimensions:["width"]})},ypan:function(e){return new g.PanTool({plot:e,dimensions:["height"]})},wheel_zoom:function(e){return new g.WheelZoomTool({plot:e,dimensions:["width","height"]})},xwheel_zoom:function(e){return new g.WheelZoomTool({plot:e,dimensions:["width"]})},ywheel_zoom:function(e){return new g.WheelZoomTool({plot:e,dimensions:["height"]})},resize:function(e){return new g.ResizeTool({plot:e})},click:function(e){return new g.TapTool({plot:e,behavior:"inspect"})},tap:function(e){return new g.TapTool({plot:e})},crosshair:function(e){return new g.CrosshairTool({plot:e})},box_select:function(e){return new g.BoxSelectTool({plot:e})},xbox_select:function(e){return new g.BoxSelectTool({plot:e,dimensions:["width"]})},ybox_select:function(e){return new g.BoxSelectTool({plot:e,dimensions:["height"]})},poly_select:function(e){return new g.PolySelectTool({plot:e})},lasso_select:function(e){return new g.LassoSelectTool({plot:e})},box_zoom:function(e){return new g.BoxZoomTool({plot:e,dimensions:["width","height"]})},xbox_zoom:function(e){return new g.BoxZoomTool({plot:e,dimensions:["width"]})},ybox_zoom:function(e){return new g.BoxZoomTool({plot:e,dimensions:["height"]})},hover:function(e){return new g.HoverTool({plot:e,tooltips:d})},save:function(e){return new g.SaveTool({plot:e})},previewsave:function(e){return new g.SaveTool({plot:e})},undo:function(e){return new g.UndoTool({plot:e})},redo:function(e){return new g.RedoTool({plot:e})},reset:function(e){return new g.ResetTool({plot:e})},help:function(e){return new g.HelpTool({plot:e})}},u=function(e,o){return void 0===e?o:e},n=function(e){function o(e,t){var l,r,s,n,d,c,m,_,p,h,f,y,x,k,w,v;if(null==e&&(e={}),null==t&&(t={}),l=a.clone(e),_=u(l.tools,i),delete l.tools,l.x_range=this._get_range(l.x_range),l.y_range=this._get_range(l.y_range),f=a.isUndefined(l.x_axis_type)?"auto":l.x_axis_type,w=a.isUndefined(l.y_axis_type)?"auto":l.y_axis_type,delete l.x_axis_type,delete l.y_axis_type,y=null!=(r=l.x_minor_ticks)?r:"auto",v=null!=(s=l.y_minor_ticks)?s:"auto",delete l.x_minor_ticks,delete l.y_minor_ticks,h=null!=(n=l.x_axis_location)?n:"below",k=null!=(d=l.y_axis_location)?d:"left",delete l.x_axis_location,delete l.y_axis_location,p=null!=(c=l.x_axis_label)?c:"",x=null!=(m=l.y_axis_label)?m:"",delete l.x_axis_label,delete l.y_axis_label,!a.isUndefined(l.width)){if(!a.isUndefined(l.plot_width))throw new Error("both 'width' and 'plot_width' can't be given at the same time");l.plot_width=l.width,delete l.width}if(!a.isUndefined(l.height)){if(!a.isUndefined(l.plot_height))throw new Error("both 'height' and 'plot_height' can't be given at the same time");l.plot_height=l.height,delete l.height}o.__super__.constructor.call(this,l,t),this._process_guides(0,f,h,y,p),this._process_guides(1,w,k,v,x),this.add_tools.apply(this,this._process_tools(_)),this._legend=new g.Legend({plot:this}),this.add_renderers(this._legend)}return x(o,e),Object.defineProperty(o.prototype,"xgrid",{get:function(){return this.renderers.filter(function(e){return e instanceof g.Grid&&0===e.dimension})[0]}}),Object.defineProperty(o.prototype,"ygrid",{get:function(){return this.renderers.filter(function(e){return e instanceof g.Grid&&1===e.dimension})[0]}}),Object.defineProperty(o.prototype,"xaxis",{get:function(){return this.below.concat(this.above).filter(function(e){return e instanceof g.Axis})[0]}}),Object.defineProperty(o.prototype,"yaxis",{get:function(){return this.left.concat(this.right).filter(function(e){return e instanceof g.Axis})[0]}}),o.prototype.annular_wedge=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.AnnularWedge,"x,y,inner_radius,outer_radius,start_angle,end_angle",e)},o.prototype.annulus=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Annulus,"x,y,inner_radius,outer_radius",e)},o.prototype.arc=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Arc,"x,y,radius,start_angle,end_angle",e)},o.prototype.bezier=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Bezier,"x0,y0,x1,y1,cx0,cy0,cx1,cy1",e)},o.prototype.ellipse=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Ellipse,"x,y,width,height",e)},o.prototype.gear=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Gear,"x,y,module,teeth",e)},o.prototype.image=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Image,"color_mapper,image,rows,cols,x,y,dw,dh",e)},o.prototype.image_rgba=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.ImageRGBA,"image,rows,cols,x,y,dw,dh",e)},o.prototype.image_url=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.ImageURL,"url,x,y,w,h",e)},o.prototype.line=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Line,"x,y",e)},o.prototype.multi_line=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.MultiLine,"xs,ys",e)},o.prototype.oval=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Oval,"x,y,width,height",e)},o.prototype.patch=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Patch,"x,y",e)},o.prototype.patches=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Patches,"xs,ys",e)},o.prototype.quad=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Quad,"left,right,bottom,top",e)},o.prototype.quadratic=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Quadratic,"x0,y0,x1,y1,cx,cy",e)},o.prototype.ray=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Ray,"x,y,length",e)},o.prototype.rect=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Rect,"x,y,width,height",e)},o.prototype.segment=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Segment,"x0,y0,x1,y1",e)},o.prototype.text=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Text,"x,y,text",e)},o.prototype.wedge=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._glyph(g.Wedge,"x,y,radius,start_angle,end_angle",e)},o.prototype.asterisk=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.Asterisk,e)},o.prototype.circle=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.Circle,e)},o.prototype.circle_cross=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.CircleCross,e)},o.prototype.circle_x=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.CircleX,e)},o.prototype.cross=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.Cross,e)},o.prototype.diamond=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.Diamond,e)},o.prototype.diamond_cross=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.DiamondCross,e)},o.prototype.inverted_triangle=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.InvertedTriangle,e)},o.prototype.square=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.Square,e)},o.prototype.square_cross=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.SquareCross,e)},o.prototype.square_x=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.SquareX,e)},o.prototype.triangle=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.Triangle,e)},o.prototype.x=function(){var e;return e=1<=arguments.length?w.call(arguments,0):[],this._marker(g.X,e)},o.prototype._vectorable=["fill_color","fill_alpha","line_color","line_alpha","line_width","text_color","text_alpha","text_font_size"],o.prototype._default_color="#1f77b4",o.prototype._default_alpha=1,o.prototype._pop_colors_and_alpha=function(e,o,t,l,r){var s,n,a,i;return null==t&&(t=""),null==l&&(l=this._default_color),null==r&&(r=this._default_alpha),i={},a=u(o[t+"color"],l),n=u(o[t+"alpha"],r),delete o[t+"color"],delete o[t+"alpha"],s=function(l,r){if(null!=e.prototype.props[l])return i[l]=u(o[t+l],r),delete o[t+l]},s("fill_color",a),s("line_color",a),s("text_color","black"),s("fill_alpha",n),s("line_alpha",n),s("text_alpha",n),i},o.prototype._find_uniq_name=function(e,o){var t,l;for(t=1;;){if(l=o+"__"+t,null==e[l])return l;t+=1}},o.prototype._fixup_values=function(e,o,t){var l,r,s;r=[];for(l in t)s=t[l],r.push(function(l){return function(r,s){var n,i;if(i=e.prototype.props[r],null!=i&&i.type.prototype.dataspec&&null!=s){if(a.isArray(s))return null!=o[r]?o[r]!==s?(n=l._find_uniq_name(o,r),o[n]=s):n=r:(n=r,o[n]=s),t[r]={field:n};if(a.isNumber(s)||a.isString(s))return t[r]={value:s}}}}(this)(l,s));return r},o.prototype._glyph=function(e,o,t){var l,r,s,n,i,d,c,u,m,_,p,h,f,y,x,k,v,b,M,T,S,z,R,A,B;if(o=o.split(","),1===t.length)r=t[0],r=a.clone(r);else for(S=t,t=2<=S.length?w.call(S,0,f=S.length-1):(f=0,[]),M=S[f++],r=a.clone(M),n=function(e,o){return r[e]=t[o]},h=y=0,k=o.length;y<k;h=++y)T=o[h],n(T,h);return x=r.legend,delete r.legend,m=a.any(a.keys(r),function(e){return e.startsWith("selection_")}),u=a.any(a.keys(r),function(e){return e.startsWith("hover_")}),d=this._pop_colors_and_alpha(e,r),b=this._pop_colors_and_alpha(e,r,"nonselection_",void 0,.1),A=m?this._pop_colors_and_alpha(e,r,"selection_"):{},p=u?this._pop_colors_and_alpha(e,r,"hover_"):{},B=null!=(z=r.source)?z:new g.ColumnDataSource,s=a.clone(B.data),delete r.source,this._fixup_values(e,s,d),this._fixup_values(e,s,b),this._fixup_values(e,s,A),this._fixup_values(e,s,p),this._fixup_values(e,s,r),B.data=s,l=function(e){return function(e,o,t){return new e(a.extend({},o,t))}}(this),i=l(e,r,d),v=l(e,r,b),R=m?l(e,r,A):null,_=u?l(e,r,p):null,c=new g.GlyphRenderer({data_source:B,glyph:i,nonselection_glyph:v,selection_glyph:R,hover_glyph:_}),null!=x&&this._update_legend(x,c),this.add_renderers(c),c},o.prototype._marker=function(e,o){return this._glyph(e,"x,y",o)},o.prototype._get_range=function(e){if(null==e)return new g.DataRange1d;if(e instanceof g.Range)return e;if(a.isArray(e)){if(a.all(function(o){var t,l,r;for(r=[],t=0,l=e.length;t<l;t++)o=e[t],r.push(a.isString(o));return r}))return new g.FactorRange({factors:e});if(2===e.length)return new g.Range1d({start:e[0],end:e[1]})}},o.prototype._process_guides=function(e,o,t,l,r){var s,n,a,i;if(i=0===e?this.x_range:this.y_range,n=this._get_axis_class(o,i),null!=n)return n===g.LogAxis&&(0===e?this.x_mapper_type="log":this.y_mapper_type="log"),s=new n,s.ticker instanceof g.ContinuousTicker&&(s.ticker.num_minor_ticks=this._get_num_minor_ticks(n,l)),0!==r.length&&(s.axis_label=r),a=new g.Grid({
|
|
dimension:e,ticker:s.ticker}),this.add_layout(s,t),this.add_layout(a)},o.prototype._get_axis_class=function(e,o){return null==e?null:"linear"===e?g.LinearAxis:"log"===e?g.LogAxis:"datetime"===e?g.DatetimeAxis:"auto"===e?o instanceof g.FactorRange?g.CategoricalAxis:g.LinearAxis:void 0},o.prototype._get_num_minor_ticks=function(e,o){if(a.isNumber(o)){if(o<=1)throw new Error("num_minor_ticks must be > 1");return o}return null==o?0:"auto"===o?e===g.LogAxis?10:5:void 0},o.prototype._process_tools=function(e){var o,t;return a.isString(e)&&(e=e.split(/\s*,\s*/)),o=function(){var o,l,r;for(r=[],o=0,l=e.length;o<l;o++)t=e[o],a.isString(t)?r.push(c[t](this)):r.push(t);return r}.call(this)},o.prototype._update_legend=function(e,o){var t,l,r,s,n,i;for(l=a.clone(this._legend.legends),t=0,r=l.length;t<r;t++)if(n=l[t],s=n[0],i=n[1],s===e)return i.push(o),void(this._legend.legends=l);return l.push([e,[o]]),this._legend.legends=l},o}(g.Plot),p=function(e,o){return null==e&&(e={}),null==o&&(o={}),new n(e,o)},f=function(e,o){var t,n,i,d,c,u,m;if(u=a.isArray(e),i=new s,u)for(d=0,c=e.length;d<c;d++)t=e[d],i.add_root(t);else i.add_root(e);return n=l("<div class="+r+">"),l(null!=o?o:"body").append(n),m=_.add_document_standalone(i,n),u?m:m[e.id]},m=function(e,o,t){return y("#%02x%02x%02x",e,o,t)},h=function(e,o){var t,l,r,s,n,i,d,c,u,m,_,p,h,f,y,x,k,w,v;for(null==o&&(o={}),k=a.isUndefined(o.toolbar_location)?"above":o.toolbar_location,y=a.isUndefined(o.sizing_mode)?"fixed":o.sizing_mode,w="fixed"===o.sizing_mode?"scale_width":y,v=[],f=[],r=0,d=e.length;r<d;r++){for(_=e[r],h=[],p=[],s=0,c=_.length;s<c;s++){if(l=_[s],l instanceof g.Plot&&(h=h.concat(l.toolbar.tools),l.toolbar_location=null),null===l){for(n=0,u=_.length;n<u&&(m=_[n],!(m instanceof g.Plot));n++);l=new g.Spacer({width:m.plot_width,height:m.plot_height})}if(!(l instanceof g.LayoutDOM))throw new Error("only LayoutDOM items can be inserted into Grid");l.sizing_mode=y,p.push(l)}v=v.concat(h),_=new g.Row({children:p,sizing_mode:y}),f.push(_)}return t=new g.Column({children:f,sizing_mode:y}),i=function(){if(!k)return t;switch(x=new g.ToolbarBox({tools:v,sizing_mode:w,toolbar_location:k}),k){case"above":return new g.Column({children:[x,t],sizing_mode:y});case"below":return new g.Column({children:[t,x],sizing_mode:y});case"left":return new g.Row({children:[x,t],sizing_mode:y});case"right":return new g.Row({children:[t,x],sizing_mode:y})}}()},o.exports={Figure:n,figure:p,show:f,color:m,gridplot:h}},{"../document":"document","../embed":"embed","./models":"api/models",jquery:"jquery",sprintf:"sprintf",underscore:"underscore"}]},{},["api"])}();/*
|
|
Copyright (c) 2012, Continuum Analytics, Inc.
|
|
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 Continuum Analytics nor the names of any 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.
|
|
*/
|