@holoviz/geoviews 1.12.0-a.1 → 1.12.0-a.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
+ 'use strict';
1
2
  /*!
2
- * Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors
3
+ * Copyright (c) Anaconda, Inc., and Bokeh Contributors
3
4
  * All rights reserved.
4
5
  *
5
6
  * Redistribution and use in source and binary forms, with or without modification,
@@ -33,19 +34,19 @@
33
34
  })(this, function(Bokeh, version) {
34
35
  let define;
35
36
  return (function(modules, entry, aliases, externals) {
36
- const bokeh = typeof Bokeh !== "undefined" && (version != null ? Bokeh[version] : Bokeh);
37
+ const bokeh = typeof Bokeh !== "undefined" ? (version != null ? Bokeh[version] : Bokeh) : null;
37
38
  if (bokeh != null) {
38
39
  return bokeh.register_plugin(modules, entry, aliases);
39
40
  } else {
40
- throw new Error("Cannot find Bokeh " + version + ". You have to load it prior to loading plugins.");
41
+ throw new Error("Cannot find Bokeh" + (version != null ? " " + version : "") + ". You have to load it prior to loading plugins.");
41
42
  }
42
43
  })
43
44
  ({
44
45
  "c764d38756": function _(e,s,o,t,b){t();const i=e("tslib").__importStar(e("b4555bea44"));o.GeoViews=i;(0,e("@bokehjs/base").register_models)(i)},
45
- "b4555bea44": function _(o,e,l,t,c){t(),c("CheckpointTool",o("1d7c6c8516").CheckpointTool),c("ClearTool",o("1c15765006").ClearTool),c("PolyVertexDrawTool",o("cddc7627cc").PolyVertexDrawTool),c("PolyVertexEditTool",o("8837add128").PolyVertexEditTool),c("RestoreTool",o("92294e6ad2").RestoreTool)},
46
- "1d7c6c8516": function _(o,e,s,t,c){var n;t();const i=o("@bokehjs/core/util/array"),r=o("@bokehjs/models/tools/actions/action_tool"),l=o("@bokehjs/models/sources/column_data_source"),a=o("@bokehjs/styles/icons.css");class _ extends r.ActionToolView{doit(){const o=this.model.sources;for(const e of o){e.buffer||(e.buffer=[]);let o={};for(const s in e.data){const t=e.data[s],c=[];for(const o of t)Array.isArray(o)||ArrayBuffer.isView(o)?c.push((0,i.copy)(o)):c.push(o);o[s]=c}e.buffer.push(o)}}}s.CheckpointToolView=_,_.__name__="CheckpointToolView";class u extends r.ActionTool{constructor(o){super(o),this.tool_name="Checkpoint",this.tool_icon=a.tool_icon_save}}s.CheckpointTool=u,n=u,u.__name__="CheckpointTool",u.__module__="geoviews.models.custom_tools",n.prototype.default_view=_,n.define((({Array:o,Ref:e})=>({sources:[o(e(l.ColumnDataSource)),[]]})))},
47
- "1c15765006": function _(o,e,s,t,a){var l;t();const c=o("@bokehjs/models/tools/actions/action_tool"),n=o("@bokehjs/models/sources/column_data_source"),r=o("@bokehjs/styles/icons.css");class i extends c.ActionToolView{doit(){for(var o of this.model.sources){for(const e in o.data)o.data[e]=[];o.change.emit(),o.properties.data.change.emit()}}}s.ClearToolView=i,i.__name__="ClearToolView";class _ extends c.ActionTool{constructor(o){super(o),this.tool_name="Clear data",this.tool_icon=r.tool_icon_reset}}s.ClearTool=_,l=_,_.__name__="ClearTool",_.__module__="geoviews.models.custom_tools",l.prototype.default_view=i,l.define((({Array:o,Ref:e})=>({sources:[o(e(n.ColumnDataSource)),[]]})))},
48
- "cddc7627cc": function _(e,t,s,r,o){var l;r();const i=e("@bokehjs/core/util/object"),d=e("@bokehjs/core/util/types"),a=e("@bokehjs/models/tools/edit/poly_draw_tool");class n extends a.PolyDrawToolView{_split_path(e,t){for(let s=0;s<this.model.renderers.length;s++){const r=this.model.renderers[s],o=r.glyph,l=r.data_source,[i,a]=[o.xs.field,o.ys.field],n=l.data[i],_=l.data[a];for(let s=0;s<n.length;s++){let r=n[s];(0,d.isArray)(r)||(r=Array.from(r),l.data[i][s]=r);let o=_[s];(0,d.isArray)(o)||(o=Array.from(o),l.data[a][s]=o);for(let d=0;d<r.length;d++)if(r[d]==e&&o[d]==t&&0!=d&&d!=r.length-1){n.splice(s+1,0,r.slice(d)),_.splice(s+1,0,o.slice(d)),r.splice(d+1),o.splice(d+1);for(const e of l.columns())e!==i&&e!=a&&l.data[e].splice(s+1,0,l.data[e][s]);return}}}}_snap_to_vertex(e,t,s){if(this.model.vertex_renderer){const r=this._select_event(e,"replace",[this.model.vertex_renderer]),o=this.model.vertex_renderer.data_source,l=this.model.vertex_renderer.glyph,[i,d]=[l.x.field,l.y.field];if(r.length){const r=o.selected.indices[0];i&&(t=o.data[i][r]),d&&(s=o.data[d][r]),"mousemove"!=e.type&&this._split_path(t,s),o.selection_manager.clear()}}return[t,s]}_set_vertices(e,t,s){if(null==this.model.vertex_renderer)return;const r=this.model.vertex_renderer.glyph,o=this.model.vertex_renderer.data_source,[l,a]=[r.x.field,r.y.field];if(l&&((0,d.isArray)(e)?o.data[l]=e:r.x={value:e}),a&&((0,d.isArray)(t)?o.data[a]=t:r.y={value:t}),null!=s)for(const e of(0,i.keys)(s))o.data[e]=s[e],r[e]={field:e};else for(const e of o.columns())o.data[e]=[];this._emit_cds_changes(o,!0,!0,!1)}_show_vertices(){if(!this.model.active)return;const e=[],t=[],s={};for(const e of(0,i.keys)(this.model.end_style))s[e]=[];for(let r=0;r<this.model.renderers.length;r++){const o=this.model.renderers[r],l=o.data_source,d=o.glyph,[a,n]=[d.xs.field,d.ys.field];for(const t of l.get_array(a)){Array.prototype.push.apply(e,t);for(const e of(0,i.keys)(this.model.end_style))s[e].push(this.model.end_style[e]);for(const e of(0,i.keys)(this.model.node_style))for(let r=0;r<t.length-2;r++)s[e].push(this.model.node_style[e]);for(const e of(0,i.keys)(this.model.end_style))s[e].push(this.model.end_style[e])}for(const e of l.get_array(n))Array.prototype.push.apply(t,e);if(this._drawing&&r==this.model.renderers.length-1){e.splice(e.length-1,1),t.splice(t.length-1,1);for(const e of(0,i.keys)(s))s[e].splice(s[e].length-1,1)}}this._set_vertices(e,t,s)}_remove(){const e=this.model.renderers[0],t=e.data_source,s=e.glyph,[r,o]=[s.xs.field,s.ys.field];if(r){const e=t.data[r].length-1,s=t.get_array(r)[e];s.splice(s.length-1,1),1==s.length&&t.data[r].splice(e,1)}if(o){const e=t.data[o].length-1,s=t.get_array(o)[e];s.splice(s.length-1,1),1==s.length&&t.data[o].splice(e,1)}this._emit_cds_changes(t),this._drawing=!1,this._show_vertices()}}s.PolyVertexDrawToolView=n,n.__name__="PolyVertexDrawToolView";class _ extends a.PolyDrawTool{constructor(e){super(e)}}s.PolyVertexDrawTool=_,l=_,_.__name__="PolyVertexDrawTool",_.__module__="geoviews.models.custom_tools",l.prototype.default_view=n,l.define((({Any:e})=>({end_style:[e,{}],node_style:[e,{}]})))},
49
- "8837add128": function _(e,t,s,r,i){var d;r();const o=e("@bokehjs/core/util/object"),_=e("@bokehjs/core/util/types"),l=e("@bokehjs/models/tools/edit/poly_edit_tool");class n extends l.PolyEditToolView{deactivate(){this._hide_vertices(),this._selected_renderer&&(this._drawing&&(this._remove_vertex(),this._drawing=!1),this._emit_cds_changes(this._selected_renderer.data_source,!1,!0,!1))}_pan(e){if(null==this._basepoint||null==this.model.vertex_renderer)return;const t=this._drag_points(e,[this.model.vertex_renderer]);e.modifiers.shift||this._move_linked(t),this._selected_renderer&&this._selected_renderer.data_source.change.emit()}_pan_end(e){if(null==this._basepoint||null==this.model.vertex_renderer)return;const t=this._drag_points(e,[this.model.vertex_renderer]);e.modifiers.shift||this._move_linked(t),this._emit_cds_changes(this.model.vertex_renderer.data_source,!1,!0,!0),this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source),this._basepoint=null}_drag_points(e,t){if(null==this._basepoint)return[];const[s,r]=this._basepoint,i=[];for(const d of t){const t=this._map_drag(s,r,d),o=this._map_drag(e.sx,e.sy,d);if(null==o||null==t)continue;const[_,l]=o,[n,a]=t,[c,h]=[_-n,l-a],u=d.glyph,f=d.data_source,[m,y]=[u.x.field,u.y.field];for(const e of f.selected.indices){const t=[];m&&(t.push(f.data[m][e]),f.data[m][e]+=c),y&&(t.push(f.data[y][e]),f.data[y][e]+=h),t.push(c),t.push(h),i.push(t)}f.change.emit()}return this._basepoint=[e.sx,e.sy],i}_set_vertices(e,t,s){if(null==this.model.vertex_renderer)return;const r=this.model.vertex_renderer.glyph,i=this.model.vertex_renderer.data_source,[d,l]=[r.x.field,r.y.field];if(d&&((0,_.isArray)(e)?i.data[d]=e:r.x={value:e}),l&&((0,_.isArray)(t)?i.data[l]=t:r.y={value:t}),null!=s)for(const e of(0,o.keys)(s))i.data[e]=s[e],r[e]={field:e};else for(const e of i.columns())i.data[e]=[];this._emit_cds_changes(i,!0,!0,!1)}_move_linked(e){if(!this._selected_renderer)return;const t=this._selected_renderer,s=t.glyph,r=t.data_source,[i,d]=[s.xs.field,s.ys.field],o=r.data[i],_=r.data[d];for(const t of e){const[e,s,r,i]=t;for(let t=0;t<o.length;t++){const d=o[t],l=_[t];for(let t=0;t<d.length;t++)d[t]==e&&l[t]==s&&(d[t]+=r,l[t]+=i)}}}_tap(e){if(null==this.model.vertex_renderer)return;const t=this.model.vertex_renderer,s=this._map_drag(e.sx,e.sy,t);if(null!=s){if(this._drawing&&this._selected_renderer){let[r,i]=s;const d=t.data_source,o=t.glyph,[_,l]=[o.x.field,o.y.field],n=d.selected.indices;[r,i]=this._snap_to_vertex(e,r,i);const a=n[0];if(d.selected.indices=[a+1],_){const e=d.get_array(_),t=e[a];e[a]=r,e.splice(a+1,0,t)}if(l){const e=d.get_array(l),t=e[a];e[a]=i,e.splice(a+1,0,t)}return d.change.emit(),void this._emit_cds_changes(this._selected_renderer.data_source,!0,!1,!0)}this._select_event(e,this._select_mode(e),[t])}}_show_vertices(e){if(!this.model.active)return;const t=this._select_event(e,"replace",this.model.renderers);if(!t.length)return this._hide_vertices(),this._selected_renderer=null,void(this._drawing=!1);const s=t[0],r=s.glyph,i=s.data_source,d=i.selected.indices[0],[l,n]=[r.xs.field,r.ys.field];let a,c;l?(a=i.data[l][d],(0,_.isArray)(a)||(i.data[l][d]=a=Array.from(a))):a=r.xs.value,n?(c=i.data[n][d],(0,_.isArray)(c)||(i.data[n][d]=c=Array.from(c))):c=r.ys.value;const h={};for(const e of(0,o.keys)(this.model.end_style))h[e]=[this.model.end_style[e]];for(const e of(0,o.keys)(this.model.node_style))for(let t=0;t<a.length-2;t++)h[e].push(this.model.node_style[e]);for(const e of(0,o.keys)(this.model.end_style))h[e].push(this.model.end_style[e]);this._selected_renderer=s,this._set_vertices(a,c,h)}}s.PolyVertexEditToolView=n,n.__name__="PolyVertexEditToolView";class a extends l.PolyEditTool{constructor(e){super(e)}}s.PolyVertexEditTool=a,d=a,a.__name__="PolyVertexEditTool",a.__module__="geoviews.models.custom_tools",d.prototype.default_view=n,d.define((({Any:e})=>({end_style:[e,{}],node_style:[e,{}]})))},
50
- "92294e6ad2": function _(o,e,s,t,c){var n;t();const l=o("@bokehjs/models/tools/actions/action_tool"),r=o("@bokehjs/models/sources/column_data_source"),_=o("@bokehjs/styles/icons.css");class i extends l.ActionToolView{doit(){const o=this.model.sources;for(const e of o)e.buffer&&0!=e.buffer.length&&(e.data=e.buffer.pop(),e.change.emit(),e.properties.data.change.emit())}}s.RestoreToolView=i,i.__name__="RestoreToolView";class a extends l.ActionTool{constructor(o){super(o),this.tool_name="Restore",this.tool_icon=_.tool_icon_undo}}s.RestoreTool=a,n=a,a.__name__="RestoreTool",a.__module__="geoviews.models.custom_tools",n.prototype.default_view=i,n.define((({Array:o,Ref:e})=>({sources:[o(e(r.ColumnDataSource)),[]]})))},
51
- }, "c764d38756", {"index":"c764d38756","models/index":"b4555bea44","models/checkpoint_tool":"1d7c6c8516","models/clear_tool":"1c15765006","models/poly_draw":"cddc7627cc","models/poly_edit":"8837add128","models/restore_tool":"92294e6ad2"}, {});});
46
+ "b4555bea44": function _(o,e,l,t,r){t(),r("CheckpointTool",o("443ddb828d").CheckpointTool),r("ClearTool",o("2942ff039e").ClearTool),r("PolyVertexDrawTool",o("3557d74ee0").PolyVertexDrawTool),r("PolyVertexEditTool",o("238deef1f5").PolyVertexEditTool),r("RestoreTool",o("7d18037934").RestoreTool)},
47
+ "443ddb828d": function _(o,e,s,t,c){var n;t();const r=o("@bokehjs/core/util/object"),i=o("@bokehjs/core/util/array"),l=o("@bokehjs/models/tools/actions/action_tool"),u=o("@bokehjs/models/sources/column_data_source"),a=o("@bokehjs/styles/icons.css");class _ extends l.ActionToolView{doit(){const o=this.model.sources;for(const e of o){null==e.buffer&&(e.buffer=[]);const o={};for(const[s,t]of(0,r.entries)(e.data)){const e=[];for(const o of t)Array.isArray(o)||ArrayBuffer.isView(o)?e.push((0,i.copy)(o)):e.push(o);o[s]=e}e.buffer.push(o)}}}s.CheckpointToolView=_,_.__name__="CheckpointToolView";class f extends l.ActionTool{constructor(o){super(o),this.tool_name="Checkpoint",this.tool_icon=a.tool_icon_save}}s.CheckpointTool=f,n=f,f.__name__="CheckpointTool",f.__module__="geoviews.models.custom_tools",n.prototype.default_view=_,n.define((({Array:o,Ref:e})=>({sources:[o(e(u.ColumnDataSource)),[]]})))},
48
+ "2942ff039e": function _(o,e,s,t,l){var c;t();const a=o("@bokehjs/models/tools/actions/action_tool"),_=o("@bokehjs/models/sources/column_data_source"),n=o("@bokehjs/styles/icons.css");class r extends a.ActionToolView{doit(){for(const o of this.model.sources)o.clear()}}s.ClearToolView=r,r.__name__="ClearToolView";class i extends a.ActionTool{constructor(o){super(o),this.tool_name="Clear data",this.tool_icon=n.tool_icon_reset}}s.ClearTool=i,c=i,i.__name__="ClearTool",i.__module__="geoviews.models.custom_tools",c.prototype.default_view=r,c.define((({Array:o,Ref:e})=>({sources:[o(e(_.ColumnDataSource)),[]]})))},
49
+ "3557d74ee0": function _(e,s,t,o,r){var l;o();const i=e("@bokehjs/core/vectorization"),n=e("@bokehjs/core/util/object"),c=e("@bokehjs/core/util/types"),a=e("@bokehjs/core/util/assert"),_=e("@bokehjs/models/tools/edit/poly_draw_tool");class d extends _.PolyDrawToolView{_split_path(e,s){for(const t of this.model.renderers){const o=t.glyph,r=t.data_source,[l,i]=[o.xs.field,o.ys.field],n=r.data[l],a=r.data[i];for(let t=0;t<n.length;t++){let o=n[t];(0,c.isArray)(o)||(o=Array.from(o),r.data[l][t]=o);let _=a[t];(0,c.isArray)(_)||(_=Array.from(_),r.data[i][t]=_);for(let c=0;c<o.length;c++)if(o[c]==e&&_[c]==s&&0!=c&&c!=o.length-1){n.splice(t+1,0,o.slice(c)),a.splice(t+1,0,_.slice(c)),o.splice(c+1),_.splice(c+1);for(const e of r.columns())e!==l&&e!=i&&r.data[e].splice(t+1,0,r.data[e][t]);return}}}}_snap_to_vertex(e,s,t){const{vertex_renderer:o}=this.model;if(null!=o){const r=this._select_event(e,"replace",[o]),l=o.data_source,i=o.glyph,[n,c]=[i.x.field,i.y.field];if(r.length>0){const o=l.selected.indices[0];n&&(s=l.get(n)[o]),c&&(t=l.get(c)[o]),"move"!=e.type&&this._split_path(s,t),l.selection_manager.clear()}}return[s,t]}_set_vertices(e,s,t){const{vertex_renderer:o}=this.model;if(null==o)return;const r=o.glyph,l=o.data_source,[i,a]=[r.x.field,r.y.field];if(i&&((0,c.isArray)(e)?l.set(i,e):r.x={value:e}),a&&((0,c.isArray)(s)?l.set(a,s):r.y={value:s}),null!=t)for(const e of(0,n.keys)(t))l.set(e,t[e]),r[e]={field:e};else for(const e of l.columns())l.set(e,[]);this._emit_cds_changes(l,!0,!0,!1)}_show_vertices(){if(!this.model.active)return;const{renderers:e,node_style:s,end_style:t}=this.model,o=[],r=[],l={};for(const e of(0,n.keys)(t))l[e]=[];for(let i=0;i<e.length;i++){const _=e[i],d=_.data_source,f=_.glyph,[h,y]=[f.xs.field,f.ys.field];for(const e of d.get_array(h)){(0,a.assert)((0,c.isArray)(e)),o.push(...e);for(const[e,s]of(0,n.entries)(t))l[e].push(s);for(const[t,o]of(0,n.entries)(s))for(let s=0;s<e.length-2;s++)l[t].push(o);for(const[e,s]of(0,n.entries)(t))l[e].push(s)}for(const e of d.get_array(y))(0,a.assert)((0,c.isArray)(e)),r.push(...e);if(this._drawing&&i==e.length-1){o.splice(o.length-1,1),r.splice(r.length-1,1);for(const[e,s]of(0,n.entries)(l))s.splice(s.length-1,1)}}this._set_vertices(o,r,l)}_remove(){const e=this.model.renderers[0],s=e.data_source,t=e.glyph;if((0,i.isField)(t.xs)){const e=t.xs.field,o=s.get_array(e),r=o.length-1,l=o[r];l.splice(l.length-1,1),1==l.length&&o.splice(r,1)}if((0,i.isField)(t.ys)){const e=t.ys.field,o=s.get_array(e),r=o.length-1,l=o[r];l.splice(l.length-1,1),1==l.length&&o.splice(r,1)}this._emit_cds_changes(s),this._drawing=!1,this._show_vertices()}}t.PolyVertexDrawToolView=d,d.__name__="PolyVertexDrawToolView";class f extends _.PolyDrawTool{constructor(e){super(e)}}t.PolyVertexDrawTool=f,l=f,f.__name__="PolyVertexDrawTool",f.__module__="geoviews.models.custom_tools",l.prototype.default_view=d,l.define((({Dict:e,Unknown:s})=>({end_style:[e(s),{}],node_style:[e(s),{}]})))},
50
+ "238deef1f5": function _(e,t,s,r,i){var n;r();const o=e("@bokehjs/core/util/object"),_=e("@bokehjs/core/util/types"),l=e("@bokehjs/models/tools/edit/poly_edit_tool");class d extends l.PolyEditToolView{deactivate(){this._hide_vertices(),null!=this._selected_renderer&&(this._drawing&&(this._remove_vertex(),this._drawing=!1),this._emit_cds_changes(this._selected_renderer.data_source,!1,!0,!1))}_pan(e){if(null==this._basepoint||null==this.model.vertex_renderer)return;const t=this._drag_points(e,[this.model.vertex_renderer]);e.modifiers.shift||this._move_linked(t),null!=this._selected_renderer&&this._selected_renderer.data_source.change.emit()}_pan_end(e){if(null==this._basepoint||null==this.model.vertex_renderer)return;const t=this._drag_points(e,[this.model.vertex_renderer]);e.modifiers.shift||this._move_linked(t),this._emit_cds_changes(this.model.vertex_renderer.data_source,!1,!0,!0),null!=this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source),this._basepoint=null}_drag_points(e,t){if(null==this._basepoint)return[];const[s,r]=this._basepoint,i=[];for(const n of t){const t=this._map_drag(s,r,n),o=this._map_drag(e.sx,e.sy,n);if(null==o||null==t)continue;const[_,l]=o,[d,c]=t,[h,a]=[_-d,l-c],u=n.glyph,f=n.data_source,[m,g]=[u.x.field,u.y.field];for(const e of f.selected.indices){const t=[];if(m){const s=f.get(m);t.push(s[e]),s[e]+=h}if(g){const s=f.get(g);t.push(s[e]),s[e]+=a}t.push(h),t.push(a),i.push(t)}f.change.emit()}return this._basepoint=[e.sx,e.sy],i}_set_vertices(e,t,s){if(null==this.model.vertex_renderer)return;const r=this.model.vertex_renderer.glyph,i=this.model.vertex_renderer.data_source,[n,l]=[r.x.field,r.y.field];if(n&&((0,_.isArray)(e)?i.set(n,e):r.x={value:e}),l&&((0,_.isArray)(t)?i.set(l,t):r.y={value:t}),null!=s)for(const[e,t]of(0,o.entries)(s))i.set(e,t),r[e]={field:e};else for(const e of i.columns())i.set(e,[]);this._emit_cds_changes(i,!0,!0,!1)}_move_linked(e){if(null==this._selected_renderer)return;const t=this._selected_renderer,s=t.glyph,r=t.data_source,[i,n]=[s.xs.field,s.ys.field],o=r.data[i],_=r.data[n];for(const t of e){const[e,s,r,i]=t;for(let t=0;t<o.length;t++){const n=o[t],l=_[t];for(let t=0;t<n.length;t++)n[t]==e&&l[t]==s&&(n[t]+=r,l[t]+=i)}}}_tap(e){if(null==this.model.vertex_renderer)return;const t=this.model.vertex_renderer,s=this._map_drag(e.sx,e.sy,t);if(null!=s){if(this._drawing&&null!=this._selected_renderer){let[r,i]=s;const n=t.data_source,o=t.glyph,[_,l]=[o.x.field,o.y.field],d=n.selected.indices;[r,i]=this._snap_to_vertex(e,r,i);const c=d[0];if(n.selected.indices=[c+1],_){const e=n.get_array(_),t=e[c];e[c]=r,e.splice(c+1,0,t)}if(l){const e=n.get_array(l),t=e[c];e[c]=i,e.splice(c+1,0,t)}return n.change.emit(),void this._emit_cds_changes(this._selected_renderer.data_source,!0,!1,!0)}this._select_event(e,this._select_mode(e),[t])}}_show_vertices(e){if(!this.model.active)return;const t=this._select_event(e,"replace",this.model.renderers);if(0===t.length)return this._hide_vertices(),this._selected_renderer=null,void(this._drawing=!1);const s=t[0],r=s.glyph,i=s.data_source,n=i.selected.indices[0],[l,d]=[r.xs.field,r.ys.field];let c,h;l?(c=i.get(l)[n],(0,_.isArray)(c)||(i.get(l)[n]=c=Array.from(c))):c=r.xs.value,d?(h=i.get(d)[n],(0,_.isArray)(h)||(i.get(d)[n]=h=Array.from(h))):h=r.ys.value;const{end_style:a,node_style:u}=this.model,f={};for(const[e,t]of(0,o.entries)(a))f[e]=[t];for(const[e,t]of(0,o.entries)(u))for(let s=0;s<c.length-2;s++)f[e].push(t);for(const[e,t]of(0,o.entries)(a))f[e].push(t);this._selected_renderer=s,this._set_vertices(c,h,f)}}s.PolyVertexEditToolView=d,d.__name__="PolyVertexEditToolView";class c extends l.PolyEditTool{constructor(e){super(e)}}s.PolyVertexEditTool=c,n=c,c.__name__="PolyVertexEditTool",c.__module__="geoviews.models.custom_tools",n.prototype.default_view=d,n.define((({Dict:e,Unknown:t})=>({end_style:[e(t),{}],node_style:[e(t),{}]})))},
51
+ "7d18037934": function _(o,e,s,t,c){var n;t();const l=o("@bokehjs/models/tools/actions/action_tool"),_=o("@bokehjs/models/sources/column_data_source"),i=o("@bokehjs/styles/icons.css");class r extends l.ActionToolView{doit(){const o=this.model.sources;for(const e of o){const o=e.buffer?.pop();null!=o&&(e.data=o,e.change.emit(),e.properties.data.change.emit())}}}s.RestoreToolView=r,r.__name__="RestoreToolView";class a extends l.ActionTool{constructor(o){super(o),this.tool_name="Restore",this.tool_icon=i.tool_icon_undo}}s.RestoreTool=a,n=a,a.__name__="RestoreTool",a.__module__="geoviews.models.custom_tools",n.prototype.default_view=r,n.define((({Array:o,Ref:e})=>({sources:[o(e(_.ColumnDataSource)),[]]})))},
52
+ }, "c764d38756", {"index":"c764d38756","models/index":"b4555bea44","models/checkpoint_tool":"443ddb828d","models/clear_tool":"2942ff039e","models/poly_draw":"3557d74ee0","models/poly_edit":"238deef1f5","models/restore_tool":"7d18037934"}, {});});
@@ -1,2 +1,3 @@
1
1
  import * as GeoViews from "./models";
2
2
  export { GeoViews };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as p from "@bokehjs/core/properties";
1
+ import type * as p from "@bokehjs/core/properties";
2
2
  import { ActionTool, ActionToolView } from "@bokehjs/models/tools/actions/action_tool";
3
3
  import { ColumnDataSource } from "@bokehjs/models/sources/column_data_source";
4
4
  export declare class CheckpointToolView extends ActionToolView {
@@ -20,3 +20,4 @@ export declare class CheckpointTool extends ActionTool {
20
20
  tool_name: string;
21
21
  tool_icon: string;
22
22
  }
23
+ //# sourceMappingURL=checkpoint_tool.d.ts.map
@@ -1,21 +1,21 @@
1
- var _a;
1
+ import { entries } from "@bokehjs/core/util/object";
2
2
  import { copy } from "@bokehjs/core/util/array";
3
3
  import { ActionTool, ActionToolView } from "@bokehjs/models/tools/actions/action_tool";
4
4
  import { ColumnDataSource } from "@bokehjs/models/sources/column_data_source";
5
5
  import { tool_icon_save } from "@bokehjs/styles/icons.css";
6
6
  export class CheckpointToolView extends ActionToolView {
7
+ static __name__ = "CheckpointToolView";
7
8
  doit() {
8
9
  const sources = this.model.sources;
9
10
  for (const source of sources) {
10
- if (!source.buffer) {
11
+ if (source.buffer == null) {
11
12
  source.buffer = [];
12
13
  }
13
- let data_copy = {};
14
- for (const key in source.data) {
15
- const column = source.data[key];
14
+ const data_copy = {};
15
+ for (const [key, column] of entries(source.data)) {
16
16
  const new_column = [];
17
17
  for (const arr of column) {
18
- if (Array.isArray(arr) || (ArrayBuffer.isView(arr))) {
18
+ if (Array.isArray(arr) || ArrayBuffer.isView(arr)) {
19
19
  new_column.push(copy(arr));
20
20
  }
21
21
  else {
@@ -28,21 +28,19 @@ export class CheckpointToolView extends ActionToolView {
28
28
  }
29
29
  }
30
30
  }
31
- CheckpointToolView.__name__ = "CheckpointToolView";
32
31
  export class CheckpointTool extends ActionTool {
32
+ static __name__ = "CheckpointTool";
33
33
  constructor(attrs) {
34
34
  super(attrs);
35
- this.tool_name = "Checkpoint";
36
- this.tool_icon = tool_icon_save;
37
35
  }
36
+ static __module__ = "geoviews.models.custom_tools";
37
+ static {
38
+ this.prototype.default_view = CheckpointToolView;
39
+ this.define(({ Array, Ref }) => ({
40
+ sources: [Array(Ref(ColumnDataSource)), []],
41
+ }));
42
+ }
43
+ tool_name = "Checkpoint";
44
+ tool_icon = tool_icon_save;
38
45
  }
39
- _a = CheckpointTool;
40
- CheckpointTool.__name__ = "CheckpointTool";
41
- CheckpointTool.__module__ = "geoviews.models.custom_tools";
42
- (() => {
43
- _a.prototype.default_view = CheckpointToolView;
44
- _a.define(({ Array, Ref }) => ({
45
- sources: [Array(Ref(ColumnDataSource)), []],
46
- }));
47
- })();
48
46
  //# sourceMappingURL=checkpoint_tool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint_tool.js","sourceRoot":"","sources":["../../../models/checkpoint_tool.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAA;AAC7C,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,2CAA2C,CAAA;AACpF,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAA;AAC3E,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAA;AAGxD,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IAGpD,IAAI;QACF,MAAM,OAAO,GAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QACxC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBAAE,MAAM,CAAC,MAAM,GAAG,EAAE,CAAA;aAAE;YAC1C,IAAI,SAAS,GAAQ,EAAE,CAAC;YACxB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE;gBAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAChC,MAAM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C,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,EAAE,CAAC,CAAC;YACnD,OAAO,EAAE,CAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAE;SAC9C,CAAC,CAAC,CAAA;IACL,CAAC;IAEQ,SAAS,GAAG,YAAY,CAAA;IACxB,SAAS,GAAG,cAAc,CAAA"}
@@ -1,4 +1,4 @@
1
- import * as p from "@bokehjs/core/properties";
1
+ import type * as p from "@bokehjs/core/properties";
2
2
  import { ActionTool, ActionToolView } from "@bokehjs/models/tools/actions/action_tool";
3
3
  import { ColumnDataSource } from "@bokehjs/models/sources/column_data_source";
4
4
  export declare class ClearToolView extends ActionToolView {
@@ -20,3 +20,4 @@ export declare class ClearTool extends ActionTool {
20
20
  tool_name: string;
21
21
  tool_icon: string;
22
22
  }
23
+ //# sourceMappingURL=clear_tool.d.ts.map
@@ -1,33 +1,27 @@
1
- var _a;
2
1
  import { ActionTool, ActionToolView } from "@bokehjs/models/tools/actions/action_tool";
3
2
  import { ColumnDataSource } from "@bokehjs/models/sources/column_data_source";
4
3
  import { tool_icon_reset } from "@bokehjs/styles/icons.css";
5
4
  export class ClearToolView extends ActionToolView {
5
+ static __name__ = "ClearToolView";
6
6
  doit() {
7
- for (var source of this.model.sources) {
8
- for (const column in source.data) {
9
- source.data[column] = [];
10
- }
11
- source.change.emit();
12
- source.properties.data.change.emit();
7
+ for (const source of this.model.sources) {
8
+ source.clear();
13
9
  }
14
10
  }
15
11
  }
16
- ClearToolView.__name__ = "ClearToolView";
17
12
  export class ClearTool extends ActionTool {
13
+ static __name__ = "ClearTool";
18
14
  constructor(attrs) {
19
15
  super(attrs);
20
- this.tool_name = "Clear data";
21
- this.tool_icon = tool_icon_reset;
22
16
  }
17
+ static __module__ = "geoviews.models.custom_tools";
18
+ static {
19
+ this.prototype.default_view = ClearToolView;
20
+ this.define(({ Array, Ref }) => ({
21
+ sources: [Array(Ref(ColumnDataSource)), []],
22
+ }));
23
+ }
24
+ tool_name = "Clear data";
25
+ tool_icon = tool_icon_reset;
23
26
  }
24
- _a = ClearTool;
25
- ClearTool.__name__ = "ClearTool";
26
- ClearTool.__module__ = "geoviews.models.custom_tools";
27
- (() => {
28
- _a.prototype.default_view = ClearToolView;
29
- _a.define(({ Array, Ref }) => ({
30
- sources: [Array(Ref(ColumnDataSource)), []],
31
- }));
32
- })();
33
27
  //# sourceMappingURL=clear_tool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clear_tool.js","sourceRoot":"","sources":["../../../models/clear_tool.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,2CAA2C,CAAA;AACpF,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAA;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAA;AAGzD,MAAM,OAAO,aAAc,SAAQ,cAAc;IAG/C,IAAI;QACF,KAAK,IAAI,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YACrC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE;gBAChC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAA;aACzB;YACD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;SACtC;IACH,CAAC;;;AAYH,MAAM,OAAO,SAAU,SAAQ,UAAU;IAGvC,YAAY,KAAgC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAA;QAad,cAAS,GAAG,YAAY,CAAA;QACxB,cAAS,GAAG,eAAe,CAAA;IAb3B,CAAC;;;;AAEM,oBAAU,GAAG,8BAA8B,AAAjC,CAAiC;AAElD;IACE,GAAK,SAAS,CAAC,YAAY,GAAG,aAAa,CAAA;IAE3C,GAAK,MAAM,CAAkB,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,CAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAE;KAC9C,CAAC,CAAC,CAAA;AACL,CAAC,GAAA,CAAA"}
1
+ {"version":3,"file":"clear_tool.js","sourceRoot":"","sources":["../../../models/clear_tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,2CAA2C,CAAA;AACpF,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAA;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAA;AAEzD,MAAM,OAAO,aAAc,SAAQ,cAAc;;IAG/C,IAAI;QACF,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACxC,MAAM,CAAC,KAAK,EAAE,CAAA;QAChB,CAAC;IACH,CAAC;;AAYH,MAAM,OAAO,SAAU,SAAQ,UAAU;;IAGvC,YAAY,KAAgC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;IAED,MAAM,CAAU,UAAU,GAAG,8BAA8B,CAAA;IAE3D;QACE,IAAI,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAA;QAE3C,IAAI,CAAC,MAAM,CAAkB,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,OAAO,EAAE,CAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAE;SAC9C,CAAC,CAAC,CAAA;IACL,CAAC;IAEQ,SAAS,GAAG,YAAY,CAAA;IACxB,SAAS,GAAG,eAAe,CAAA"}
@@ -3,3 +3,4 @@ export { ClearTool } from "./clear_tool";
3
3
  export { PolyVertexDrawTool } from "./poly_draw";
4
4
  export { PolyVertexEditTool } from "./poly_edit";
5
5
  export { RestoreTool } from "./restore_tool";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,10 @@
1
- import * as p from "@bokehjs/core/properties";
2
- import { UIEvent } from "@bokehjs/core/ui_events";
1
+ import type * as p from "@bokehjs/core/properties";
2
+ import type { Dict } from "@bokehjs/core/types";
3
+ import type { UIEvent } from "@bokehjs/core/ui_events";
3
4
  import { PolyDrawTool, PolyDrawToolView } from "@bokehjs/models/tools/edit/poly_draw_tool";
4
- import { MultiLine } from "@bokehjs/models/glyphs/multi_line";
5
- import { Patches } from "@bokehjs/models/glyphs/patches";
6
- import { GlyphRenderer } from "@bokehjs/models/renderers/glyph_renderer";
5
+ import type { MultiLine } from "@bokehjs/models/glyphs/multi_line";
6
+ import type { Patches } from "@bokehjs/models/glyphs/patches";
7
+ import type { GlyphRenderer } from "@bokehjs/models/renderers/glyph_renderer";
7
8
  export declare class PolyVertexDrawToolView extends PolyDrawToolView {
8
9
  model: PolyVertexDrawTool;
9
10
  _split_path(x: number, y: number): void;
@@ -15,8 +16,8 @@ export declare class PolyVertexDrawToolView extends PolyDrawToolView {
15
16
  export declare namespace PolyVertexDrawTool {
16
17
  type Attrs = p.AttrsOf<Props>;
17
18
  type Props = PolyDrawTool.Props & {
18
- node_style: p.Property<any>;
19
- end_style: p.Property<any>;
19
+ node_style: p.Property<Dict<unknown>>;
20
+ end_style: p.Property<Dict<unknown>>;
20
21
  };
21
22
  }
22
23
  export interface PolyVertexDrawTool extends PolyVertexDrawTool.Attrs {
@@ -30,3 +31,4 @@ export declare class PolyVertexDrawTool extends PolyDrawTool {
30
31
  constructor(attrs?: Partial<PolyVertexDrawTool.Attrs>);
31
32
  static __module__: string;
32
33
  }
34
+ //# sourceMappingURL=poly_draw.d.ts.map
@@ -1,11 +1,12 @@
1
- var _a;
2
- import { keys } from "@bokehjs/core/util/object";
1
+ import { isField } from "@bokehjs/core/vectorization";
2
+ import { keys, entries } from "@bokehjs/core/util/object";
3
3
  import { isArray } from "@bokehjs/core/util/types";
4
+ import { assert } from "@bokehjs/core/util/assert";
4
5
  import { PolyDrawTool, PolyDrawToolView } from "@bokehjs/models/tools/edit/poly_draw_tool";
5
6
  export class PolyVertexDrawToolView extends PolyDrawToolView {
7
+ static __name__ = "PolyVertexDrawToolView";
6
8
  _split_path(x, y) {
7
- for (let r = 0; r < this.model.renderers.length; r++) {
8
- const renderer = this.model.renderers[r];
9
+ for (const renderer of this.model.renderers) {
9
10
  const glyph = renderer.glyph;
10
11
  const cds = renderer.data_source;
11
12
  const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];
@@ -29,8 +30,9 @@ export class PolyVertexDrawToolView extends PolyDrawToolView {
29
30
  xs.splice(i + 1);
30
31
  ys.splice(i + 1);
31
32
  for (const column of cds.columns()) {
32
- if ((column !== xkey) && (column != ykey))
33
+ if ((column !== xkey) && (column != ykey)) {
33
34
  cds.data[column].splice(index + 1, 0, cds.data[column][index]);
35
+ }
34
36
  }
35
37
  return;
36
38
  }
@@ -39,55 +41,65 @@ export class PolyVertexDrawToolView extends PolyDrawToolView {
39
41
  }
40
42
  }
41
43
  _snap_to_vertex(ev, x, y) {
42
- if (this.model.vertex_renderer) {
44
+ const { vertex_renderer } = this.model;
45
+ if (vertex_renderer != null) {
43
46
  // If an existing vertex is hit snap to it
44
- const vertex_selected = this._select_event(ev, "replace", [this.model.vertex_renderer]);
45
- const point_ds = this.model.vertex_renderer.data_source;
47
+ const vertex_selected = this._select_event(ev, "replace", [vertex_renderer]);
48
+ const point_ds = vertex_renderer.data_source;
46
49
  // Type once dataspecs are typed
47
- const point_glyph = this.model.vertex_renderer.glyph;
50
+ const point_glyph = vertex_renderer.glyph;
48
51
  const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];
49
- if (vertex_selected.length) {
52
+ if (vertex_selected.length > 0) {
50
53
  // If existing vertex is hit split path at that location
51
54
  // converting to feature vertex
52
55
  const index = point_ds.selected.indices[0];
53
- if (pxkey)
54
- x = point_ds.data[pxkey][index];
55
- if (pykey)
56
- y = point_ds.data[pykey][index];
57
- if (ev.type != 'mousemove')
56
+ if (pxkey) {
57
+ x = point_ds.get(pxkey)[index];
58
+ }
59
+ if (pykey) {
60
+ y = point_ds.get(pykey)[index];
61
+ }
62
+ if (ev.type != "move") {
58
63
  this._split_path(x, y);
64
+ }
59
65
  point_ds.selection_manager.clear();
60
66
  }
61
67
  }
62
68
  return [x, y];
63
69
  }
64
70
  _set_vertices(xs, ys, styles) {
65
- if (this.model.vertex_renderer == null)
71
+ const { vertex_renderer } = this.model;
72
+ if (vertex_renderer == null) {
66
73
  return;
67
- const point_glyph = this.model.vertex_renderer.glyph;
68
- const point_cds = this.model.vertex_renderer.data_source;
74
+ }
75
+ const point_glyph = vertex_renderer.glyph;
76
+ const point_cds = vertex_renderer.data_source;
69
77
  const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];
70
78
  if (pxkey) {
71
- if (isArray(xs))
72
- point_cds.data[pxkey] = xs;
73
- else
79
+ if (isArray(xs)) {
80
+ point_cds.set(pxkey, xs);
81
+ }
82
+ else {
74
83
  point_glyph.x = { value: xs };
84
+ }
75
85
  }
76
86
  if (pykey) {
77
- if (isArray(ys))
78
- point_cds.data[pykey] = ys;
79
- else
87
+ if (isArray(ys)) {
88
+ point_cds.set(pykey, ys);
89
+ }
90
+ else {
80
91
  point_glyph.y = { value: ys };
92
+ }
81
93
  }
82
94
  if (styles != null) {
83
95
  for (const key of keys(styles)) {
84
- point_cds.data[key] = styles[key];
96
+ point_cds.set(key, styles[key]);
85
97
  point_glyph[key] = { field: key };
86
98
  }
87
99
  }
88
100
  else {
89
101
  for (const col of point_cds.columns()) {
90
- point_cds.data[col] = [];
102
+ point_cds.set(col, []);
91
103
  }
92
104
  }
93
105
  this._emit_cds_changes(point_cds, true, true, false);
@@ -96,36 +108,44 @@ export class PolyVertexDrawToolView extends PolyDrawToolView {
96
108
  if (!this.model.active) {
97
109
  return;
98
110
  }
111
+ const { renderers, node_style, end_style } = this.model;
99
112
  const xs = [];
100
113
  const ys = [];
101
114
  const styles = {};
102
- for (const key of keys(this.model.end_style))
115
+ for (const key of keys(end_style)) {
103
116
  styles[key] = [];
104
- for (let i = 0; i < this.model.renderers.length; i++) {
105
- const renderer = this.model.renderers[i];
117
+ }
118
+ for (let i = 0; i < renderers.length; i++) {
119
+ const renderer = renderers[i];
106
120
  const cds = renderer.data_source;
107
121
  const glyph = renderer.glyph;
108
122
  const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];
109
123
  for (const array of cds.get_array(xkey)) {
110
- Array.prototype.push.apply(xs, array);
111
- for (const key of keys(this.model.end_style))
112
- styles[key].push(this.model.end_style[key]);
113
- for (const key of keys(this.model.node_style)) {
114
- for (let index = 0; index < (array.length - 2); index++) {
115
- styles[key].push(this.model.node_style[key]);
124
+ assert(isArray(array));
125
+ xs.push(...array);
126
+ for (const [key, val] of entries(end_style)) {
127
+ styles[key].push(val);
128
+ }
129
+ for (const [key, val] of entries(node_style)) {
130
+ for (let index = 0; index < array.length - 2; index++) {
131
+ styles[key].push(val);
116
132
  }
117
133
  }
118
- for (const key of keys(this.model.end_style))
119
- styles[key].push(this.model.end_style[key]);
134
+ for (const [key, val] of entries(end_style)) {
135
+ styles[key].push(val);
136
+ }
137
+ }
138
+ for (const array of cds.get_array(ykey)) {
139
+ assert(isArray(array));
140
+ ys.push(...array);
120
141
  }
121
- for (const array of cds.get_array(ykey))
122
- Array.prototype.push.apply(ys, array);
123
- if (this._drawing && (i == (this.model.renderers.length - 1))) {
142
+ if (this._drawing && i == renderers.length - 1) {
124
143
  // Skip currently drawn vertex
125
144
  xs.splice(xs.length - 1, 1);
126
145
  ys.splice(ys.length - 1, 1);
127
- for (const key of keys(styles))
128
- styles[key].splice(styles[key].length - 1, 1);
146
+ for (const [_, array] of entries(styles)) {
147
+ array.splice(array.length - 1, 1);
148
+ }
129
149
  }
130
150
  }
131
151
  this._set_vertices(xs, ys, styles);
@@ -134,40 +154,44 @@ export class PolyVertexDrawToolView extends PolyDrawToolView {
134
154
  const renderer = this.model.renderers[0];
135
155
  const cds = renderer.data_source;
136
156
  const glyph = renderer.glyph;
137
- const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];
138
- if (xkey) {
139
- const xidx = cds.data[xkey].length - 1;
140
- const xs = cds.get_array(xkey)[xidx];
157
+ if (isField(glyph.xs)) {
158
+ const xkey = glyph.xs.field;
159
+ const array = cds.get_array(xkey);
160
+ const xidx = array.length - 1;
161
+ const xs = array[xidx];
141
162
  xs.splice(xs.length - 1, 1);
142
- if (xs.length == 1)
143
- cds.data[xkey].splice(xidx, 1);
163
+ if (xs.length == 1) {
164
+ array.splice(xidx, 1);
165
+ }
144
166
  }
145
- if (ykey) {
146
- const yidx = cds.data[ykey].length - 1;
147
- const ys = cds.get_array(ykey)[yidx];
167
+ if (isField(glyph.ys)) {
168
+ const ykey = glyph.ys.field;
169
+ const array = cds.get_array(ykey);
170
+ const yidx = array.length - 1;
171
+ const ys = array[yidx];
148
172
  ys.splice(ys.length - 1, 1);
149
- if (ys.length == 1)
150
- cds.data[ykey].splice(yidx, 1);
173
+ if (ys.length == 1) {
174
+ array.splice(yidx, 1);
175
+ }
151
176
  }
152
177
  this._emit_cds_changes(cds);
153
178
  this._drawing = false;
154
179
  this._show_vertices();
155
180
  }
156
181
  }
157
- PolyVertexDrawToolView.__name__ = "PolyVertexDrawToolView";
158
182
  export class PolyVertexDrawTool extends PolyDrawTool {
183
+ static __name__ = "PolyVertexDrawTool";
184
+ renderers;
159
185
  constructor(attrs) {
160
186
  super(attrs);
161
187
  }
188
+ static __module__ = "geoviews.models.custom_tools";
189
+ static {
190
+ this.prototype.default_view = PolyVertexDrawToolView;
191
+ this.define(({ Dict, Unknown }) => ({
192
+ end_style: [Dict(Unknown), {}],
193
+ node_style: [Dict(Unknown), {}],
194
+ }));
195
+ }
162
196
  }
163
- _a = PolyVertexDrawTool;
164
- PolyVertexDrawTool.__name__ = "PolyVertexDrawTool";
165
- PolyVertexDrawTool.__module__ = "geoviews.models.custom_tools";
166
- (() => {
167
- _a.prototype.default_view = PolyVertexDrawToolView;
168
- _a.define(({ Any }) => ({
169
- end_style: [Any, {}],
170
- node_style: [Any, {}],
171
- }));
172
- })();
173
197
  //# sourceMappingURL=poly_draw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"poly_draw.js","sourceRoot":"","sources":["../../../models/poly_draw.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,IAAI,EAAC,MAAM,2BAA2B,CAAA;AAC9C,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,2CAA2C,CAAA;AAOxF,MAAM,OAAO,sBAAuB,SAAQ,gBAAgB;IAG1D,WAAW,CAAC,CAAS,EAAE,CAAS;QAC9B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;YACxC,MAAM,KAAK,GAAQ,QAAQ,CAAC,KAAK,CAAA;YACjC,MAAM,GAAG,GAAQ,QAAQ,CAAC,WAAW,CAAA;YACrC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACrD,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC7B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAClD,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;gBACtB,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;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