Files
Automaaval/dist/zacatraz/_internal/bokeh/server/static/js/bokeh-gl.min.js
T

82 lines
206 KiB
JavaScript
Raw Normal View History

2026-03-14 21:48:05 +00:00
'use strict';
/*!
* Copyright (c) Anaconda, Inc., and Bokeh Contributors
* 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 Anaconda 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.
*/
(function(root, factory) {
factory(root["Bokeh"], "3.6.0");
})(this, function(Bokeh, version) {
let define;
return (function(modules, entry, aliases, externals) {
const bokeh = typeof Bokeh !== "undefined" ? (version != null ? Bokeh[version] : Bokeh) : null;
if (bokeh != null) {
return bokeh.register_plugin(modules, entry, aliases);
} else {
throw new Error("Cannot find Bokeh" + (version != null ? " " + version : "") + ". You have to load it prior to loading plugins.");
}
})
({
546: function _(n,c,f,i,o){i(),n(547)},
547: function _(t,_,r,e,o){e();const a=t(1);o("get_regl",t(548).get_regl),a.__exportStar(t(560),r),a.__exportStar(t(567),r),a.__exportStar(t(568),r),a.__exportStar(t(563),r),a.__exportStar(t(569),r),a.__exportStar(t(571),r),a.__exportStar(t(572),r),a.__exportStar(t(573),r),a.__exportStar(t(575),r),a.__exportStar(t(576),r),a.__exportStar(t(577),r),a.__exportStar(t(578),r),a.__exportStar(t(579),r),a.__exportStar(t(574),r),a.__exportStar(t(562),r),a.__exportStar(t(580),r),a.__exportStar(t(581),r)},
548: function _(t,e,i,_,n){_(),i.get_regl=function(t){null==m&&(m=new b(t));return m};const r=t(1),a=r.__importDefault(t(549)),s=t(550),o=r.__importDefault(t(552)),f=r.__importDefault(t(553)),l=r.__importDefault(t(554)),u=r.__importDefault(t(555)),h=r.__importDefault(t(556)),c=r.__importDefault(t(557)),p=r.__importDefault(t(558)),g=r.__importDefault(t(559));let m=null;class b{constructor(t){this._marker_no_hatch_map=new Map,this._marker_hatch_map=new Map;try{this._regl=(0,a.default)({gl:t,extensions:["ANGLE_instanced_arrays","EXT_blend_minmax"]}),this._regl_available=!0,this._line_geometry=this._regl.buffer({usage:"static",type:"float",data:[[-2,0],[-1,-1],[1,-1],[1,1],[-1,1]]}),this._line_triangles=this._regl.elements({usage:"static",primitive:"triangle fan",data:[0,1,2,3,4]}),this._rect_geometry=this._regl.buffer({usage:"static",type:"float",data:[[-1,-1],[1,-1],[1,1],[-1,1]]}),this._rect_triangles=this._regl.elements({usage:"static",primitive:"triangle fan",data:[0,1,2,3]})}catch(t){this._regl_available=!1}}buffer(t){return this._regl.buffer(t)}clear(t,e){this._viewport={x:0,y:0,width:t,height:e},this._regl.clear({color:[0,0,0,0]})}clear_framebuffer(t){this._regl.clear({color:[0,0,0,0],framebuffer:t})}get framebuffer_and_texture(){const{_regl:t}=this,{_gl:e}=t,i={height:e.drawingBufferHeight,width:e.drawingBufferWidth};return null==this._framebuffer_texture?this._framebuffer_texture=t.texture(i):this._framebuffer_texture(i),null==this._framebuffer&&(this._framebuffer=t.framebuffer({color:this._framebuffer_texture,depth:!1,stencil:!1})),[this._framebuffer,this._framebuffer_texture]}get has_webgl(){return this._regl_available}get scissor(){return this._scissor}set_scissor(t,e,i,_){this._scissor={x:t,y:e,width:i,height:_}}texture(t){return this._regl.texture(t)}get viewport(){return this._viewport}accumulate(){return null==this._accumulate&&(this._accumulate=function(t,e,i){const _={vert:o.default,frag:f.default,attributes:{a_position:{buffer:e,divisor:0}},uniforms:{u_framebuffer_tex:t.prop("framebuffer_tex")},elements:i,blend:{enable:!0,func:{srcRGB:"one",srcAlpha:"one",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("scissor")},viewport:t.prop("viewport")};return t(_)}(this._regl,this._rect_geometry,this._rect_triangles)),this._accumulate}dashed_line(){return null==this._dashed_line&&(this._dashed_line=function(t,e,i){const _={vert:`#define DASHED\n${h.default}\n`,frag:`#define DASHED\n${c.default}\n`,attributes:{a_position:{buffer:e,divisor:0},a_point_prev:(t,e)=>e.points.to_attribute_config(e.point_offset),a_point_start:(t,e)=>e.points.to_attribute_config(e.point_offset+2),a_point_end:(t,e)=>e.points.to_attribute_config(e.point_offset+4),a_point_next:(t,e)=>e.points.to_attribute_config(e.point_offset+6),a_show_prev:(t,e)=>e.show.to_attribute_config(e.point_offset/2-e.line_offset),a_show_curr:(t,e)=>e.show.to_attribute_config(e.point_offset/2-e.line_offset+1),a_show_next:(t,e)=>e.show.to_attribute_config(e.point_offset/2-e.line_offset+2),a_linewidth:(t,e)=>e.linewidth.to_attribute_config_nested(e.line_offset,e.nsegments+3),a_line_color:(t,e)=>e.line_color.to_attribute_config_nested(e.line_offset,e.nsegments+3),a_line_cap:(t,e)=>e.line_cap.to_attribute_config_nested(e.line_offset,e.nsegments+3),a_line_join:(t,e)=>e.line_join.to_attribute_config_nested(e.line_offset,e.nsegments+3),a_length_so_far:(t,e)=>e.length_so_far.to_attribute_config(e.point_offset/2-3*e.line_offset),a_dash_tex_info:(t,e)=>e.dash_tex_info.to_attribute_config_nested(e.line_offset,e.nsegments+3),a_dash_scale:(t,e)=>e.dash_scale.to_attribute_config_nested(e.line_offset,e.nsegments+3),a_dash_offset:(t,e)=>e.dash_offset.to_attribute_config_nested(e.line_offset,e.nsegments+3)},uniforms:{u_canvas_size:t.prop("canvas_size"),u_antialias:t.prop("antialias"),u_miter_limit:t.prop("miter_limit"),u_dash_tex:t.prop("dash_tex")},elements:i,instances:t.prop("nsegments"),blend:{enable:!0,equation:"max",func:{srcRGB:1,srcAlpha:1,dstRGB:1,dstAlpha:1}},depth:{enable:!1},framebuffer:t.prop("framebuffer"),sci
549: function _(e,t,r,n,a){var i,o;i=this,o=function(){"use strict";var e=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},t=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]=t[r[n]];return e},r="\n";function n(e){var t=new Error("(regl) "+e);throw console.error(t),t}function a(e,t){e||n(t)}function i(e){return e?": "+e:""}function o(e,t){switch(t){case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"function":return"function"==typeof e;case"undefined":return void 0===e;case"symbol":return"symbol"==typeof e}}function f(e,t,r){t.indexOf(e)<0&&n("invalid value"+i(r)+". must be one of: "+t)}var u=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function s(e,t){for(e+="";e.length<t;)e=" "+e;return e}function c(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(e,t){this.number=e,this.line=t,this.errors=[]}function d(e,t,r){this.file=e,this.line=t,this.message=r}function m(){return"unknown"}function p(){return"unknown"}function h(e,t){var r,n=e.split("\n"),a=1,i=0,o={unknown:new c,0:new c};o.unknown.name=o[0].name=t||"unknown",o.unknown.lines.push(new l(0,""));for(var f=0;f<n.length;++f){var u=n[f],s=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(u);if(s)switch(s[1]){case"line":var d=/(\d+)(\s+\d+)?/.exec(s[2]);d&&(a=0|d[1],d[2]&&((i=0|d[2])in o||(o[i]=new c)));break;case"define":var m=/SHADER_NAME(_B64)?\s+(.*)$/.exec(s[2]);m&&(o[i].name=m[1]?(r=m[2],"undefined"!=typeof atob?atob(r):"base64:"+r):m[2])}o[i].lines.push(new l(a++,u))}return Object.keys(o).forEach((function(e){var t=o[e];t.lines.forEach((function(e){t.index[e.number]=e}))})),o}function b(e){e._commandRef="unknown"}function v(e,t){n(e+" in command "+(t||"unknown"))}function g(e,t,r,n){o(e,t)||v("invalid parameter type"+i(r)+". expected "+t+", got "+typeof e,n||"unknown")}var y=33071,x=32819,w=32820,A=33635,_=34042,k={};function S(e,t){return e===w||e===x||e===A?2:e===_?4:k[e]*t}function O(e){return!(e&e-1||!e)}k[5120]=k[5121]=1,k[5122]=k[5123]=k[36193]=k[A]=k[x]=k[w]=2,k[5124]=k[5125]=k[5126]=k[_]=4;var E=t(a,{optional:function(e){e()},raise:n,commandRaise:v,command:function(e,t,r){e||v(t,r||"unknown")},parameter:function(e,t,r){e in t||n("unknown parameter ("+e+")"+i(r)+". possible values: "+Object.keys(t).join())},commandParameter:function(e,t,r,n){e in t||v("unknown parameter ("+e+")"+i(r)+". possible values: "+Object.keys(t).join(),n||"unknown")},constructor:function(e){Object.keys(e).forEach((function(e){u.indexOf(e)<0&&n('invalid regl constructor argument "'+e+'". must be one of '+u)}))},type:function(e,t,r){o(e,t)||n("invalid parameter type"+i(r)+". expected "+t+", got "+typeof e)},commandType:g,isTypedArray:function(t,r){e(t)||n("invalid parameter type"+i(r)+". must be a typed array")},nni:function(e,t){e>=0&&(0|e)===e||n("invalid parameter type, ("+e+")"+i(t)+". must be a nonnegative integer")},oneOf:f,shaderError:function(e,t,n,i,o){if(!e.getShaderParameter(t,e.COMPILE_STATUS)){var f=e.getShaderInfoLog(t),u=i===e.FRAGMENT_SHADER?"fragment":"vertex";g(n,"string",u+" shader source must be a string",o);var c=h(n,o),l=function(e){var t=[];return e.split("\n").forEach((function(e){if(!(e.length<5)){var r=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(e);r?t.push(new d(0|r[1],0|r[2],r[3].trim())):e.length>0&&t.push(new d("unknown",0,e))}})),t}(f);!function(e,t){t.forEach((function(t){var r=e[t.file];if(r){var n=r.index[t.line];if(n)return n.errors.push(t),void(r.hasErrors=!0)}e.unknown.hasErrors=!0,e.unknown.lines[0].errors.push(t)}))}(c,l),Object.keys(c).forEach((function(e){var t=c[e];if(t.hasErrors){var n=[""],a=[""];i("file number "+e+": "+t.name+"\n","color:red;text-decoration:underline;font-weight:bold"),t.lines.forEach((function(e){if(e.errors.length>0){i(s(e.number,4
550: function _(t,e,a,s,r){s();const n=t(551),_=t(10),o=t(13);class c{constructor(t){this._regl=t,this._map=new Map}_create_texture(t){const e=t.length;let a=0;const s=[];let r=0,_=0;for(let n=0;n<e;n++)a+=t[n],s.push(t[n]+t[(n+1)%e]),n%2==0?_=Math.max(_,t[n]):r=Math.min(r,-t[n]);r*=.5,_*=.5;const o=(0,n.gcd)(s),c=[0];for(let a=0;a<e;a++)c.push(c[a]+t[a]);const h=2*a/o,i=(0,n.is_pow_2)(h),l=i?h:128,g=.5*o*h/l;let p;if(i){if(p=.5*t[0],g<p){p-=Math.floor(p/g)*g}}else p=0;const u=p-.5*g,m=new Uint8Array(l);let f=0;for(let e=0;e<l;e++){const a=p+e*g;a>c[f+1]&&f++;const s=t[f],n=c[f]+.5*s;let o=.5*s-Math.abs(a-n);f%2==1&&(o=-o),m[e]=Math.round(255*(o-r)/(_-r))}return[[a,u,r,_],this._regl.texture({shape:[l,1,1],data:m,wrapS:"repeat",format:"alpha",type:"uint8",mag:"linear",min:"linear"})]}_get_key(t){return t.join(",")}_get_or_create(t){const e=this._get_key(t);let a=this._map.get(e);if(null==a){const s=(0,n.gcd)(t);if(s>1){t=(0,o.map)(t,(t=>t/s)),a=this._get_or_create(t);const[r,n,_]=a;a=[r,n,s],this._map.set(e,a)}else{const[r,n]=this._create_texture(t);a=[r,n,s],this._map.set(e,a)}}return a}get(t){return t.length%2==1&&(t=(0,_.concat)([t,t])),this._get_or_create(t)}}a.DashCache=c,c.__name__="DashCache"},
551: function _(n,t,e,r,o){function u(n,t){let e,r;n>t?(e=n,r=t):(e=t,r=n);let o=e%r;for(;0!=o;)e=r,r=o,o=e%r;return r}r(),e.gcd=function(n){let t=n[0];for(let e=1;e<n.length;e++)t=u(t,n[e]);return t},e.is_pow_2=function(n){return!(n&n-1)&&0!=n}},
552: function _(n,i,o,t,_){t();o.default="\nprecision mediump float;\n\nattribute vec2 a_position;\nvarying vec2 v_tex_coords;\n\nvoid main()\n{\n gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);\n v_tex_coords = 0.5*(1.0 + a_position);\n}\n"},
553: function _(n,e,r,o,f){o();r.default="\nprecision mediump float;\n\nuniform sampler2D u_framebuffer_tex;\nvarying vec2 v_tex_coords;\n\nvoid main()\n{\n gl_FragColor = texture2D(u_framebuffer_tex, v_tex_coords);\n}\n"},
554: function _(n,o,i,s,a){s();i.default="\nprecision mediump float;\n\nattribute vec2 a_position;\nattribute vec4 a_bounds;\n\nuniform vec2 u_canvas_size;\n\nvarying vec2 v_tex_coords;\n\nvoid main()\n{\n v_tex_coords = vec2(a_position.x < 0.0 ? 0.0 : 1.0, a_position.y < 0.0 ? 0.0 : 1.0);\n\n float x = a_position.x < 0.0 ? a_bounds[0] : a_bounds[2];\n float y = a_position.y < 0.0 ? a_bounds[1] : a_bounds[3];\n vec2 xy = vec2(x, y);\n\n vec2 pos = xy + 0.5; // Bokeh's offset.\n pos /= u_canvas_size; // in 0..1\n gl_Position = vec4(2.0*pos.x - 1.0, 1.0 - 2.0*pos.y, 0.0, 1.0);\n}\n"},
555: function _(a,l,o,n,e){n();o.default="\nprecision mediump float;\n\nuniform sampler2D u_tex;\nuniform float u_global_alpha;\n\nvarying vec2 v_tex_coords;\n\nvoid main()\n{\n vec4 color = texture2D(u_tex, v_tex_coords);\n float alpha = color.a*u_global_alpha;\n gl_FragColor = vec4(color.rgb*alpha, alpha); // Premultiplied alpha.\n}\n"},
556: function _(n,t,_,e,i){e();_.default="\nprecision mediump float;\n\nconst int butt_cap = 0;\nconst int round_cap = 1;\nconst int square_cap = 2;\n\nconst int miter_join = 0;\nconst int round_join = 1;\nconst int bevel_join = 2;\n\nattribute vec2 a_position;\nattribute vec2 a_point_prev;\nattribute vec2 a_point_start;\nattribute vec2 a_point_end;\nattribute vec2 a_point_next;\nattribute float a_show_prev;\nattribute float a_show_curr;\nattribute float a_show_next;\nattribute float a_linewidth;\nattribute vec4 a_line_color;\nattribute float a_line_cap;\nattribute float a_line_join;\n#ifdef DASHED\nattribute float a_length_so_far;\nattribute vec4 a_dash_tex_info;\nattribute float a_dash_scale;\nattribute float a_dash_offset;\n#endif\n\nuniform vec2 u_canvas_size;\nuniform float u_antialias;\nuniform float u_miter_limit;\n\nvarying float v_linewidth;\nvarying vec4 v_line_color;\nvarying float v_line_cap;\nvarying float v_line_join;\nvarying float v_segment_length;\nvarying vec2 v_coords;\nvarying float v_flags; // Boolean flags\nvarying float v_cos_turn_angle_start;\nvarying float v_cos_turn_angle_end;\n#ifdef DASHED\nvarying float v_length_so_far;\nvarying vec4 v_dash_tex_info;\nvarying float v_dash_scale;\nvarying float v_dash_offset;\n#endif\n\n#define SMALL 1e-6\n\nfloat cross_z(in vec2 v0, in vec2 v1)\n{\n return v0.x*v1.y - v0.y*v1.x;\n}\n\nvec2 right_vector(in vec2 v)\n{\n return vec2(v.y, -v.x);\n}\n\n// Calculate cos/sin turn angle with adjacent segment, and unit normal vector to right\nfloat calc_turn_angle(in bool has_cap, in vec2 segment_right, in vec2 other_right, out vec2 point_right, out float sin_turn_angle)\n{\n float cos_turn_angle;\n vec2 diff = segment_right + other_right;\n float len = length(diff);\n if (has_cap || len < SMALL) {\n point_right = segment_right;\n cos_turn_angle = -1.0; // Turns back on itself.\n sin_turn_angle = 0.0;\n }\n else {\n point_right = diff / len;\n cos_turn_angle = dot(segment_right, other_right); // cos zero at +/-pi/2, +ve angle is turn right\n sin_turn_angle = cross_z(segment_right, other_right);\n }\n return cos_turn_angle;\n}\n\n// If miter too large use bevel join instead\nbool miter_too_large(in int join_type, in float cos_turn_angle)\n{\n float cos_half_angle_sqr = 0.5*(1.0 + cos_turn_angle); // Trig identity\n return join_type == miter_join && cos_half_angle_sqr < 1.0 / (u_miter_limit*u_miter_limit);\n}\n\nvec2 normalize_check_len(in vec2 vec, in float len)\n{\n if (abs(len) < SMALL)\n return vec2(1.0, 0.0);\n else\n return vec / len;\n}\n\nvec2 normalize_check(in vec2 vec)\n{\n return normalize_check_len(vec, length(vec));\n}\n\nvoid main()\n{\n if (a_show_curr < 0.5) {\n // Line segment has non-finite value at one or both ends, do not render.\n gl_Position = vec4(-2.0, -2.0, 0.0, 1.0);\n return;\n }\n\n int join_type = int(a_line_join + 0.5);\n int cap_type = int(a_line_cap + 0.5);\n\n v_linewidth = a_linewidth;\n v_line_color = a_line_color;\n if (v_linewidth < 1.0) {\n // Linewidth less than 1 is implemented as 1 but with reduced alpha.\n v_line_color.a *= v_linewidth;\n v_linewidth = 1.0;\n }\n\n float halfwidth = 0.5*(v_linewidth + u_antialias);\n\n vec2 segment_along = a_point_end - a_point_start;\n v_segment_length = length(a_point_end - a_point_start);\n segment_along = normalize_check_len(segment_along, v_segment_length); // unit vector.\n vec2 segment_right = right_vector(segment_along); // unit vector.\n vec2 xy;\n\n // in screen coords\n vec2 prev_along = normalize_check(a_point_start - a_point_prev);\n vec2 prev_right = right_vector(prev_along);\n vec2 next_right = right_vector(normalize_check(a_point_next - a_point_end));\n\n v_coords.y = a_position.y*halfwidth; // Overwritten later for join points.\n\n // Start and end cap properties\n bool has_start_cap = a_show_prev < 0.5;\n bool has_end_cap = a_show_next < 0.5;\n\n // Start an
557: function _(n,t,a,i,e){i();a.default="\nprecision mediump float;\n\nconst int butt_cap = 0;\nconst int round_cap = 1;\nconst int square_cap = 2;\n\nconst int miter_join = 0;\nconst int round_join = 1;\nconst int bevel_join = 2;\n\nuniform float u_antialias;\n#ifdef DASHED\nuniform sampler2D u_dash_tex;\n#endif\n\nvarying float v_linewidth;\nvarying vec4 v_line_color;\nvarying float v_line_cap;\nvarying float v_line_join;\nvarying float v_segment_length;\nvarying vec2 v_coords;\nvarying float v_flags;\nvarying float v_cos_turn_angle_start;\nvarying float v_cos_turn_angle_end;\n#ifdef DASHED\nvarying float v_length_so_far;\nvarying vec4 v_dash_tex_info;\nvarying float v_dash_scale;\nvarying float v_dash_offset;\n#endif\n\n#define ONE_MINUS_SMALL (1.0 - 1e-6)\n\nfloat cross_z(in vec2 v0, in vec2 v1)\n{\n return v0.x*v1.y - v0.y*v1.x;\n}\n\nvec2 right_vector(in vec2 v)\n{\n return vec2(v.y, -v.x);\n}\n\nfloat bevel_join_distance(in vec2 coords, in vec2 other_right, in float sign_turn_right)\n{\n // other_right is unit vector facing right of the other (previous or next) segment, in coord reference frame\n float hw = 0.5*v_linewidth; // Not including antialiasing\n if (other_right.y >= ONE_MINUS_SMALL) { // other_right.y is -cos(turn_angle)\n // 180 degree turn.\n return abs(hw - v_coords.x);\n }\n else {\n const vec2 segment_right = vec2(0.0, -1.0);\n // corner_right is unit vector bisecting corner facing right, in coord reference frame\n vec2 corner_right = normalize(other_right + segment_right);\n vec2 outside_point = (-hw*sign_turn_right)*segment_right;\n return hw + sign_turn_right*dot(outside_point - coords, corner_right);\n }\n}\n\nfloat cap(in int cap_type, in float x, in float y)\n{\n // x is distance along segment in direction away from end of segment,\n // y is distance across segment.\n if (cap_type == butt_cap)\n return max(0.5*v_linewidth - x, abs(y));\n else if (cap_type == square_cap)\n return max(-x, abs(y));\n else // cap_type == round_cap\n return distance(vec2(min(x, 0.0), y), vec2(0.0, 0.0));\n}\n\nfloat distance_to_alpha(in float dist)\n{\n return 1.0 - smoothstep(0.5*(v_linewidth - u_antialias),\n 0.5*(v_linewidth + u_antialias), dist);\n}\n\nvec2 turn_angle_to_right_vector(in float cos_turn_angle, in float sign_turn_right)\n{\n float sin_turn_angle = sign_turn_right*sqrt(1.0 - cos_turn_angle*cos_turn_angle);\n return vec2(sin_turn_angle, -cos_turn_angle);\n}\n\n#ifdef DASHED\nfloat dash_distance(in float x)\n{\n // x is in direction of v_coords.x, i.e. along segment.\n float tex_length = v_dash_tex_info.x;\n float tex_offset = v_dash_tex_info.y;\n float tex_dist_min = v_dash_tex_info.z;\n float tex_dist_max = v_dash_tex_info.w;\n\n // Apply offset.\n x += v_length_so_far - v_dash_scale*tex_offset + v_dash_offset;\n\n // Interpolate within texture to obtain distance to dash.\n float dist = texture2D(u_dash_tex,\n vec2(x / (tex_length*v_dash_scale), 0.0)).a;\n\n // Scale distance within min and max limits.\n dist = tex_dist_min + dist*(tex_dist_max - tex_dist_min);\n\n return v_dash_scale*dist;\n}\n\nmat2 rotation_matrix(in vec2 other_right)\n{\n float sin_angle = other_right.x;\n float cos_angle = -other_right.y;\n return mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n}\n#endif\n\nvoid main()\n{\n int join_type = int(v_line_join + 0.5);\n int cap_type = int(v_line_cap + 0.5);\n float halfwidth = 0.5*(v_linewidth + u_antialias);\n float half_antialias = 0.5*u_antialias;\n\n // Extract flags.\n int flags = int(v_flags + 0.5);\n bool turn_right_end = (flags / 32 > 0);\n float sign_turn_right_end = turn_right_end ? 1.0 : -1.0;\n flags -= 32*int(turn_right_end);\n bool turn_right_start = (flags / 16 > 0);\n float sign_turn_right_start = turn_right_start ? 1.0 : -1.0;\n flags -= 16*int(turn_right_start);\n bool miter_too_large_end = (flags / 8
558: function _(n,e,i,_,a){_();i.default="\nprecision mediump float;\n\nattribute vec2 a_position;\nattribute vec2 a_center;\nattribute float a_width; // or radius or outer_radius\nattribute float a_height; // or inner_radius\nattribute float a_angle; // or start_angle\nattribute float a_aux; // or end_angle\nattribute float a_linewidth;\nattribute vec4 a_line_color;\nattribute vec4 a_fill_color;\nattribute float a_line_cap;\nattribute float a_line_join;\nattribute float a_show;\n\n#ifdef HATCH\nattribute float a_hatch_pattern;\nattribute float a_hatch_scale;\nattribute float a_hatch_weight;\nattribute vec4 a_hatch_color;\n#endif\n\nuniform vec2 u_canvas_size;\nuniform float u_antialias;\n\n#ifdef MULTI_MARKER\nuniform float u_size_hint;\n#endif\n\n#ifdef USE_ROUND_RECT\nuniform vec4 u_border_radius;\nvarying vec4 v_border_radius;\n#endif\n\n#ifdef USE_ANNULAR_WEDGE\nvarying float v_outer_radius;\nvarying float v_inner_radius;\nvarying float v_start_angle;\nvarying float v_end_angle;\n#endif\n\n#ifdef USE_ANNULUS\nvarying float v_outer_radius;\nvarying float v_inner_radius;\n#endif\n\n#ifdef USE_WEDGE\nvarying float v_radius;\nvarying float v_start_angle;\nvarying float v_end_angle;\n#endif\n\n#if defined(USE_CIRCLE) || defined(USE_NGON)\nvarying float v_radius;\n#endif\n\n#ifdef USE_NGON\nvarying float v_n;\n#endif\n\nvarying float v_linewidth;\nvarying vec2 v_size; // 2D size for rects compared to 1D for markers.\nvarying vec4 v_line_color;\nvarying vec4 v_fill_color;\nvarying float v_line_cap;\nvarying float v_line_join;\nvarying vec2 v_coords;\n\n#ifdef HATCH\nvarying float v_hatch_pattern;\nvarying float v_hatch_scale;\nvarying float v_hatch_weight;\nvarying vec4 v_hatch_color;\nvarying vec2 v_hatch_coords;\n#endif\n\n#ifdef MULTI_MARKER\n\n#define M_DASH 1\n#define M_DOT 2\n#define M_DIAMOND 3\n#define M_HEX 4\n#define M_SQUARE_PIN 5\n#define M_TRIANGLE 6\n#define M_TRIANGLE_PIN 7\n#define M_STAR 8\n\nvec2 enclosing_size() {\n // Need extra size of (v_linewidth+u_antialias) if edge of marker parallel to\n // edge of bounding box. If symmetric spike towards edge then multiply by\n // 1/cos(theta) where theta is angle between spike and bbox edges.\n int size_hint = int(u_size_hint + 0.5);\n if (size_hint == M_DASH)\n return vec2(v_size.x + v_linewidth + u_antialias,\n v_linewidth + u_antialias);\n else if (size_hint == M_DOT)\n return 0.25*v_size + u_antialias;\n else if (size_hint == M_DIAMOND)\n return vec2(v_size.x*(2.0/3.0) + (v_linewidth + u_antialias)*1.20185,\n v_size.y + (v_linewidth + u_antialias)*1.80278);\n else if (size_hint == M_HEX)\n return v_size + (v_linewidth + u_antialias)*vec2(2.0/sqrt(3.0), 1.0);\n else if (size_hint == M_SQUARE_PIN) // Square pin\n return v_size + (v_linewidth + u_antialias)*3.1;\n else if (size_hint == M_TRIANGLE)\n return vec2(v_size.x + (v_linewidth + u_antialias)*sqrt(3.0),\n v_size.y*(2.0/sqrt(3.0)) + (v_linewidth + u_antialias)*2.0);\n else if (size_hint == M_TRIANGLE_PIN)\n return v_size + (v_linewidth + u_antialias)*vec2(4.8, 6.0);\n else if (size_hint == M_STAR)\n return vec2(v_size.x*0.95106 + (v_linewidth + u_antialias)*3.0,\n v_size.y + (v_linewidth + u_antialias)*3.2);\n else\n return v_size + v_linewidth + u_antialias;\n}\n#else\nvec2 enclosing_size() {\n return v_size + v_linewidth + u_antialias;\n}\n#endif\n\nvoid main()\n{\n#if defined(USE_RECT) || defined(USE_ROUND_RECT) || defined(USE_HEX_TILE)\n v_size = vec2(a_width, a_height);\n#elif defined(USE_ANNULUS) || defined(USE_ANNULAR_WEDGE) || defined(USE_WEDGE)\n v_size = vec2(2.0*a_width, 2.0*a_width);\n#else\n v_size = vec2(a_width, a_width);\n#endif\n\n#ifdef USE_NGON\n v_n = a_aux;\n#endif\n\n if (a_show < 0.5 || v_size.x < 0.0 || v_size.y < 0.0 || (v_size.x == 0.0 && v_size.y == 0.0)\n#ifdef USE_NGON\n || v_n < 3.0\n#endif\n ) {\n // Do not show this marker.\n gl_Position = vec4(-2.0, -2.0, 0.0, 1.0);\n return;\n }\n\n#if
559: function _(n,i,e,t,a){t();e.default="\nprecision mediump float;\n\nconst float SQRT2 = sqrt(2.0);\nconst float SQRT3 = sqrt(3.0);\nconst float PI = 3.14159265358979323846;\n\nconst int butt_cap = 0;\nconst int round_cap = 1;\nconst int square_cap = 2;\n\nconst int miter_join = 0;\nconst int round_join = 1;\nconst int bevel_join = 2;\n\n#ifdef HATCH\nconst int hatch_dot = 1;\nconst int hatch_ring = 2;\nconst int hatch_horizontal_line = 3;\nconst int hatch_vertical_line = 4;\nconst int hatch_cross = 5;\nconst int hatch_horizontal_dash = 6;\nconst int hatch_vertical_dash = 7;\nconst int hatch_spiral = 8;\nconst int hatch_right_diagonal_line = 9;\nconst int hatch_left_diagonal_line = 10;\nconst int hatch_diagonal_cross = 11;\nconst int hatch_right_diagonal_dash = 12;\nconst int hatch_left_diagonal_dash = 13;\nconst int hatch_horizontal_wave = 14;\nconst int hatch_vertical_wave = 15;\nconst int hatch_criss_cross = 16;\n#endif\n\nuniform float u_antialias;\n\nvarying vec2 v_coords;\nvarying vec2 v_size;\n\n#ifdef USE_ANNULAR_WEDGE\nvarying float v_outer_radius;\nvarying float v_inner_radius;\nvarying float v_start_angle;\nvarying float v_end_angle;\n#endif\n\n#ifdef USE_ANNULUS\nvarying float v_outer_radius;\nvarying float v_inner_radius;\n#endif\n\n#ifdef USE_WEDGE\nvarying float v_radius;\nvarying float v_start_angle;\nvarying float v_end_angle;\n#endif\n\n#if defined(USE_CIRCLE) || defined(USE_NGON)\nvarying float v_radius;\n#endif\n\n#ifdef USE_NGON\nvarying float v_n;\n#endif\n\n#ifdef USE_ROUND_RECT\nvarying vec4 v_border_radius;\n#endif\n\nvarying float v_linewidth;\nvarying vec4 v_line_color;\nvarying vec4 v_fill_color;\nvarying float v_line_cap;\nvarying float v_line_join;\n\n#ifdef HATCH\nvarying float v_hatch_pattern;\nvarying float v_hatch_scale;\nvarying float v_hatch_weight;\nvarying vec4 v_hatch_color;\nvarying vec2 v_hatch_coords;\n#endif\n\n// Lines within the marker (dot, cross, x and y) are added at the end as they are\n// on top of the fill rather than astride it.\n#if defined(USE_CIRCLE_DOT) || defined(USE_DIAMOND_DOT) || defined(USE_DOT) || defined(USE_HEX_DOT) || defined(USE_SQUARE_DOT) || defined(USE_STAR_DOT) || defined(USE_TRIANGLE_DOT)\n #define APPEND_DOT\n#endif\n\n#if defined(USE_CIRCLE_CROSS) || defined(USE_SQUARE_CROSS)\n #define APPEND_CROSS\n#endif\n\n#ifdef USE_DIAMOND_CROSS\n #define APPEND_CROSS_2\n#endif\n\n#ifdef USE_CIRCLE_X\n #define APPEND_X\n #define APPEND_X_LEN (0.5*v_size.x)\n#endif\n\n#ifdef USE_SQUARE_X\n #define APPEND_X\n #define APPEND_X_LEN (v_size.x/SQRT2)\n#endif\n\n#ifdef USE_CIRCLE_Y\n #define APPEND_Y\n#endif\n\n#if defined(USE_ASTERISK) || defined(USE_CROSS) || defined(USE_DASH) || defined(USE_DOT) || defined(USE_X) || defined(USE_Y)\n // No fill.\n #define LINE_ONLY\n#endif\n\n#if defined(LINE_ONLY) || defined(APPEND_CROSS) || defined(APPEND_CROSS_2) || defined(APPEND_X) || defined(APPEND_Y)\nfloat end_cap_distance(in vec2 p, in vec2 end_point, in vec2 unit_direction, in int line_cap)\n{\n vec2 offset = p - end_point;\n if (line_cap == butt_cap)\n return dot(offset, unit_direction) + 0.5*v_linewidth;\n else if (line_cap == square_cap)\n return dot(offset, unit_direction);\n else if (line_cap == round_cap && dot(offset, unit_direction) > 0.0)\n return length(offset);\n else\n // Default is outside of line and should be -0.5*(v_linewidth+u_antialias) or less,\n // so here avoid the multiplication.\n return -v_linewidth-u_antialias;\n}\n#endif\n\n#if !(defined(LINE_ONLY) || defined(USE_SQUARE_PIN) || defined(USE_TRIANGLE_PIN))\n// For line join at a vec2 corner where 2 line segments meet, consider bevel points which are the 2\n// points obtained by moving half a linewidth away from the corner point in the directions normal to\n// the line segments. The line through these points is the bevel line, characterised by a vec2\n// unit_normal and offset distance from the corner point. Edge of bevel join straddles this line,\n// round join occurs outside of this line centred on the corner point. In general\n// offset = (
560: function _(t,e,r,s,_){s();const n=t(561);class a extends n.SXSYGlyphGL{constructor(t,e){super(t,e),this.glyph=e}get marker_type(){return"annular_wedge"}get outer_radius(){return this._widths}get inner_radius(){return this._heights}get start_angle(){return this._angles}get end_angle(){return this._auxs}_set_data(){super._set_data(),this.outer_radius.set_from_array(this.glyph.souter_radius),this.inner_radius.set_from_array(this.glyph.sinner_radius),"anticlock"==this.glyph.model.direction?(this.start_angle.set_from_prop(this.glyph.start_angle),this.end_angle.set_from_prop(this.glyph.end_angle)):(this.start_angle.set_from_prop(this.glyph.end_angle),this.end_angle.set_from_prop(this.glyph.start_angle))}}r.AnnularWedgeGL=a,a.__name__="AnnularWedgeGL"},
561: function _(s,e,t,i,n){i();const r=s(562),_=s(566);class h extends r.SingleMarkerGL{constructor(s,e){super(s,e),this.glyph=e}_set_data(){const s=this.nvertices,e=this._centers.get_sized_array(2*s);(0,_.interleave)(this.glyph.sx,this.glyph.sy,s,r.SingleMarkerGL.missing_point,e),this._centers.update()}}t.SXSYGlyphGL=h,h.__name__="SXSYGlyphGL"},
562: function _(s,a,t,e,_){e();const h=s(563);class l extends h.BaseMarkerGL{constructor(s,a){super(s,a),this.glyph=a}_get_visuals(){return this.glyph.visuals}draw(s,a,t){this._draw_impl(s,t,a.glglyph)}_draw_impl(s,a,t){(t.data_changed||t.data_mapped)&&(t.set_data(),t.data_changed=!1,t.data_mapped=!1),this.visuals_changed&&(this._set_visuals(),this.visuals_changed=!1);const e=t.nvertices,_=this._show.length,h=this._show.get_sized_array(e);if(s.length<e){this._show_all=!1,h.fill(0);for(let a=0;a<s.length;a++)h[s[a]]=255}else this._show_all&&_==e||(this._show_all=!0,h.fill(255));this._show.update(),this._draw_one_marker_type(t.marker_type,a,t)}}t.SingleMarkerGL=l,l.__name__="SingleMarkerGL"},
563: function _(t,e,_,i,s){i();const r=t(564),h=t(565),a=t(566);class l extends r.BaseGLGlyph{constructor(){super(...arguments),this._antialias=1.5,this._centers=new h.Float32Buffer(this.regl_wrapper),this._widths=new h.Float32Buffer(this.regl_wrapper),this._heights=new h.Float32Buffer(this.regl_wrapper),this._angles=new h.Float32Buffer(this.regl_wrapper),this._auxs=new h.Float32Buffer(this.regl_wrapper),this._border_radius=[0,0,0,0],this._border_radius_nonzero=!1,this._show=new h.Uint8Buffer(this.regl_wrapper),this._show_all=!1,this._linewidths=new h.Float32Buffer(this.regl_wrapper),this._line_caps=new h.Uint8Buffer(this.regl_wrapper),this._line_joins=new h.Uint8Buffer(this.regl_wrapper),this._line_rgba=new h.NormalizedUint8Buffer(this.regl_wrapper,4),this._fill_rgba=new h.NormalizedUint8Buffer(this.regl_wrapper,4),this._have_hatch=!1,this._hatch_patterns=new h.Uint8Buffer(this.regl_wrapper),this._hatch_scales=new h.Float32Buffer(this.regl_wrapper),this._hatch_weights=new h.Float32Buffer(this.regl_wrapper),this._hatch_rgba=new h.NormalizedUint8Buffer(this.regl_wrapper,4),this._did_set_once=!1}marker_props(t){return{width:t._widths,height:t._heights,angle:t._angles,aux:t._auxs,border_radius:t._border_radius}}get line_props(){return{linewidth:this._linewidths,line_color:this._line_rgba,line_cap:this._line_caps,line_join:this._line_joins}}get fill_props(){return{fill_color:this._fill_rgba}}get hatch_props(){return{hatch_pattern:this._hatch_patterns,hatch_scale:this._hatch_scales,hatch_weight:this._hatch_weights,hatch_color:this._hatch_rgba}}_draw_one_marker_type(t,e,_){const i={scissor:this.regl_wrapper.scissor,viewport:this.regl_wrapper.viewport,canvas_size:[e.width,e.height],size_hint:(0,a.marker_type_to_size_hint)(t),nmarkers:_.nvertices,antialias:this._antialias/e.pixel_ratio,show:this._show,center:_._centers,...this.marker_props(_),...this.line_props,...this.fill_props};if(this._have_hatch){const e={...i,...this.hatch_props};this.regl_wrapper.marker_hatch(t)(e)}else{this.regl_wrapper.marker_no_hatch(t)(i)}}set_data(){this._did_set_once||(this._did_set_once=!0,this._set_once()),this._set_data()}_set_once(){}_set_visuals(){const{line:t,fill:e,hatch:_}=this._get_visuals();this._linewidths.set_from_prop(t.line_width),this._line_caps.set_from_line_cap(t.line_cap),this._line_joins.set_from_line_join(t.line_join),this._line_rgba.set_from_color(t.line_color,t.line_alpha),this._fill_rgba.set_from_color(e.fill_color,e.fill_alpha),this._have_hatch=_.doit,this._have_hatch&&(this._hatch_patterns.set_from_hatch_pattern(_.hatch_pattern),this._hatch_scales.set_from_prop(_.hatch_scale),this._hatch_weights.set_from_prop(_.hatch_weight),this._hatch_rgba.set_from_color(_.hatch_color,_.hatch_alpha))}}_.BaseMarkerGL=l,l.__name__="BaseMarkerGL",l.missing_point=-1e4},
564: function _(e,t,a,s,i){s();class h{constructor(e,t){this.nvertices=0,this.size_changed=!1,this.data_changed=!1,this.data_mapped=!1,this.visuals_changed=!1,this.regl_wrapper=e,this.glyph=t}set_data_changed(){const{data_size:e}=this.glyph;e!=this.nvertices&&(this.nvertices=e,this.size_changed=!0),this.data_changed=!0}set_data_mapped(){this.data_mapped=!0}set_visuals_changed(){this.visuals_changed=!0}render(e,t,a){if(0==t.length)return;const{width:s,height:i}=this.glyph.renderer.plot_view.canvas_view.webgl.canvas,{pixel_ratio:h}=this.glyph.renderer.plot_view.canvas_view,_={pixel_ratio:h,width:s/h,height:i/h};this.draw(t,a,_)}}a.BaseGLGlyph=h,h.__name__="BaseGLGlyph"},
565: function _(t,e,r,a,s){a();const i=t(566),_=t(12),n=t(22);class l{constructor(t,e=1){this.regl_wrapper=t,this.is_scalar=!0,this.elements_per_primitive=e}get_array(){return(0,_.assert)(null!=this.array,"WrappedBuffer not yet initialised"),this.array}get_sized_array(t){return null!=this.array&&this.array.length==t||(this.array=this.new_array(t)),this.array}is_normalized(){return!1}get length(){return null!=this.array?this.array.length:0}set_from_array(t){const e=t.length,r=this.get_sized_array(e);for(let a=0;a<e;a++)r[a]=t[a];this.update()}set_from_prop(t){const e=t.is_Scalar()?1:t.length,r=this.get_sized_array(e);for(let a=0;a<e;a++)r[a]=t.get(a);this.update(t.is_Scalar())}set_from_scalar(t){this.get_sized_array(1).fill(t),this.update(!0)}to_attribute_config(t=0,e=1){return{buffer:this.buffer,divisor:this.is_scalar?e:1,normalized:this.is_normalized(),offset:t*this.bytes_per_element()}}to_attribute_config_nested(t=0,e=1){return{buffer:this.buffer,divisor:e*this.elements_per_primitive,normalized:this.is_normalized(),offset:this.is_scalar?0:t*this.bytes_per_element()*this.elements_per_primitive}}update(t=!1){null==this.buffer?this.buffer=this.regl_wrapper.buffer({usage:"dynamic",data:this.array}):this.buffer({data:this.array}),this.is_scalar=t}}l.__name__="WrappedBuffer";class o extends l{bytes_per_element(){return Float32Array.BYTES_PER_ELEMENT}new_array(t){return new Float32Array(t)}}r.Float32Buffer=o,o.__name__="Float32Buffer";class h extends l{bytes_per_element(){return Uint8Array.BYTES_PER_ELEMENT}new_array(t){return new Uint8Array(t)}set_from_color(t,e){const r=t.is_Scalar()&&e.is_Scalar(),a=r?1:t.length,s=this.get_sized_array(4*a);for(let r=0;r<a;r++){const[a,i,_,l]=(0,n.color2rgba)(t.get(r),e.get(r));s[4*r]=a,s[4*r+1]=i,s[4*r+2]=_,s[4*r+3]=l}this.update(r)}set_from_hatch_pattern(t){const e=t.is_Scalar()?1:t.length,r=this.get_sized_array(e);for(let a=0;a<e;a++)r[a]=(0,i.hatch_pattern_to_index)(t.get(a));this.update(t.is_Scalar())}set_from_line_cap(t){const e=t.is_Scalar()?1:t.length,r=this.get_sized_array(e);for(let a=0;a<e;a++)r[a]=i.cap_lookup[t.get(a)];this.update(t.is_Scalar())}set_from_line_join(t){const e=t.is_Scalar()?1:t.length,r=this.get_sized_array(e);for(let a=0;a<e;a++)r[a]=i.join_lookup[t.get(a)];this.update(t.is_Scalar())}}r.Uint8Buffer=h,h.__name__="Uint8Buffer";class f extends h{is_normalized(){return!0}}r.NormalizedUint8Buffer=f,f.__name__="NormalizedUint8Buffer"},
566: function _(e,a,t,n,r){n(),t.interleave=function(e,a,t,n,r){for(let i=0;i<t;i++){const t=e[i],s=a[i];isFinite(t+s)?(r[2*i]=t,r[2*i+1]=s):(r[2*i]=n,r[2*i+1]=n)}},t.hatch_pattern_to_index=function(e){return s[i.hatch_aliases[e]??e]??0},t.marker_type_to_size_hint=function(e){switch(e){case"dash":return 1;case"dot":return 2;case"diamond":case"diamond_cross":case"diamond_dot":return 3;case"hex":case"hex_tile":return 4;case"square_pin":return 5;case"inverted_triangle":case"ngon":case"triangle":case"triangle_dot":return 6;case"triangle_pin":return 7;case"star":case"star_dot":return 8;default:return 0}};const i=e(93);t.cap_lookup={butt:0,round:1,square:2},t.join_lookup={miter:0,round:1,bevel:2};const s={blank:0,dot:1,ring:2,horizontal_line:3,vertical_line:4,cross:5,horizontal_dash:6,vertical_dash:7,spiral:8,right_diagonal_line:9,left_diagonal_line:10,diagonal_cross:11,right_diagonal_dash:12,left_diagonal_dash:13,horizontal_wave:14,vertical_wave:15,criss_cross:16}},
567: function _(s,t,r,e,_){e();const a=s(561);class n extends a.SXSYGlyphGL{constructor(s,t){super(s,t),this.glyph=t}get marker_type(){return"annulus"}get outer_radius(){return this._widths}get inner_radius(){return this._heights}_set_data(){super._set_data(),this.outer_radius.set_from_array(this.glyph.souter_radius),this.inner_radius.set_from_array(this.glyph.sinner_radius)}_set_once(){super._set_once(),this._angles.set_from_scalar(0),this._auxs.set_from_scalar(0)}}r.AnnulusGL=n,n.__name__="AnnulusGL"},
568: function _(s,e,i,t,_){t();const h=s(564),l=s(565),n=s(88);class a extends h.BaseGLGlyph{constructor(s,e){super(s,e),this._antialias=1.5,this._miter_limit=10,this._linewidth=new l.Float32Buffer(this.regl_wrapper),this._line_color=new l.NormalizedUint8Buffer(this.regl_wrapper,4),this._line_cap=new l.Uint8Buffer(this.regl_wrapper),this._line_join=new l.Uint8Buffer(this.regl_wrapper),this._is_dashed=!1,this._dash_tex=[],this.glyph=e}_draw_single(s,e,i,t,_,h,l=null){const n={scissor:this.regl_wrapper.scissor,viewport:this.regl_wrapper.viewport,canvas_size:[e.width,e.height],antialias:this._antialias/e.pixel_ratio,miter_limit:this._miter_limit,points:s._points,show:l??s._show,nsegments:_,linewidth:this._linewidth,line_color:this._line_color,line_cap:this._line_cap,line_join:this._line_join,framebuffer:h,point_offset:t,line_offset:i};if(this._is_dashed&&null!=this._dash_tex[i]){const e={...n,length_so_far:s._length_so_far,dash_tex:this._dash_tex[i],dash_tex_info:this._dash_tex_info,dash_scale:this._dash_scale,dash_offset:this._dash_offset};this.regl_wrapper.dashed_line()(e)}else this.regl_wrapper.solid_line()(n)}_set_length_single(s,e,i){const t=s.length;let _=0;for(let h=0;h<t;h++)s[h]=_,1==i[h+1]?_+=Math.sqrt((e[2*h+4]-e[2*h+2])**2+(e[2*h+5]-e[2*h+3])**2):_=0}_set_points_single(s,e,i){const t=s.length/2-2,_=t>2&&e[0]==e[t-1]&&i[0]==i[t-1]&&isFinite(e[0]+i[0]);for(let _=1;_<t+1;_++)s[2*_]=e[_-1],s[2*_+1]=i[_-1];_?(s[0]=s[2*t-2],s[1]=s[2*t-1],s[2*t+2]=s[4],s[2*t+3]=s[5]):(s[0]=0,s[1]=0,s[2*t+2]=0,s[2*t+3]=0)}_set_show_single(s,e){const i=e.length/2-2;let t=isFinite(e[2]+e[3]);for(let _=1;_<i;_++){const i=isFinite(e[2*_+2]+e[2*_+3]);s[_]=t&&i?1:0,t=i}i>2&&e[0]==e[2*i-2]&&e[1]==e[2*i-1]?(s[0]=s[i-1],s[i]=s[1]):(s[0]=0,s[i]=0)}_set_visuals(){const s=this._get_visuals();this._line_color.set_from_color(s.line_color,s.line_alpha),this._linewidth.set_from_prop(s.line_width),this._line_cap.set_from_line_cap(s.line_cap),this._line_join.set_from_line_join(s.line_join);const{line_dash:e}=s;if(this._is_dashed=!(e.is_Scalar()&&0==e.get(0).length),this._is_dashed){null==this._dash_offset&&(this._dash_offset=new l.Float32Buffer(this.regl_wrapper)),this._dash_offset.set_from_prop(s.line_dash_offset);const i=e.length;null==this._dash_tex_info&&(this._dash_tex_info=new l.Float32Buffer(this.regl_wrapper,4));const t=this._dash_tex_info.get_sized_array(4*i);null==this._dash_scale&&(this._dash_scale=new l.Float32Buffer(this.regl_wrapper));const _=this._dash_scale.get_sized_array(i);for(let s=0;s<i;s++){const i=(0,n.resolve_line_dash)(e.get(s));if(i.length>0){const[e,h,l]=this.regl_wrapper.get_dash(i);this._dash_tex.push(h);for(let i=0;i<4;i++)t[4*s+i]=e[i];_[s]=l}else this._dash_tex.push(null),t.fill(0,4*s,4*(s+1)),_[s]=0}this._dash_tex_info.update(),this._dash_scale.update()}}}i.BaseLineGL=a,a.__name__="BaseLineGL"},
569: function _(e,s,r,t,_){t();const c=e(570);class n extends c.RadialGL{constructor(e,s){super(e,s),this.glyph=s}get marker_type(){return"circle"}_set_once(){super._set_once(),this._angles.set_from_scalar(0)}}r.CircleGL=n,n.__name__="CircleGL"},
570: function _(s,t,e,_,a){_();const i=s(561),r=s(13);class h extends i.SXSYGlyphGL{constructor(s,t){super(s,t),this.glyph=t}get size(){return this._widths}_set_data(){super._set_data(),this.size.set_from_array((0,r.mul)(this.glyph.sradius,2))}_set_once(){super._set_once(),this._heights.set_from_scalar(0)}}e.RadialGL=h,h.__name__="RadialGL"},
571: function _(s,t,_,e,h){e();const a=s(561);class r extends a.SXSYGlyphGL{constructor(s,t){super(s,t),this.glyph=t}get marker_type(){return"hex_tile"}_set_data(){super._set_data(),"pointytop"==this.glyph.model.orientation?(this._angles.set_from_scalar(.5*Math.PI),this._widths.set_from_scalar(2*this.glyph.svy[0]),this._heights.set_from_scalar(4*this.glyph.svx[4]/Math.sqrt(3))):(this._angles.set_from_scalar(0),this._widths.set_from_scalar(2*this.glyph.svx[0]),this._heights.set_from_scalar(4*this.glyph.svy[4]/Math.sqrt(3)))}_set_once(){super._set_once(),this._auxs.set_from_scalar(0)}}_.HexTileGL=r,r.__name__="HexTileGL"},
572: function _(t,e,s,a,i){a();const n=t(564),_=t(565),h=t(12);class l extends n.BaseGLGlyph{constructor(t,e){super(t,e),this._tex=[],this._bounds=[],this._image_changed=!1,this.glyph=e}draw(t,e,s){const a=e.glglyph;(a.data_changed||a.data_mapped)&&a._set_data(),(a._image_changed||a.data_changed)&&a._set_image(),a.data_changed=!1,a.data_mapped=!1,a._image_changed=!1;const{global_alpha:i}=this.glyph.visuals.image;for(const e of t){if(null==a._tex[e]||null==a._bounds[e])continue;const t={scissor:this.regl_wrapper.scissor,viewport:this.regl_wrapper.viewport,canvas_size:[s.width,s.height],bounds:a._bounds[e],tex:a._tex[e],global_alpha:i.get(e)};this.regl_wrapper.image()(t)}}set_image_changed(){this._image_changed=!0}_set_data(){const{image:t}=this.glyph,e=t.length;this._bounds.length!=e&&(this._bounds=Array(e).fill(null));for(let t=0;t<e;t++){const{sx:e,sy:s,sdw:a,sdh:i,xy_anchor:n,xy_scale:h,xy_sign:l}=this.glyph,g=e[t],o=s[t],d=a[t],r=i[t];if(!isFinite(g+o+d+r)){this._bounds[t]=null;continue}null==this._bounds[t]&&(this._bounds[t]=new _.Float32Buffer(this.regl_wrapper));const u=this._bounds[t].get_sized_array(4);u[0]=e[t]+a[t]*(.5*(1-h.x)-n.x)*l.x,u[1]=s[t]+i[t]*(.5*(1-h.y)-n.y)*l.y,u[2]=u[0]+a[t]*h.x*l.x,u[3]=u[1]+i[t]*h.y*l.y,this._bounds[t].update()}}_set_image(){const{image:t,image_data:e}=this.glyph,s=t.length;(0,h.assert)(null!=e),this._tex.length!=s&&(this._tex=Array(s).fill(null));for(let t=0;t<s;t++){const s=e[t];if(null==s){this._tex[t]=null;continue}const a={width:s.width,height:s.height,data:s,format:"rgba",type:"uint8"};null==this._tex[t]?this._tex[t]=this.regl_wrapper.texture(a):this._tex[t](a)}}}s.ImageGL=l,l.__name__="ImageGL"},
573: function _(t,s,e,i,n){i();const h=t(565),_=t(574);class l extends _.SingleLineGL{constructor(t,s){super(t,s),this.glyph=s}draw(t,s,e){this._draw_impl(t,e,s.glglyph)}_get_show_buffer(t,s){const e=s._show;let i=e;if(t.length!=e.length-1){const s=this.glyph.parent.nonselection_glyph==this.glyph,n=e.length,_=e.get_sized_array(n);null==this._show&&(this._show=new h.Uint8Buffer(this.regl_wrapper));const l=this._show.get_sized_array(n);l.fill(0);let r=t[0];s&&r>0&&(l[r]=_[r]);for(let e=1;e<t.length;e++){const i=t[e];i==r+1?l[i]=_[i]:s&&(l[r+1]=_[r+1],l[i]=_[i]),r=i}s&&r!=n-2&&(l[r+1]=_[r+1]),this._show.update(),i=this._show}return i}_get_visuals(){return this.glyph.visuals.line}_set_data_points(){const t=this.glyph.sx,s=this.glyph.sy,e=t.length;null==this._points&&(this._points=new h.Float32Buffer(this.regl_wrapper));const i=this._points.get_sized_array(2*(e+2));return this._set_points_single(i,t,s),this._points.update(),i}}e.LineGL=l,l.__name__="LineGL"},
574: function _(s,t,_,e,a){e();const h=s(568),n=s(565);class i extends h.BaseLineGL{constructor(s,t){super(s,t),this.glyph=t}_draw_impl(s,t,_){this.visuals_changed&&(this._set_visuals(),this.visuals_changed=!1);const e=_.data_changed||_.data_mapped;e&&_._set_data(_.data_changed),(e&&_._is_dashed||this._is_dashed)&&_._set_length(),e&&(_.data_changed=!1,_.data_mapped=!1);const a=this._get_show_buffer(s,_),h=_._points.length/2-2-1;this._draw_single(_,t,0,0,h,null,a)}_set_data(s){const t=this._set_data_points();if(s){const s=t.length/2-2;null==this._show&&(this._show=new n.Uint8Buffer(this.regl_wrapper));const _=this._show.get_sized_array(s+1);this._set_show_single(_,t),this._show.update()}}_set_length(){const s=this._points.get_array(),t=this._show.get_array(),_=s.length/2-2;null==this._length_so_far&&(this._length_so_far=new n.Float32Buffer(this.regl_wrapper));const e=this._length_so_far.get_sized_array(_-1);this._set_length_single(e,s,t),this._length_so_far.update()}}_.SingleLineGL=i,i.__name__="SingleLineGL"},
575: function _(t,s,r,e,_){e();const i=t(562),{abs:o}=Math;class a extends i.SingleMarkerGL{constructor(t,s){super(t,s),this.glyph=s}get marker_type(){return this._border_radius_nonzero?"round_rect":"rect"}_set_data(){const t=this.nvertices,s=this._centers.get_sized_array(2*t),r=this._widths.get_sized_array(t),e=this._heights.get_sized_array(t),{sleft:_,sright:a,stop:h,sbottom:n}=this.glyph,{missing_point:d}=i.SingleMarkerGL;for(let i=0;i<t;i++){const t=_[i],u=a[i],c=h[i],g=n[i];isFinite(t+u+c+g)?(s[2*i]=(t+u)/2,s[2*i+1]=(c+g)/2,r[i]=o(u-t),e[i]=o(c-g)):(s[2*i]=d,s[2*i+1]=d,r[i]=d,e[i]=d)}if(this._centers.update(),this._widths.update(),this._heights.update(),this._angles.set_from_scalar(0),null!=this.glyph.border_radius){const{top_left:t,top_right:s,bottom_right:r,bottom_left:e}=this.glyph.border_radius;this._border_radius=[t,s,r,e],this._border_radius_nonzero=Math.max(...this._border_radius)>0}else this._border_radius=[0,0,0,0],this._border_radius_nonzero=!1}_set_once(){super._set_once(),this._auxs.set_from_scalar(0)}}r.LRTBGL=a,a.__name__="LRTBGL"},
576: function _(s,t,e,a,_){a();const h=s(568),i=s(565);class r extends h.BaseLineGL{constructor(s,t){super(s,t),this.glyph=t}draw(s,t,e){this.visuals_changed&&(this._set_visuals(),this.visuals_changed=!1);const a=t.glglyph,_=a.data_changed||a.data_mapped;_&&a._set_data(a.data_changed),(_&&a._is_dashed||this._is_dashed)&&a._set_length(),_&&(a.data_changed=!1,a.data_mapped=!1);const{data_size:h}=this.glyph;let i=null,r=null;h>1&&([i,r]=this.regl_wrapper.framebuffer_and_texture);let l=0,n=-1;for(const _ of s){for(let s=n+1;s<_;s++){l+=2*(t.sxs.get(s).length+2)}const s=t.sxs.get(_).length,h=s-1;if(null!=i&&this.regl_wrapper.clear_framebuffer(i),this._draw_single(a,e,_,l,h,i),null!=i){const s={scissor:this.regl_wrapper.scissor,viewport:this.regl_wrapper.viewport,framebuffer_tex:r};this.regl_wrapper.accumulate()(s)}l+=2*(s+2),n=_}}_get_visuals(){return this.glyph.visuals.line}_set_data(s){const t=this.glyph.data_size,e=this.glyph.sxs.data.length;null==this._points&&(this._points=new i.Float32Buffer(this.regl_wrapper));const a=this._points.get_sized_array(2*(e+2*t));let _=0;for(let s=0;s<t;s++){const t=this.glyph.sxs.get(s),e=this.glyph.sys.get(s),h=t.length,i=a.subarray(_,_+2*(h+2));this._set_points_single(i,t,e),_+=2*(h+2)}if(this._points.update(),s){null==this._show&&(this._show=new i.Uint8Buffer(this.regl_wrapper));const s=this._show.get_sized_array(e+t);let _=0,h=0;for(let e=0;e<t;e++){const t=this.glyph.sxs.get(e).length,i=a.subarray(_,_+2*(t+2)),r=s.subarray(h,h+t+1);this._set_show_single(r,i),_+=2*(t+2),h+=t+1}this._show.update()}}_set_length(){const s=this.glyph.data_size,t=this.glyph.sxs.data.length,e=this._points.get_array(),a=this._show.get_array();null==this._length_so_far&&(this._length_so_far=new i.Float32Buffer(this.regl_wrapper));const _=this._length_so_far.get_sized_array(t-s);let h=0,r=0,l=0;for(let t=0;t<s;t++){const s=this.glyph.sxs.get(t).length,i=s-1,n=e.subarray(h,h+2*(s+2)),g=a.subarray(r,r+s+1),o=_.subarray(l,l+i);this._set_length_single(o,n,g),h+=2*(s+2),r+=s+1,l+=i}this._length_so_far.update()}}e.MultiLineGL=r,r.__name__="MultiLineGL"},
577: function _(s,t,e,_,a){_();const i=s(563),h=s(566);class r extends i.BaseMarkerGL{constructor(s,t){super(s,t),this.glyph=t}draw(s,t,e){const _=t.glglyph;(_.data_changed||_.data_mapped)&&(_.set_data(),_.data_changed=!1,_.data_mapped=!1),this.visuals_changed&&(this._set_visuals(),this.visuals_changed=!1);const a=_.nvertices,i=_._unique_marker_types.length;for(const t of _._unique_marker_types){if(null==t)continue;let h=a;const r=this._show.length,l=this._show.get_sized_array(a);if(i>1||s.length<a){this._show_all=!1,l.fill(0),h=0;for(const e of s)1!=i&&_._marker_types.get(e)!=t||(l[e]=255,h++)}else this._show_all&&r==a||(this._show_all=!0,l.fill(255));this._show.update(),0!=h&&this._draw_one_marker_type(t,e,_)}}_get_visuals(){return this.glyph.visuals}_set_data(){const s=this.nvertices,t=this._centers.get_sized_array(2*s);(0,h.interleave)(this.glyph.sx,this.glyph.sy,s,i.BaseMarkerGL.missing_point,t),this._centers.update(),this._widths.set_from_prop(this.glyph.size),this._angles.set_from_prop(this.glyph.angle),this._marker_types=this.glyph.marker,this._unique_marker_types=[...new Set(this._marker_types)]}_set_once(){super._set_once(),this._heights.set_from_scalar(0),this._auxs.set_from_scalar(0)}}e.MultiMarkerGL=r,r.__name__="MultiMarkerGL"},
578: function _(t,s,_,e,n){e();const a=t(570);class r extends a.RadialGL{constructor(t,s){super(t,s),this.glyph=s}get marker_type(){return"ngon"}_set_data(){super._set_data(),this._angles.set_from_prop(this.glyph.angle),this._auxs.set_from_prop(this.glyph.n)}}_.NgonGL=r,r.__name__="NgonGL"},
579: function _(t,s,_,r,e){r();const h=t(561);class o extends h.SXSYGlyphGL{constructor(t,s){super(t,s),this.glyph=s}get marker_type(){return this._border_radius_nonzero?"round_rect":"rect"}_set_data(){super._set_data(),this._widths.set_from_array(this.glyph.swidth),this._heights.set_from_array(this.glyph.sheight),this._angles.set_from_prop(this.glyph.angle);const{top_left:t,top_right:s,bottom_right:_,bottom_left:r}=this.glyph.border_radius;this._border_radius=[t,s,_,r],this._border_radius_nonzero=Math.max(...this._border_radius)>0}_set_once(){super._set_once(),this._auxs.set_from_scalar(0)}}_.RectGL=o,o.__name__="RectGL"},
580: function _(e,t,s,i,a){i();const n=e(565),r=e(574),l=e(12);class _ extends r.SingleLineGL{constructor(e,t){super(e,t),this.glyph=t}draw(e,t,s){this._draw_impl(e,s,t.glglyph)}_get_show_buffer(e,t){return t._show}_get_visuals(){return this.glyph.visuals.line}_set_data_points(){const e=this.glyph.sx,t=this.glyph.sy,s=this.glyph.model.mode;let i=e.length;const a=i>2&&e[0]==e[i-1]&&t[0]==t[i-1]&&isFinite(e[0])&&isFinite(t[0]),r="center"==s?2*i:2*i-1;null==this._points&&(this._points=new n.Float32Buffer(this.regl_wrapper));const _=this._points.get_sized_array(2*(r+2));let h=isFinite(e[0]+t[0]),o=2;"center"==s&&(_[o++]=h?e[0]:NaN,_[o++]=t[0]);for(let a=0;a<i-1;a++){const n=isFinite(e[a+1]+t[a+1]);switch(s){case"before":_[o++]=h?e[a]:NaN,_[o++]=t[a],a<i-1&&(_[o++]=h&&n?e[a]:NaN,_[o++]=t[a+1]);break;case"after":_[o++]=h?e[a]:NaN,_[o++]=t[a],a<i-1&&(_[o++]=h&&n?e[a+1]:NaN,_[o++]=t[a]);break;case"center":if(h&&n){const s=(e[a]+e[a+1])/2;_[o++]=s,_[o++]=t[a],_[o++]=s,_[o++]=t[a+1]}else _[o++]=h?e[a]:NaN,_[o++]=t[a],_[o++]=n?e[a+1]:NaN,_[o++]=t[a+1];break;default:(0,l.unreachable)()}h=n}return _[o++]=h?e[i-1]:NaN,_[o++]=h?t[i-1]:NaN,(0,l.assert)(o==2*r+2),i=r,a?(_[0]=_[2*i-2],_[1]=_[2*i-1],_[2*i+2]=_[4],_[2*i+3]=_[5]):(_[0]=0,_[1]=0,_[2*i+2]=0,_[2*i+3]=0),this._points.update(),_}}s.StepGL=_,_.__name__="StepGL"},
581: function _(t,e,s,_,r){_();const a=t(561);class n extends a.SXSYGlyphGL{constructor(t,e){super(t,e),this.glyph=e}get marker_type(){return"wedge"}get radius(){return this._widths}get start_angle(){return this._angles}get end_angle(){return this._auxs}_set_data(){super._set_data(),this.radius.set_from_array(this.glyph.sradius),"anticlock"==this.glyph.model.direction?(this.start_angle.set_from_prop(this.glyph.start_angle),this.end_angle.set_from_prop(this.glyph.end_angle)):(this.start_angle.set_from_prop(this.glyph.end_angle),this.end_angle.set_from_prop(this.glyph.start_angle))}_set_once(){super._set_once(),this._heights.set_from_scalar(0)}}s.WedgeGL=n,n.__name__="WedgeGL"},
}, 546, {"models/glyphs/webgl/main":546,"models/glyphs/webgl/index":547,"models/glyphs/webgl/regl_wrap":548,"models/glyphs/webgl/dash_cache":550,"models/glyphs/webgl/utils/math":551,"models/glyphs/webgl/accumulate.vert":552,"models/glyphs/webgl/accumulate.frag":553,"models/glyphs/webgl/image.vert":554,"models/glyphs/webgl/image.frag":555,"models/glyphs/webgl/regl_line.vert":556,"models/glyphs/webgl/regl_line.frag":557,"models/glyphs/webgl/marker.vert":558,"models/glyphs/webgl/marker.frag":559,"models/glyphs/webgl/annular_wedge":560,"models/glyphs/webgl/sxsy":561,"models/glyphs/webgl/single_marker":562,"models/glyphs/webgl/base_marker":563,"models/glyphs/webgl/base":564,"models/glyphs/webgl/buffer":565,"models/glyphs/webgl/webgl_utils":566,"models/glyphs/webgl/annulus":567,"models/glyphs/webgl/base_line":568,"models/glyphs/webgl/circle":569,"models/glyphs/webgl/radial":570,"models/glyphs/webgl/hex_tile":571,"models/glyphs/webgl/image":572,"models/glyphs/webgl/line_gl":573,"models/glyphs/webgl/single_line":574,"models/glyphs/webgl/lrtb":575,"models/glyphs/webgl/multi_line":576,"models/glyphs/webgl/multi_marker":577,"models/glyphs/webgl/ngon":578,"models/glyphs/webgl/rect":579,"models/glyphs/webgl/step":580,"models/glyphs/webgl/wedge":581}, {});});