@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.
- package/dist/geoviews.js +171 -128
- package/dist/geoviews.js.map +1 -1
- package/dist/geoviews.json +1 -1
- package/dist/geoviews.min.js +11 -10
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/models/checkpoint_tool.d.ts +2 -1
- package/dist/lib/models/checkpoint_tool.js +16 -18
- package/dist/lib/models/checkpoint_tool.js.map +1 -1
- package/dist/lib/models/clear_tool.d.ts +2 -1
- package/dist/lib/models/clear_tool.js +13 -19
- package/dist/lib/models/clear_tool.js.map +1 -1
- package/dist/lib/models/index.d.ts +1 -0
- package/dist/lib/models/poly_draw.d.ts +9 -7
- package/dist/lib/models/poly_draw.js +88 -64
- package/dist/lib/models/poly_draw.js.map +1 -1
- package/dist/lib/models/poly_edit.d.ts +13 -9
- package/dist/lib/models/poly_edit.js +71 -52
- package/dist/lib/models/poly_edit.js.map +1 -1
- package/dist/lib/models/restore_tool.d.ts +2 -1
- package/dist/lib/models/restore_tool.js +14 -15
- package/dist/lib/models/restore_tool.js.map +1 -1
- package/package.json +10 -3
package/dist/geoviews.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@@/geoviews/dist/lib/index.js","@@/geoviews/dist/lib/models/index.js","@@/geoviews/dist/lib/models/checkpoint_tool.js","@@/geoviews/dist/lib/models/clear_tool.js","@@/geoviews/dist/lib/models/poly_draw.js","@@/geoviews/dist/lib/models/poly_edit.js","@@/geoviews/dist/lib/models/restore_tool.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"generated.js","sourceRoot":"","sourcesContent":["/* index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n const tslib_1 = require(\"tslib\");\n const GeoViews = tslib_1.__importStar(require(\"b4555bea44\") /* ./models */);\n exports.GeoViews = GeoViews;\n const base_1 = require(\"@bokehjs/base\");\n (0, base_1.register_models)(GeoViews);\n}\n","/* models/index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var checkpoint_tool_1 = require(\"1d7c6c8516\") /* ./checkpoint_tool */;\n __esExport(\"CheckpointTool\", checkpoint_tool_1.CheckpointTool);\n var clear_tool_1 = require(\"1c15765006\") /* ./clear_tool */;\n __esExport(\"ClearTool\", clear_tool_1.ClearTool);\n var poly_draw_1 = require(\"cddc7627cc\") /* ./poly_draw */;\n __esExport(\"PolyVertexDrawTool\", poly_draw_1.PolyVertexDrawTool);\n var poly_edit_1 = require(\"8837add128\") /* ./poly_edit */;\n __esExport(\"PolyVertexEditTool\", poly_edit_1.PolyVertexEditTool);\n var restore_tool_1 = require(\"92294e6ad2\") /* ./restore_tool */;\n __esExport(\"RestoreTool\", restore_tool_1.RestoreTool);\n}\n","/* models/checkpoint_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const array_1 = require(\"@bokehjs/core/util/array\");\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class CheckpointToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (!source.buffer) {\n source.buffer = [];\n }\n let data_copy = {};\n for (const key in source.data) {\n const column = source.data[key];\n const new_column = [];\n for (const arr of column) {\n if (Array.isArray(arr) || (ArrayBuffer.isView(arr))) {\n new_column.push((0, array_1.copy)(arr));\n }\n else {\n new_column.push(arr);\n }\n }\n data_copy[key] = new_column;\n }\n source.buffer.push(data_copy);\n }\n }\n }\n exports.CheckpointToolView = CheckpointToolView;\n CheckpointToolView.__name__ = \"CheckpointToolView\";\n class CheckpointTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Checkpoint\";\n this.tool_icon = icons_css_1.tool_icon_save;\n }\n }\n exports.CheckpointTool = CheckpointTool;\n _a = CheckpointTool;\n CheckpointTool.__name__ = \"CheckpointTool\";\n CheckpointTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = CheckpointToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","/* models/clear_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class ClearToolView extends action_tool_1.ActionToolView {\n doit() {\n for (var source of this.model.sources) {\n for (const column in source.data) {\n source.data[column] = [];\n }\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n }\n exports.ClearToolView = ClearToolView;\n ClearToolView.__name__ = \"ClearToolView\";\n class ClearTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Clear data\";\n this.tool_icon = icons_css_1.tool_icon_reset;\n }\n }\n exports.ClearTool = ClearTool;\n _a = ClearTool;\n ClearTool.__name__ = \"ClearTool\";\n ClearTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = ClearToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","/* models/poly_draw.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const poly_draw_tool_1 = require(\"@bokehjs/models/tools/edit/poly_draw_tool\");\n class PolyVertexDrawToolView extends poly_draw_tool_1.PolyDrawToolView {\n _split_path(x, y) {\n for (let r = 0; r < this.model.renderers.length; r++) {\n const renderer = this.model.renderers[r];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (let index = 0; index < xpaths.length; index++) {\n let xs = xpaths[index];\n if (!(0, types_1.isArray)(xs)) {\n xs = Array.from(xs);\n cds.data[xkey][index] = xs;\n }\n let ys = ypaths[index];\n if (!(0, types_1.isArray)(ys)) {\n ys = Array.from(ys);\n cds.data[ykey][index] = ys;\n }\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y) && (i != 0) && (i != (xs.length - 1))) {\n xpaths.splice(index + 1, 0, xs.slice(i));\n ypaths.splice(index + 1, 0, ys.slice(i));\n xs.splice(i + 1);\n ys.splice(i + 1);\n for (const column of cds.columns()) {\n if ((column !== xkey) && (column != ykey))\n cds.data[column].splice(index + 1, 0, cds.data[column][index]);\n }\n return;\n }\n }\n }\n }\n }\n _snap_to_vertex(ev, x, y) {\n if (this.model.vertex_renderer) {\n // If an existing vertex is hit snap to it\n const vertex_selected = this._select_event(ev, \"replace\", [this.model.vertex_renderer]);\n const point_ds = this.model.vertex_renderer.data_source;\n // Type once dataspecs are typed\n const point_glyph = this.model.vertex_renderer.glyph;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (vertex_selected.length) {\n // If existing vertex is hit split path at that location\n // converting to feature vertex\n const index = point_ds.selected.indices[0];\n if (pxkey)\n x = point_ds.data[pxkey][index];\n if (pykey)\n y = point_ds.data[pykey][index];\n if (ev.type != 'mousemove')\n this._split_path(x, y);\n point_ds.selection_manager.clear();\n }\n }\n return [x, y];\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null)\n return;\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs))\n point_cds.data[pxkey] = xs;\n else\n point_glyph.x = { value: xs };\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys))\n point_cds.data[pykey] = ys;\n else\n point_glyph.y = { value: ys };\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.data[key] = styles[key];\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.data[col] = [];\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _show_vertices() {\n if (!this.model.active) {\n return;\n }\n const xs = [];\n const ys = [];\n const styles = {};\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key] = [];\n for (let i = 0; i < this.model.renderers.length; i++) {\n const renderer = this.model.renderers[i];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n for (const array of cds.get_array(xkey)) {\n Array.prototype.push.apply(xs, array);\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n for (const key of (0, object_1.keys)(this.model.node_style)) {\n for (let index = 0; index < (array.length - 2); index++) {\n styles[key].push(this.model.node_style[key]);\n }\n }\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n }\n for (const array of cds.get_array(ykey))\n Array.prototype.push.apply(ys, array);\n if (this._drawing && (i == (this.model.renderers.length - 1))) {\n // Skip currently drawn vertex\n xs.splice(xs.length - 1, 1);\n ys.splice(ys.length - 1, 1);\n for (const key of (0, object_1.keys)(styles))\n styles[key].splice(styles[key].length - 1, 1);\n }\n }\n this._set_vertices(xs, ys, styles);\n }\n _remove() {\n const renderer = this.model.renderers[0];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n if (xkey) {\n const xidx = cds.data[xkey].length - 1;\n const xs = cds.get_array(xkey)[xidx];\n xs.splice(xs.length - 1, 1);\n if (xs.length == 1)\n cds.data[xkey].splice(xidx, 1);\n }\n if (ykey) {\n const yidx = cds.data[ykey].length - 1;\n const ys = cds.get_array(ykey)[yidx];\n ys.splice(ys.length - 1, 1);\n if (ys.length == 1)\n cds.data[ykey].splice(yidx, 1);\n }\n this._emit_cds_changes(cds);\n this._drawing = false;\n this._show_vertices();\n }\n }\n exports.PolyVertexDrawToolView = PolyVertexDrawToolView;\n PolyVertexDrawToolView.__name__ = \"PolyVertexDrawToolView\";\n class PolyVertexDrawTool extends poly_draw_tool_1.PolyDrawTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexDrawTool = PolyVertexDrawTool;\n _a = PolyVertexDrawTool;\n PolyVertexDrawTool.__name__ = \"PolyVertexDrawTool\";\n PolyVertexDrawTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexDrawToolView;\n _a.define(({ Any }) => ({\n end_style: [Any, {}],\n node_style: [Any, {}],\n }));\n })();\n}\n","/* models/poly_edit.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const poly_edit_tool_1 = require(\"@bokehjs/models/tools/edit/poly_edit_tool\");\n class PolyVertexEditToolView extends poly_edit_tool_1.PolyEditToolView {\n deactivate() {\n this._hide_vertices();\n if (!this._selected_renderer) {\n return;\n }\n else if (this._drawing) {\n this._remove_vertex();\n this._drawing = false;\n }\n this._emit_cds_changes(this._selected_renderer.data_source, false, true, false);\n }\n _pan(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null)\n return;\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n if (this._selected_renderer)\n this._selected_renderer.data_source.change.emit();\n }\n _pan_end(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null)\n return;\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n this._emit_cds_changes(this.model.vertex_renderer.data_source, false, true, true);\n if (this._selected_renderer) {\n this._emit_cds_changes(this._selected_renderer.data_source);\n }\n this._basepoint = null;\n }\n _drag_points(ev, renderers) {\n if (this._basepoint == null)\n return [];\n const [bx, by] = this._basepoint;\n const points = [];\n for (const renderer of renderers) {\n const basepoint = this._map_drag(bx, by, renderer);\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null || basepoint == null) {\n continue;\n }\n const [x, y] = point;\n const [px, py] = basepoint;\n const [dx, dy] = [x - px, y - py];\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n for (const index of cds.selected.indices) {\n const point = [];\n if (xkey) {\n point.push(cds.data[xkey][index]);\n cds.data[xkey][index] += dx;\n }\n if (ykey) {\n point.push(cds.data[ykey][index]);\n cds.data[ykey][index] += dy;\n }\n point.push(dx);\n point.push(dy);\n points.push(point);\n }\n cds.change.emit();\n }\n this._basepoint = [ev.sx, ev.sy];\n return points;\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null)\n return;\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs))\n point_cds.data[pxkey] = xs;\n else\n point_glyph.x = { value: xs };\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys))\n point_cds.data[pykey] = ys;\n else\n point_glyph.y = { value: ys };\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.data[key] = styles[key];\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.data[col] = [];\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _move_linked(points) {\n if (!this._selected_renderer)\n return;\n const renderer = this._selected_renderer;\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (const point of points) {\n const [x, y, dx, dy] = point;\n for (let index = 0; index < xpaths.length; index++) {\n const xs = xpaths[index];\n const ys = ypaths[index];\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y)) {\n xs[i] += dx;\n ys[i] += dy;\n }\n }\n }\n }\n }\n _tap(ev) {\n if (this.model.vertex_renderer == null)\n return;\n const renderer = this.model.vertex_renderer;\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null)\n return;\n else if (this._drawing && this._selected_renderer) {\n let [x, y] = point;\n const cds = renderer.data_source;\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n const indices = cds.selected.indices;\n [x, y] = this._snap_to_vertex(ev, x, y);\n const index = indices[0];\n cds.selected.indices = [index + 1];\n if (xkey) {\n const xs = cds.get_array(xkey);\n const nx = xs[index];\n xs[index] = x;\n xs.splice(index + 1, 0, nx);\n }\n if (ykey) {\n const ys = cds.get_array(ykey);\n const ny = ys[index];\n ys[index] = y;\n ys.splice(index + 1, 0, ny);\n }\n cds.change.emit();\n this._emit_cds_changes(this._selected_renderer.data_source, true, false, true);\n return;\n }\n this._select_event(ev, this._select_mode(ev), [renderer]);\n }\n _show_vertices(ev) {\n if (!this.model.active)\n return;\n const renderers = this._select_event(ev, \"replace\", this.model.renderers);\n if (!renderers.length) {\n this._hide_vertices();\n this._selected_renderer = null;\n this._drawing = false;\n return;\n }\n const renderer = renderers[0];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const index = cds.selected.indices[0];\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n let xs;\n let ys;\n if (xkey) {\n xs = cds.data[xkey][index];\n if (!(0, types_1.isArray)(xs))\n cds.data[xkey][index] = xs = Array.from(xs);\n }\n else {\n xs = glyph.xs.value;\n }\n if (ykey) {\n ys = cds.data[ykey][index];\n if (!(0, types_1.isArray)(ys))\n cds.data[ykey][index] = ys = Array.from(ys);\n }\n else {\n ys = glyph.ys.value;\n }\n const styles = {};\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key] = [this.model.end_style[key]];\n for (const key of (0, object_1.keys)(this.model.node_style)) {\n for (let index = 0; index < (xs.length - 2); index++) {\n styles[key].push(this.model.node_style[key]);\n }\n }\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n this._selected_renderer = renderer;\n this._set_vertices(xs, ys, styles);\n }\n }\n exports.PolyVertexEditToolView = PolyVertexEditToolView;\n PolyVertexEditToolView.__name__ = \"PolyVertexEditToolView\";\n class PolyVertexEditTool extends poly_edit_tool_1.PolyEditTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexEditTool = PolyVertexEditTool;\n _a = PolyVertexEditTool;\n PolyVertexEditTool.__name__ = \"PolyVertexEditTool\";\n PolyVertexEditTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexEditToolView;\n _a.define(({ Any }) => ({\n end_style: [Any, {}],\n node_style: [Any, {}],\n }));\n })();\n}\n","/* models/restore_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class RestoreToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (!source.buffer || (source.buffer.length == 0)) {\n continue;\n }\n source.data = source.buffer.pop();\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n }\n exports.RestoreToolView = RestoreToolView;\n RestoreToolView.__name__ = \"RestoreToolView\";\n class RestoreTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Restore\";\n this.tool_icon = icons_css_1.tool_icon_undo;\n }\n }\n exports.RestoreTool = RestoreTool;\n _a = RestoreTool;\n RestoreTool.__name__ = \"RestoreTool\";\n RestoreTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = RestoreToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@@/geoviews/dist/lib/index.js","@@/geoviews/dist/lib/models/index.js","@@/geoviews/dist/lib/models/checkpoint_tool.js","@@/geoviews/dist/lib/models/clear_tool.js","@@/geoviews/dist/lib/models/poly_draw.js","@@/geoviews/dist/lib/models/poly_edit.js","@@/geoviews/dist/lib/models/restore_tool.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC7PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"generated.js","sourceRoot":"","sourcesContent":["/* index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n const tslib_1 = require(\"tslib\");\n const GeoViews = tslib_1.__importStar(require(\"b4555bea44\") /* ./models */);\n exports.GeoViews = GeoViews;\n const base_1 = require(\"@bokehjs/base\");\n (0, base_1.register_models)(GeoViews);\n}\n","/* models/index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var checkpoint_tool_1 = require(\"443ddb828d\") /* ./checkpoint_tool */;\n __esExport(\"CheckpointTool\", checkpoint_tool_1.CheckpointTool);\n var clear_tool_1 = require(\"2942ff039e\") /* ./clear_tool */;\n __esExport(\"ClearTool\", clear_tool_1.ClearTool);\n var poly_draw_1 = require(\"3557d74ee0\") /* ./poly_draw */;\n __esExport(\"PolyVertexDrawTool\", poly_draw_1.PolyVertexDrawTool);\n var poly_edit_1 = require(\"238deef1f5\") /* ./poly_edit */;\n __esExport(\"PolyVertexEditTool\", poly_edit_1.PolyVertexEditTool);\n var restore_tool_1 = require(\"7d18037934\") /* ./restore_tool */;\n __esExport(\"RestoreTool\", restore_tool_1.RestoreTool);\n}\n","/* models/checkpoint_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const object_1 = require(\"@bokehjs/core/util/object\");\n const array_1 = require(\"@bokehjs/core/util/array\");\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class CheckpointToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (source.buffer == null) {\n source.buffer = [];\n }\n const data_copy = {};\n for (const [key, column] of (0, object_1.entries)(source.data)) {\n const new_column = [];\n for (const arr of column) {\n if (Array.isArray(arr) || ArrayBuffer.isView(arr)) {\n new_column.push((0, array_1.copy)(arr));\n }\n else {\n new_column.push(arr);\n }\n }\n data_copy[key] = new_column;\n }\n source.buffer.push(data_copy);\n }\n }\n }\n exports.CheckpointToolView = CheckpointToolView;\n CheckpointToolView.__name__ = \"CheckpointToolView\";\n class CheckpointTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Checkpoint\";\n this.tool_icon = icons_css_1.tool_icon_save;\n }\n }\n exports.CheckpointTool = CheckpointTool;\n _a = CheckpointTool;\n CheckpointTool.__name__ = \"CheckpointTool\";\n CheckpointTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = CheckpointToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","/* models/clear_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class ClearToolView extends action_tool_1.ActionToolView {\n doit() {\n for (const source of this.model.sources) {\n source.clear();\n }\n }\n }\n exports.ClearToolView = ClearToolView;\n ClearToolView.__name__ = \"ClearToolView\";\n class ClearTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Clear data\";\n this.tool_icon = icons_css_1.tool_icon_reset;\n }\n }\n exports.ClearTool = ClearTool;\n _a = ClearTool;\n ClearTool.__name__ = \"ClearTool\";\n ClearTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = ClearToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","/* models/poly_draw.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const vectorization_1 = require(\"@bokehjs/core/vectorization\");\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const assert_1 = require(\"@bokehjs/core/util/assert\");\n const poly_draw_tool_1 = require(\"@bokehjs/models/tools/edit/poly_draw_tool\");\n class PolyVertexDrawToolView extends poly_draw_tool_1.PolyDrawToolView {\n _split_path(x, y) {\n for (const renderer of this.model.renderers) {\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (let index = 0; index < xpaths.length; index++) {\n let xs = xpaths[index];\n if (!(0, types_1.isArray)(xs)) {\n xs = Array.from(xs);\n cds.data[xkey][index] = xs;\n }\n let ys = ypaths[index];\n if (!(0, types_1.isArray)(ys)) {\n ys = Array.from(ys);\n cds.data[ykey][index] = ys;\n }\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y) && (i != 0) && (i != (xs.length - 1))) {\n xpaths.splice(index + 1, 0, xs.slice(i));\n ypaths.splice(index + 1, 0, ys.slice(i));\n xs.splice(i + 1);\n ys.splice(i + 1);\n for (const column of cds.columns()) {\n if ((column !== xkey) && (column != ykey)) {\n cds.data[column].splice(index + 1, 0, cds.data[column][index]);\n }\n }\n return;\n }\n }\n }\n }\n }\n _snap_to_vertex(ev, x, y) {\n const { vertex_renderer } = this.model;\n if (vertex_renderer != null) {\n // If an existing vertex is hit snap to it\n const vertex_selected = this._select_event(ev, \"replace\", [vertex_renderer]);\n const point_ds = vertex_renderer.data_source;\n // Type once dataspecs are typed\n const point_glyph = vertex_renderer.glyph;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (vertex_selected.length > 0) {\n // If existing vertex is hit split path at that location\n // converting to feature vertex\n const index = point_ds.selected.indices[0];\n if (pxkey) {\n x = point_ds.get(pxkey)[index];\n }\n if (pykey) {\n y = point_ds.get(pykey)[index];\n }\n if (ev.type != \"move\") {\n this._split_path(x, y);\n }\n point_ds.selection_manager.clear();\n }\n }\n return [x, y];\n }\n _set_vertices(xs, ys, styles) {\n const { vertex_renderer } = this.model;\n if (vertex_renderer == null) {\n return;\n }\n const point_glyph = vertex_renderer.glyph;\n const point_cds = vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs)) {\n point_cds.set(pxkey, xs);\n }\n else {\n point_glyph.x = { value: xs };\n }\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys)) {\n point_cds.set(pykey, ys);\n }\n else {\n point_glyph.y = { value: ys };\n }\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.set(key, styles[key]);\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.set(col, []);\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _show_vertices() {\n if (!this.model.active) {\n return;\n }\n const { renderers, node_style, end_style } = this.model;\n const xs = [];\n const ys = [];\n const styles = {};\n for (const key of (0, object_1.keys)(end_style)) {\n styles[key] = [];\n }\n for (let i = 0; i < renderers.length; i++) {\n const renderer = renderers[i];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n for (const array of cds.get_array(xkey)) {\n (0, assert_1.assert)((0, types_1.isArray)(array));\n xs.push(...array);\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n for (const [key, val] of (0, object_1.entries)(node_style)) {\n for (let index = 0; index < array.length - 2; index++) {\n styles[key].push(val);\n }\n }\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n }\n for (const array of cds.get_array(ykey)) {\n (0, assert_1.assert)((0, types_1.isArray)(array));\n ys.push(...array);\n }\n if (this._drawing && i == renderers.length - 1) {\n // Skip currently drawn vertex\n xs.splice(xs.length - 1, 1);\n ys.splice(ys.length - 1, 1);\n for (const [_, array] of (0, object_1.entries)(styles)) {\n array.splice(array.length - 1, 1);\n }\n }\n }\n this._set_vertices(xs, ys, styles);\n }\n _remove() {\n const renderer = this.model.renderers[0];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n if ((0, vectorization_1.isField)(glyph.xs)) {\n const xkey = glyph.xs.field;\n const array = cds.get_array(xkey);\n const xidx = array.length - 1;\n const xs = array[xidx];\n xs.splice(xs.length - 1, 1);\n if (xs.length == 1) {\n array.splice(xidx, 1);\n }\n }\n if ((0, vectorization_1.isField)(glyph.ys)) {\n const ykey = glyph.ys.field;\n const array = cds.get_array(ykey);\n const yidx = array.length - 1;\n const ys = array[yidx];\n ys.splice(ys.length - 1, 1);\n if (ys.length == 1) {\n array.splice(yidx, 1);\n }\n }\n this._emit_cds_changes(cds);\n this._drawing = false;\n this._show_vertices();\n }\n }\n exports.PolyVertexDrawToolView = PolyVertexDrawToolView;\n PolyVertexDrawToolView.__name__ = \"PolyVertexDrawToolView\";\n class PolyVertexDrawTool extends poly_draw_tool_1.PolyDrawTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexDrawTool = PolyVertexDrawTool;\n _a = PolyVertexDrawTool;\n PolyVertexDrawTool.__name__ = \"PolyVertexDrawTool\";\n PolyVertexDrawTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexDrawToolView;\n _a.define(({ Dict, Unknown }) => ({\n end_style: [Dict(Unknown), {}],\n node_style: [Dict(Unknown), {}],\n }));\n })();\n}\n","/* models/poly_edit.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const poly_edit_tool_1 = require(\"@bokehjs/models/tools/edit/poly_edit_tool\");\n class PolyVertexEditToolView extends poly_edit_tool_1.PolyEditToolView {\n deactivate() {\n this._hide_vertices();\n if (this._selected_renderer == null) {\n return;\n }\n else if (this._drawing) {\n this._remove_vertex();\n this._drawing = false;\n }\n this._emit_cds_changes(this._selected_renderer.data_source, false, true, false);\n }\n _pan(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null) {\n return;\n }\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n if (this._selected_renderer != null) {\n this._selected_renderer.data_source.change.emit();\n }\n }\n _pan_end(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null) {\n return;\n }\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n this._emit_cds_changes(this.model.vertex_renderer.data_source, false, true, true);\n if (this._selected_renderer != null) {\n this._emit_cds_changes(this._selected_renderer.data_source);\n }\n this._basepoint = null;\n }\n _drag_points(ev, renderers) {\n if (this._basepoint == null) {\n return [];\n }\n const [bx, by] = this._basepoint;\n const points = [];\n for (const renderer of renderers) {\n const basepoint = this._map_drag(bx, by, renderer);\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null || basepoint == null) {\n continue;\n }\n const [x, y] = point;\n const [px, py] = basepoint;\n const [dx, dy] = [x - px, y - py];\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n for (const index of cds.selected.indices) {\n const point = [];\n if (xkey) {\n const xs = cds.get(xkey);\n point.push(xs[index]);\n xs[index] += dx;\n }\n if (ykey) {\n const ys = cds.get(ykey);\n point.push(ys[index]);\n ys[index] += dy;\n }\n point.push(dx);\n point.push(dy);\n points.push(point);\n }\n cds.change.emit();\n }\n this._basepoint = [ev.sx, ev.sy];\n return points;\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null) {\n return;\n }\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs)) {\n point_cds.set(pxkey, xs);\n }\n else {\n point_glyph.x = { value: xs };\n }\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys)) {\n point_cds.set(pykey, ys);\n }\n else {\n point_glyph.y = { value: ys };\n }\n }\n if (styles != null) {\n for (const [key, array] of (0, object_1.entries)(styles)) {\n point_cds.set(key, array);\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.set(col, []);\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _move_linked(points) {\n if (this._selected_renderer == null) {\n return;\n }\n const renderer = this._selected_renderer;\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (const point of points) {\n const [x, y, dx, dy] = point;\n for (let index = 0; index < xpaths.length; index++) {\n const xs = xpaths[index];\n const ys = ypaths[index];\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y)) {\n xs[i] += dx;\n ys[i] += dy;\n }\n }\n }\n }\n }\n _tap(ev) {\n if (this.model.vertex_renderer == null) {\n return;\n }\n const renderer = this.model.vertex_renderer;\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null) {\n return;\n }\n else if (this._drawing && this._selected_renderer != null) {\n let [x, y] = point;\n const cds = renderer.data_source;\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n const indices = cds.selected.indices;\n [x, y] = this._snap_to_vertex(ev, x, y);\n const index = indices[0];\n cds.selected.indices = [index + 1];\n if (xkey) {\n const xs = cds.get_array(xkey);\n const nx = xs[index];\n xs[index] = x;\n xs.splice(index + 1, 0, nx);\n }\n if (ykey) {\n const ys = cds.get_array(ykey);\n const ny = ys[index];\n ys[index] = y;\n ys.splice(index + 1, 0, ny);\n }\n cds.change.emit();\n this._emit_cds_changes(this._selected_renderer.data_source, true, false, true);\n return;\n }\n this._select_event(ev, this._select_mode(ev), [renderer]);\n }\n _show_vertices(ev) {\n if (!this.model.active) {\n return;\n }\n const renderers = this._select_event(ev, \"replace\", this.model.renderers);\n if (renderers.length === 0) {\n this._hide_vertices();\n this._selected_renderer = null;\n this._drawing = false;\n return;\n }\n const renderer = renderers[0];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const index = cds.selected.indices[0];\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n let xs;\n let ys;\n if (xkey) {\n xs = cds.get(xkey)[index];\n if (!(0, types_1.isArray)(xs)) {\n cds.get(xkey)[index] = xs = Array.from(xs);\n }\n }\n else {\n xs = glyph.xs.value;\n }\n if (ykey) {\n ys = cds.get(ykey)[index];\n if (!(0, types_1.isArray)(ys)) {\n cds.get(ykey)[index] = ys = Array.from(ys);\n }\n }\n else {\n ys = glyph.ys.value;\n }\n const { end_style, node_style } = this.model;\n const styles = {};\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key] = [val];\n }\n for (const [key, val] of (0, object_1.entries)(node_style)) {\n for (let index = 0; index < xs.length - 2; index++) {\n styles[key].push(val);\n }\n }\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n this._selected_renderer = renderer;\n this._set_vertices(xs, ys, styles);\n }\n }\n exports.PolyVertexEditToolView = PolyVertexEditToolView;\n PolyVertexEditToolView.__name__ = \"PolyVertexEditToolView\";\n class PolyVertexEditTool extends poly_edit_tool_1.PolyEditTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexEditTool = PolyVertexEditTool;\n _a = PolyVertexEditTool;\n PolyVertexEditTool.__name__ = \"PolyVertexEditTool\";\n PolyVertexEditTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexEditToolView;\n _a.define(({ Dict, Unknown }) => ({\n end_style: [Dict(Unknown), {}],\n node_style: [Dict(Unknown), {}],\n }));\n })();\n}\n","/* models/restore_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class RestoreToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n const new_data = source.buffer?.pop();\n if (new_data == null) {\n continue;\n }\n source.data = new_data;\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n }\n exports.RestoreToolView = RestoreToolView;\n RestoreToolView.__name__ = \"RestoreToolView\";\n class RestoreTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Restore\";\n this.tool_icon = icons_css_1.tool_icon_undo;\n }\n }\n exports.RestoreTool = RestoreTool;\n _a = RestoreTool;\n RestoreTool.__name__ = \"RestoreTool\";\n RestoreTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = RestoreToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n"]}
|
package/dist/geoviews.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":4,"artifacts":[{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/index.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"index.js","canonical":"index","resolution":"ESM","id":"c764d38756","hash":"c764d387562670624c9da140449548667d1588e6dd8d12da2fe04c18f1fadf6b","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GeoViews = void 0;\nconst tslib_1 = require(\"tslib\");\nconst GeoViews = tslib_1.__importStar(require(\"./models\"));\nexports.GeoViews = GeoViews;\nconst base_1 = require(\"@bokehjs/base\");\n(0, base_1.register_models)(GeoViews);\n//# sourceMappingURL=index.js.map\n","type":"js","dependency_paths":[["./models","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/index.js"]],"dependency_map":[],"exported":[],"externals":[],"shims":[]},"code":{"source":"/* index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n const tslib_1 = require(\"tslib\");\n const GeoViews = tslib_1.__importStar(require(\"b4555bea44\") /* ./models */);\n exports.GeoViews = GeoViews;\n const base_1 = require(\"@bokehjs/base\");\n (0, base_1.register_models)(GeoViews);\n}\n","min_source":"function _(e,s,o,t,b){t();const i=e(\"tslib\").__importStar(e(\"b4555bea44\"));o.GeoViews=i;(0,e(\"@bokehjs/base\").register_models)(i)}\n//# sourceMappingURL=index.min.js.map","min_map":"{\"version\":3,\"file\":\"index.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"GeoViews\",\"__importStar\",\"register_models\"],\"sources\":[\"0\"],\"mappings\":\"AAAe,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAC5DD,IACA,MACME,EADUL,EAAQ,SACCM,aAAaN,EAAQ,eAC9CE,EAAQG,SAAWA,GAEnB,EADeL,EAAQ,iBACZO,iBAAiBF,EAChC\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/index.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/index.js","canonical":"models/index","resolution":"ESM","id":"b4555bea44","hash":"b4555bea4497cc5bbb2ea67ae1cbd42552a9de3a7d8633abf56c3a7ca693300d","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RestoreTool = exports.PolyVertexEditTool = exports.PolyVertexDrawTool = exports.ClearTool = exports.CheckpointTool = void 0;\nvar checkpoint_tool_1 = require(\"./checkpoint_tool\");\nObject.defineProperty(exports, \"CheckpointTool\", { enumerable: true, get: function () { return checkpoint_tool_1.CheckpointTool; } });\nvar clear_tool_1 = require(\"./clear_tool\");\nObject.defineProperty(exports, \"ClearTool\", { enumerable: true, get: function () { return clear_tool_1.ClearTool; } });\nvar poly_draw_1 = require(\"./poly_draw\");\nObject.defineProperty(exports, \"PolyVertexDrawTool\", { enumerable: true, get: function () { return poly_draw_1.PolyVertexDrawTool; } });\nvar poly_edit_1 = require(\"./poly_edit\");\nObject.defineProperty(exports, \"PolyVertexEditTool\", { enumerable: true, get: function () { return poly_edit_1.PolyVertexEditTool; } });\nvar restore_tool_1 = require(\"./restore_tool\");\nObject.defineProperty(exports, \"RestoreTool\", { enumerable: true, get: function () { return restore_tool_1.RestoreTool; } });\n//# sourceMappingURL=index.js.map\n","type":"js","dependency_paths":[["./checkpoint_tool","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/checkpoint_tool.js"],["./clear_tool","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/clear_tool.js"],["./poly_draw","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_draw.js"],["./poly_edit","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_edit.js"],["./restore_tool","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/restore_tool.js"]],"dependency_map":[],"exported":[{"type":"bindings","bindings":[[null,"CheckpointTool"]],"module":"./checkpoint_tool"},{"type":"bindings","bindings":[[null,"ClearTool"]],"module":"./clear_tool"},{"type":"bindings","bindings":[[null,"PolyVertexDrawTool"]],"module":"./poly_draw"},{"type":"bindings","bindings":[[null,"PolyVertexEditTool"]],"module":"./poly_edit"},{"type":"bindings","bindings":[[null,"RestoreTool"]],"module":"./restore_tool"}],"externals":[],"shims":[]},"code":{"source":"/* models/index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var checkpoint_tool_1 = require(\"1d7c6c8516\") /* ./checkpoint_tool */;\n __esExport(\"CheckpointTool\", checkpoint_tool_1.CheckpointTool);\n var clear_tool_1 = require(\"1c15765006\") /* ./clear_tool */;\n __esExport(\"ClearTool\", clear_tool_1.ClearTool);\n var poly_draw_1 = require(\"cddc7627cc\") /* ./poly_draw */;\n __esExport(\"PolyVertexDrawTool\", poly_draw_1.PolyVertexDrawTool);\n var poly_edit_1 = require(\"8837add128\") /* ./poly_edit */;\n __esExport(\"PolyVertexEditTool\", poly_edit_1.PolyVertexEditTool);\n var restore_tool_1 = require(\"92294e6ad2\") /* ./restore_tool */;\n __esExport(\"RestoreTool\", restore_tool_1.RestoreTool);\n}\n","min_source":"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)}\n//# sourceMappingURL=index.min.js.map","min_map":"{\"version\":3,\"file\":\"index.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"CheckpointTool\",\"ClearTool\",\"PolyVertexDrawTool\",\"PolyVertexEditTool\",\"RestoreTool\"],\"sources\":[\"0\"],\"mappings\":\"AAAsB,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GACnED,IAEAC,EAAW,iBADaJ,EAAQ,cACeK,gBAE/CD,EAAW,YADQJ,EAAQ,cACUM,WAErCF,EAAW,qBADOJ,EAAQ,cACmBO,oBAE7CH,EAAW,qBADOJ,EAAQ,cACmBQ,oBAE7CJ,EAAW,cADUJ,EAAQ,cACYS,YAC7C\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/checkpoint_tool.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/checkpoint_tool.js","canonical":"models/checkpoint_tool","resolution":"ESM","id":"1d7c6c8516","hash":"1d7c6c8516c8cfba888a69803c918bbacfd80008dc3044c6b69dca8c77c5a048","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CheckpointTool = exports.CheckpointToolView = void 0;\nvar _a;\nconst array_1 = require(\"@bokehjs/core/util/array\");\nconst action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\nconst column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\nconst icons_css_1 = require(\"@bokehjs/styles/icons.css\");\nclass CheckpointToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (!source.buffer) {\n source.buffer = [];\n }\n let data_copy = {};\n for (const key in source.data) {\n const column = source.data[key];\n const new_column = [];\n for (const arr of column) {\n if (Array.isArray(arr) || (ArrayBuffer.isView(arr))) {\n new_column.push((0, array_1.copy)(arr));\n }\n else {\n new_column.push(arr);\n }\n }\n data_copy[key] = new_column;\n }\n source.buffer.push(data_copy);\n }\n }\n}\nexports.CheckpointToolView = CheckpointToolView;\nCheckpointToolView.__name__ = \"CheckpointToolView\";\nclass CheckpointTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Checkpoint\";\n this.tool_icon = icons_css_1.tool_icon_save;\n }\n}\nexports.CheckpointTool = CheckpointTool;\n_a = CheckpointTool;\nCheckpointTool.__name__ = \"CheckpointTool\";\nCheckpointTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = CheckpointToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n})();\n//# sourceMappingURL=checkpoint_tool.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"CheckpointToolView"},{"type":"named","name":"CheckpointTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/checkpoint_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const array_1 = require(\"@bokehjs/core/util/array\");\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class CheckpointToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (!source.buffer) {\n source.buffer = [];\n }\n let data_copy = {};\n for (const key in source.data) {\n const column = source.data[key];\n const new_column = [];\n for (const arr of column) {\n if (Array.isArray(arr) || (ArrayBuffer.isView(arr))) {\n new_column.push((0, array_1.copy)(arr));\n }\n else {\n new_column.push(arr);\n }\n }\n data_copy[key] = new_column;\n }\n source.buffer.push(data_copy);\n }\n }\n }\n exports.CheckpointToolView = CheckpointToolView;\n CheckpointToolView.__name__ = \"CheckpointToolView\";\n class CheckpointTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Checkpoint\";\n this.tool_icon = icons_css_1.tool_icon_save;\n }\n }\n exports.CheckpointTool = CheckpointTool;\n _a = CheckpointTool;\n CheckpointTool.__name__ = \"CheckpointTool\";\n CheckpointTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = CheckpointToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","min_source":"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)),[]]})))}\n//# sourceMappingURL=checkpoint_tool.min.js.map","min_map":"{\"version\":3,\"file\":\"checkpoint_tool.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"array_1\",\"action_tool_1\",\"column_data_source_1\",\"icons_css_1\",\"CheckpointToolView\",\"ActionToolView\",\"doit\",\"sources\",\"this\",\"model\",\"source\",\"buffer\",\"data_copy\",\"key\",\"data\",\"column\",\"new_column\",\"arr\",\"Array\",\"isArray\",\"ArrayBuffer\",\"isView\",\"push\",\"copy\",\"__name__\",\"CheckpointTool\",\"ActionTool\",\"constructor\",\"attrs\",\"super\",\"tool_name\",\"tool_icon\",\"tool_icon_save\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Ref\",\"ColumnDataSource\"],\"sources\":[\"0\"],\"mappings\":\"AAAgC,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAE7E,IAAIC,EADJF,IAEA,MAAMG,EAAUN,EAAQ,4BAClBO,EAAgBP,EAAQ,6CACxBQ,EAAuBR,EAAQ,8CAC/BS,EAAcT,EAAQ,6BAC5B,MAAMU,UAA2BH,EAAcI,eAC3C,IAAAC,GACI,MAAMC,EAAUC,KAAKC,MAAMF,QAC3B,IAAK,MAAMG,KAAUH,EAAS,CACrBG,EAAOC,SACRD,EAAOC,OAAS,IAEpB,IAAIC,EAAY,CAAC,EACjB,IAAK,MAAMC,KAAOH,EAAOI,KAAM,CAC3B,MAAMC,EAASL,EAAOI,KAAKD,GACrBG,EAAa,GACnB,IAAK,MAAMC,KAAOF,EACVG,MAAMC,QAAQF,IAASG,YAAYC,OAAOJ,GAC1CD,EAAWM,MAAK,EAAItB,EAAQuB,MAAMN,IAGlCD,EAAWM,KAAKL,GAGxBL,EAAUC,GAAOG,CACrB,CACAN,EAAOC,OAAOW,KAAKV,EACvB,CACJ,EAEJhB,EAAQQ,mBAAqBA,EAC7BA,EAAmBoB,SAAW,qBAC9B,MAAMC,UAAuBxB,EAAcyB,WACvC,WAAAC,CAAYC,GACRC,MAAMD,GACNpB,KAAKsB,UAAY,aACjBtB,KAAKuB,UAAY5B,EAAY6B,cACjC,EAEJpC,EAAQ6B,eAAiBA,EACzB1B,EAAK0B,EACLA,EAAeD,SAAW,iBAC1BC,EAAeQ,WAAa,+BAExBlC,EAAGmC,UAAUC,aAAe/B,EAC5BL,EAAGqC,QAAO,EAAGlB,QAAOmB,UAAU,CAC1B9B,QAAS,CAACW,EAAMmB,EAAInC,EAAqBoC,mBAAoB,OAGzE\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/clear_tool.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/clear_tool.js","canonical":"models/clear_tool","resolution":"ESM","id":"1c15765006","hash":"1c15765006e6c171d23c6cc5f80f4c60a735fc05b57b55a3c9eac79f684df738","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClearTool = exports.ClearToolView = void 0;\nvar _a;\nconst action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\nconst column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\nconst icons_css_1 = require(\"@bokehjs/styles/icons.css\");\nclass ClearToolView extends action_tool_1.ActionToolView {\n doit() {\n for (var source of this.model.sources) {\n for (const column in source.data) {\n source.data[column] = [];\n }\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n}\nexports.ClearToolView = ClearToolView;\nClearToolView.__name__ = \"ClearToolView\";\nclass ClearTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Clear data\";\n this.tool_icon = icons_css_1.tool_icon_reset;\n }\n}\nexports.ClearTool = ClearTool;\n_a = ClearTool;\nClearTool.__name__ = \"ClearTool\";\nClearTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = ClearToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n})();\n//# sourceMappingURL=clear_tool.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"ClearToolView"},{"type":"named","name":"ClearTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/clear_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class ClearToolView extends action_tool_1.ActionToolView {\n doit() {\n for (var source of this.model.sources) {\n for (const column in source.data) {\n source.data[column] = [];\n }\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n }\n exports.ClearToolView = ClearToolView;\n ClearToolView.__name__ = \"ClearToolView\";\n class ClearTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Clear data\";\n this.tool_icon = icons_css_1.tool_icon_reset;\n }\n }\n exports.ClearTool = ClearTool;\n _a = ClearTool;\n ClearTool.__name__ = \"ClearTool\";\n ClearTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = ClearToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","min_source":"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)),[]]})))}\n//# sourceMappingURL=clear_tool.min.js.map","min_map":"{\"version\":3,\"file\":\"clear_tool.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"action_tool_1\",\"column_data_source_1\",\"icons_css_1\",\"ClearToolView\",\"ActionToolView\",\"doit\",\"source\",\"this\",\"model\",\"sources\",\"column\",\"data\",\"change\",\"emit\",\"properties\",\"__name__\",\"ClearTool\",\"ActionTool\",\"constructor\",\"attrs\",\"super\",\"tool_name\",\"tool_icon\",\"tool_icon_reset\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Array\",\"Ref\",\"ColumnDataSource\"],\"sources\":[\"0\"],\"mappings\":\"AAA2B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAExE,IAAIC,EADJF,IAEA,MAAMG,EAAgBN,EAAQ,6CACxBO,EAAuBP,EAAQ,8CAC/BQ,EAAcR,EAAQ,6BAC5B,MAAMS,UAAsBH,EAAcI,eACtC,IAAAC,GACI,IAAK,IAAIC,KAAUC,KAAKC,MAAMC,QAAS,CACnC,IAAK,MAAMC,KAAUJ,EAAOK,KACxBL,EAAOK,KAAKD,GAAU,GAE1BJ,EAAOM,OAAOC,OACdP,EAAOQ,WAAWH,KAAKC,OAAOC,MAClC,CACJ,EAEJjB,EAAQO,cAAgBA,EACxBA,EAAcY,SAAW,gBACzB,MAAMC,UAAkBhB,EAAciB,WAClC,WAAAC,CAAYC,GACRC,MAAMD,GACNZ,KAAKc,UAAY,aACjBd,KAAKe,UAAYpB,EAAYqB,eACjC,EAEJ3B,EAAQoB,UAAYA,EACpBjB,EAAKiB,EACLA,EAAUD,SAAW,YACrBC,EAAUQ,WAAa,+BAEnBzB,EAAG0B,UAAUC,aAAevB,EAC5BJ,EAAG4B,QAAO,EAAGC,QAAOC,UAAU,CAC1BpB,QAAS,CAACmB,EAAMC,EAAI5B,EAAqB6B,mBAAoB,OAGzE\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_draw.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/poly_draw.js","canonical":"models/poly_draw","resolution":"ESM","id":"cddc7627cc","hash":"cddc7627cc8ef2596322d256f9947effa09994b8826f0040a9bdb56383ea94f8","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolyVertexDrawTool = exports.PolyVertexDrawToolView = void 0;\nvar _a;\nconst object_1 = require(\"@bokehjs/core/util/object\");\nconst types_1 = require(\"@bokehjs/core/util/types\");\nconst poly_draw_tool_1 = require(\"@bokehjs/models/tools/edit/poly_draw_tool\");\nclass PolyVertexDrawToolView extends poly_draw_tool_1.PolyDrawToolView {\n _split_path(x, y) {\n for (let r = 0; r < this.model.renderers.length; r++) {\n const renderer = this.model.renderers[r];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (let index = 0; index < xpaths.length; index++) {\n let xs = xpaths[index];\n if (!(0, types_1.isArray)(xs)) {\n xs = Array.from(xs);\n cds.data[xkey][index] = xs;\n }\n let ys = ypaths[index];\n if (!(0, types_1.isArray)(ys)) {\n ys = Array.from(ys);\n cds.data[ykey][index] = ys;\n }\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y) && (i != 0) && (i != (xs.length - 1))) {\n xpaths.splice(index + 1, 0, xs.slice(i));\n ypaths.splice(index + 1, 0, ys.slice(i));\n xs.splice(i + 1);\n ys.splice(i + 1);\n for (const column of cds.columns()) {\n if ((column !== xkey) && (column != ykey))\n cds.data[column].splice(index + 1, 0, cds.data[column][index]);\n }\n return;\n }\n }\n }\n }\n }\n _snap_to_vertex(ev, x, y) {\n if (this.model.vertex_renderer) {\n // If an existing vertex is hit snap to it\n const vertex_selected = this._select_event(ev, \"replace\", [this.model.vertex_renderer]);\n const point_ds = this.model.vertex_renderer.data_source;\n // Type once dataspecs are typed\n const point_glyph = this.model.vertex_renderer.glyph;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (vertex_selected.length) {\n // If existing vertex is hit split path at that location\n // converting to feature vertex\n const index = point_ds.selected.indices[0];\n if (pxkey)\n x = point_ds.data[pxkey][index];\n if (pykey)\n y = point_ds.data[pykey][index];\n if (ev.type != 'mousemove')\n this._split_path(x, y);\n point_ds.selection_manager.clear();\n }\n }\n return [x, y];\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null)\n return;\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs))\n point_cds.data[pxkey] = xs;\n else\n point_glyph.x = { value: xs };\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys))\n point_cds.data[pykey] = ys;\n else\n point_glyph.y = { value: ys };\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.data[key] = styles[key];\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.data[col] = [];\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _show_vertices() {\n if (!this.model.active) {\n return;\n }\n const xs = [];\n const ys = [];\n const styles = {};\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key] = [];\n for (let i = 0; i < this.model.renderers.length; i++) {\n const renderer = this.model.renderers[i];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n for (const array of cds.get_array(xkey)) {\n Array.prototype.push.apply(xs, array);\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n for (const key of (0, object_1.keys)(this.model.node_style)) {\n for (let index = 0; index < (array.length - 2); index++) {\n styles[key].push(this.model.node_style[key]);\n }\n }\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n }\n for (const array of cds.get_array(ykey))\n Array.prototype.push.apply(ys, array);\n if (this._drawing && (i == (this.model.renderers.length - 1))) {\n // Skip currently drawn vertex\n xs.splice(xs.length - 1, 1);\n ys.splice(ys.length - 1, 1);\n for (const key of (0, object_1.keys)(styles))\n styles[key].splice(styles[key].length - 1, 1);\n }\n }\n this._set_vertices(xs, ys, styles);\n }\n _remove() {\n const renderer = this.model.renderers[0];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n if (xkey) {\n const xidx = cds.data[xkey].length - 1;\n const xs = cds.get_array(xkey)[xidx];\n xs.splice(xs.length - 1, 1);\n if (xs.length == 1)\n cds.data[xkey].splice(xidx, 1);\n }\n if (ykey) {\n const yidx = cds.data[ykey].length - 1;\n const ys = cds.get_array(ykey)[yidx];\n ys.splice(ys.length - 1, 1);\n if (ys.length == 1)\n cds.data[ykey].splice(yidx, 1);\n }\n this._emit_cds_changes(cds);\n this._drawing = false;\n this._show_vertices();\n }\n}\nexports.PolyVertexDrawToolView = PolyVertexDrawToolView;\nPolyVertexDrawToolView.__name__ = \"PolyVertexDrawToolView\";\nclass PolyVertexDrawTool extends poly_draw_tool_1.PolyDrawTool {\n constructor(attrs) {\n super(attrs);\n }\n}\nexports.PolyVertexDrawTool = PolyVertexDrawTool;\n_a = PolyVertexDrawTool;\nPolyVertexDrawTool.__name__ = \"PolyVertexDrawTool\";\nPolyVertexDrawTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = PolyVertexDrawToolView;\n _a.define(({ Any }) => ({\n end_style: [Any, {}],\n node_style: [Any, {}],\n }));\n})();\n//# sourceMappingURL=poly_draw.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"PolyVertexDrawToolView"},{"type":"named","name":"PolyVertexDrawTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/poly_draw.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const poly_draw_tool_1 = require(\"@bokehjs/models/tools/edit/poly_draw_tool\");\n class PolyVertexDrawToolView extends poly_draw_tool_1.PolyDrawToolView {\n _split_path(x, y) {\n for (let r = 0; r < this.model.renderers.length; r++) {\n const renderer = this.model.renderers[r];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (let index = 0; index < xpaths.length; index++) {\n let xs = xpaths[index];\n if (!(0, types_1.isArray)(xs)) {\n xs = Array.from(xs);\n cds.data[xkey][index] = xs;\n }\n let ys = ypaths[index];\n if (!(0, types_1.isArray)(ys)) {\n ys = Array.from(ys);\n cds.data[ykey][index] = ys;\n }\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y) && (i != 0) && (i != (xs.length - 1))) {\n xpaths.splice(index + 1, 0, xs.slice(i));\n ypaths.splice(index + 1, 0, ys.slice(i));\n xs.splice(i + 1);\n ys.splice(i + 1);\n for (const column of cds.columns()) {\n if ((column !== xkey) && (column != ykey))\n cds.data[column].splice(index + 1, 0, cds.data[column][index]);\n }\n return;\n }\n }\n }\n }\n }\n _snap_to_vertex(ev, x, y) {\n if (this.model.vertex_renderer) {\n // If an existing vertex is hit snap to it\n const vertex_selected = this._select_event(ev, \"replace\", [this.model.vertex_renderer]);\n const point_ds = this.model.vertex_renderer.data_source;\n // Type once dataspecs are typed\n const point_glyph = this.model.vertex_renderer.glyph;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (vertex_selected.length) {\n // If existing vertex is hit split path at that location\n // converting to feature vertex\n const index = point_ds.selected.indices[0];\n if (pxkey)\n x = point_ds.data[pxkey][index];\n if (pykey)\n y = point_ds.data[pykey][index];\n if (ev.type != 'mousemove')\n this._split_path(x, y);\n point_ds.selection_manager.clear();\n }\n }\n return [x, y];\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null)\n return;\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs))\n point_cds.data[pxkey] = xs;\n else\n point_glyph.x = { value: xs };\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys))\n point_cds.data[pykey] = ys;\n else\n point_glyph.y = { value: ys };\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.data[key] = styles[key];\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.data[col] = [];\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _show_vertices() {\n if (!this.model.active) {\n return;\n }\n const xs = [];\n const ys = [];\n const styles = {};\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key] = [];\n for (let i = 0; i < this.model.renderers.length; i++) {\n const renderer = this.model.renderers[i];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n for (const array of cds.get_array(xkey)) {\n Array.prototype.push.apply(xs, array);\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n for (const key of (0, object_1.keys)(this.model.node_style)) {\n for (let index = 0; index < (array.length - 2); index++) {\n styles[key].push(this.model.node_style[key]);\n }\n }\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n }\n for (const array of cds.get_array(ykey))\n Array.prototype.push.apply(ys, array);\n if (this._drawing && (i == (this.model.renderers.length - 1))) {\n // Skip currently drawn vertex\n xs.splice(xs.length - 1, 1);\n ys.splice(ys.length - 1, 1);\n for (const key of (0, object_1.keys)(styles))\n styles[key].splice(styles[key].length - 1, 1);\n }\n }\n this._set_vertices(xs, ys, styles);\n }\n _remove() {\n const renderer = this.model.renderers[0];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n if (xkey) {\n const xidx = cds.data[xkey].length - 1;\n const xs = cds.get_array(xkey)[xidx];\n xs.splice(xs.length - 1, 1);\n if (xs.length == 1)\n cds.data[xkey].splice(xidx, 1);\n }\n if (ykey) {\n const yidx = cds.data[ykey].length - 1;\n const ys = cds.get_array(ykey)[yidx];\n ys.splice(ys.length - 1, 1);\n if (ys.length == 1)\n cds.data[ykey].splice(yidx, 1);\n }\n this._emit_cds_changes(cds);\n this._drawing = false;\n this._show_vertices();\n }\n }\n exports.PolyVertexDrawToolView = PolyVertexDrawToolView;\n PolyVertexDrawToolView.__name__ = \"PolyVertexDrawToolView\";\n class PolyVertexDrawTool extends poly_draw_tool_1.PolyDrawTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexDrawTool = PolyVertexDrawTool;\n _a = PolyVertexDrawTool;\n PolyVertexDrawTool.__name__ = \"PolyVertexDrawTool\";\n PolyVertexDrawTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexDrawToolView;\n _a.define(({ Any }) => ({\n end_style: [Any, {}],\n node_style: [Any, {}],\n }));\n })();\n}\n","min_source":"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,{}]})))}\n//# sourceMappingURL=poly_draw.min.js.map","min_map":"{\"version\":3,\"file\":\"poly_draw.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"object_1\",\"types_1\",\"poly_draw_tool_1\",\"PolyVertexDrawToolView\",\"PolyDrawToolView\",\"_split_path\",\"x\",\"y\",\"r\",\"this\",\"model\",\"renderers\",\"length\",\"renderer\",\"glyph\",\"cds\",\"data_source\",\"xkey\",\"ykey\",\"xs\",\"field\",\"ys\",\"xpaths\",\"data\",\"ypaths\",\"index\",\"isArray\",\"Array\",\"from\",\"i\",\"splice\",\"slice\",\"column\",\"columns\",\"_snap_to_vertex\",\"ev\",\"vertex_renderer\",\"vertex_selected\",\"_select_event\",\"point_ds\",\"point_glyph\",\"pxkey\",\"pykey\",\"selected\",\"indices\",\"type\",\"selection_manager\",\"clear\",\"_set_vertices\",\"styles\",\"point_cds\",\"value\",\"key\",\"keys\",\"col\",\"_emit_cds_changes\",\"_show_vertices\",\"active\",\"end_style\",\"array\",\"get_array\",\"prototype\",\"push\",\"apply\",\"node_style\",\"_drawing\",\"_remove\",\"xidx\",\"yidx\",\"__name__\",\"PolyVertexDrawTool\",\"PolyDrawTool\",\"constructor\",\"attrs\",\"super\",\"__module__\",\"default_view\",\"define\",\"Any\"],\"sources\":[\"0\"],\"mappings\":\"AAA0B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAEvE,IAAIC,EADJF,IAEA,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G/B\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_edit.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/poly_edit.js","canonical":"models/poly_edit","resolution":"ESM","id":"8837add128","hash":"8837add1281abc13258fcbb6f74fd47b4235c144299467ada4a7893547efffa1","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolyVertexEditTool = exports.PolyVertexEditToolView = void 0;\nvar _a;\nconst object_1 = require(\"@bokehjs/core/util/object\");\nconst types_1 = require(\"@bokehjs/core/util/types\");\nconst poly_edit_tool_1 = require(\"@bokehjs/models/tools/edit/poly_edit_tool\");\nclass PolyVertexEditToolView extends poly_edit_tool_1.PolyEditToolView {\n deactivate() {\n this._hide_vertices();\n if (!this._selected_renderer) {\n return;\n }\n else if (this._drawing) {\n this._remove_vertex();\n this._drawing = false;\n }\n this._emit_cds_changes(this._selected_renderer.data_source, false, true, false);\n }\n _pan(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null)\n return;\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n if (this._selected_renderer)\n this._selected_renderer.data_source.change.emit();\n }\n _pan_end(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null)\n return;\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n this._emit_cds_changes(this.model.vertex_renderer.data_source, false, true, true);\n if (this._selected_renderer) {\n this._emit_cds_changes(this._selected_renderer.data_source);\n }\n this._basepoint = null;\n }\n _drag_points(ev, renderers) {\n if (this._basepoint == null)\n return [];\n const [bx, by] = this._basepoint;\n const points = [];\n for (const renderer of renderers) {\n const basepoint = this._map_drag(bx, by, renderer);\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null || basepoint == null) {\n continue;\n }\n const [x, y] = point;\n const [px, py] = basepoint;\n const [dx, dy] = [x - px, y - py];\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n for (const index of cds.selected.indices) {\n const point = [];\n if (xkey) {\n point.push(cds.data[xkey][index]);\n cds.data[xkey][index] += dx;\n }\n if (ykey) {\n point.push(cds.data[ykey][index]);\n cds.data[ykey][index] += dy;\n }\n point.push(dx);\n point.push(dy);\n points.push(point);\n }\n cds.change.emit();\n }\n this._basepoint = [ev.sx, ev.sy];\n return points;\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null)\n return;\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs))\n point_cds.data[pxkey] = xs;\n else\n point_glyph.x = { value: xs };\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys))\n point_cds.data[pykey] = ys;\n else\n point_glyph.y = { value: ys };\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.data[key] = styles[key];\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.data[col] = [];\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _move_linked(points) {\n if (!this._selected_renderer)\n return;\n const renderer = this._selected_renderer;\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (const point of points) {\n const [x, y, dx, dy] = point;\n for (let index = 0; index < xpaths.length; index++) {\n const xs = xpaths[index];\n const ys = ypaths[index];\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y)) {\n xs[i] += dx;\n ys[i] += dy;\n }\n }\n }\n }\n }\n _tap(ev) {\n if (this.model.vertex_renderer == null)\n return;\n const renderer = this.model.vertex_renderer;\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null)\n return;\n else if (this._drawing && this._selected_renderer) {\n let [x, y] = point;\n const cds = renderer.data_source;\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n const indices = cds.selected.indices;\n [x, y] = this._snap_to_vertex(ev, x, y);\n const index = indices[0];\n cds.selected.indices = [index + 1];\n if (xkey) {\n const xs = cds.get_array(xkey);\n const nx = xs[index];\n xs[index] = x;\n xs.splice(index + 1, 0, nx);\n }\n if (ykey) {\n const ys = cds.get_array(ykey);\n const ny = ys[index];\n ys[index] = y;\n ys.splice(index + 1, 0, ny);\n }\n cds.change.emit();\n this._emit_cds_changes(this._selected_renderer.data_source, true, false, true);\n return;\n }\n this._select_event(ev, this._select_mode(ev), [renderer]);\n }\n _show_vertices(ev) {\n if (!this.model.active)\n return;\n const renderers = this._select_event(ev, \"replace\", this.model.renderers);\n if (!renderers.length) {\n this._hide_vertices();\n this._selected_renderer = null;\n this._drawing = false;\n return;\n }\n const renderer = renderers[0];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const index = cds.selected.indices[0];\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n let xs;\n let ys;\n if (xkey) {\n xs = cds.data[xkey][index];\n if (!(0, types_1.isArray)(xs))\n cds.data[xkey][index] = xs = Array.from(xs);\n }\n else {\n xs = glyph.xs.value;\n }\n if (ykey) {\n ys = cds.data[ykey][index];\n if (!(0, types_1.isArray)(ys))\n cds.data[ykey][index] = ys = Array.from(ys);\n }\n else {\n ys = glyph.ys.value;\n }\n const styles = {};\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key] = [this.model.end_style[key]];\n for (const key of (0, object_1.keys)(this.model.node_style)) {\n for (let index = 0; index < (xs.length - 2); index++) {\n styles[key].push(this.model.node_style[key]);\n }\n }\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n this._selected_renderer = renderer;\n this._set_vertices(xs, ys, styles);\n }\n}\nexports.PolyVertexEditToolView = PolyVertexEditToolView;\nPolyVertexEditToolView.__name__ = \"PolyVertexEditToolView\";\nclass PolyVertexEditTool extends poly_edit_tool_1.PolyEditTool {\n constructor(attrs) {\n super(attrs);\n }\n}\nexports.PolyVertexEditTool = PolyVertexEditTool;\n_a = PolyVertexEditTool;\nPolyVertexEditTool.__name__ = \"PolyVertexEditTool\";\nPolyVertexEditTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = PolyVertexEditToolView;\n _a.define(({ Any }) => ({\n end_style: [Any, {}],\n node_style: [Any, {}],\n }));\n})();\n//# sourceMappingURL=poly_edit.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"PolyVertexEditToolView"},{"type":"named","name":"PolyVertexEditTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/poly_edit.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const poly_edit_tool_1 = require(\"@bokehjs/models/tools/edit/poly_edit_tool\");\n class PolyVertexEditToolView extends poly_edit_tool_1.PolyEditToolView {\n deactivate() {\n this._hide_vertices();\n if (!this._selected_renderer) {\n return;\n }\n else if (this._drawing) {\n this._remove_vertex();\n this._drawing = false;\n }\n this._emit_cds_changes(this._selected_renderer.data_source, false, true, false);\n }\n _pan(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null)\n return;\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n if (this._selected_renderer)\n this._selected_renderer.data_source.change.emit();\n }\n _pan_end(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null)\n return;\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n this._emit_cds_changes(this.model.vertex_renderer.data_source, false, true, true);\n if (this._selected_renderer) {\n this._emit_cds_changes(this._selected_renderer.data_source);\n }\n this._basepoint = null;\n }\n _drag_points(ev, renderers) {\n if (this._basepoint == null)\n return [];\n const [bx, by] = this._basepoint;\n const points = [];\n for (const renderer of renderers) {\n const basepoint = this._map_drag(bx, by, renderer);\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null || basepoint == null) {\n continue;\n }\n const [x, y] = point;\n const [px, py] = basepoint;\n const [dx, dy] = [x - px, y - py];\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n for (const index of cds.selected.indices) {\n const point = [];\n if (xkey) {\n point.push(cds.data[xkey][index]);\n cds.data[xkey][index] += dx;\n }\n if (ykey) {\n point.push(cds.data[ykey][index]);\n cds.data[ykey][index] += dy;\n }\n point.push(dx);\n point.push(dy);\n points.push(point);\n }\n cds.change.emit();\n }\n this._basepoint = [ev.sx, ev.sy];\n return points;\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null)\n return;\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs))\n point_cds.data[pxkey] = xs;\n else\n point_glyph.x = { value: xs };\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys))\n point_cds.data[pykey] = ys;\n else\n point_glyph.y = { value: ys };\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.data[key] = styles[key];\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.data[col] = [];\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _move_linked(points) {\n if (!this._selected_renderer)\n return;\n const renderer = this._selected_renderer;\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (const point of points) {\n const [x, y, dx, dy] = point;\n for (let index = 0; index < xpaths.length; index++) {\n const xs = xpaths[index];\n const ys = ypaths[index];\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y)) {\n xs[i] += dx;\n ys[i] += dy;\n }\n }\n }\n }\n }\n _tap(ev) {\n if (this.model.vertex_renderer == null)\n return;\n const renderer = this.model.vertex_renderer;\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null)\n return;\n else if (this._drawing && this._selected_renderer) {\n let [x, y] = point;\n const cds = renderer.data_source;\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n const indices = cds.selected.indices;\n [x, y] = this._snap_to_vertex(ev, x, y);\n const index = indices[0];\n cds.selected.indices = [index + 1];\n if (xkey) {\n const xs = cds.get_array(xkey);\n const nx = xs[index];\n xs[index] = x;\n xs.splice(index + 1, 0, nx);\n }\n if (ykey) {\n const ys = cds.get_array(ykey);\n const ny = ys[index];\n ys[index] = y;\n ys.splice(index + 1, 0, ny);\n }\n cds.change.emit();\n this._emit_cds_changes(this._selected_renderer.data_source, true, false, true);\n return;\n }\n this._select_event(ev, this._select_mode(ev), [renderer]);\n }\n _show_vertices(ev) {\n if (!this.model.active)\n return;\n const renderers = this._select_event(ev, \"replace\", this.model.renderers);\n if (!renderers.length) {\n this._hide_vertices();\n this._selected_renderer = null;\n this._drawing = false;\n return;\n }\n const renderer = renderers[0];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const index = cds.selected.indices[0];\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n let xs;\n let ys;\n if (xkey) {\n xs = cds.data[xkey][index];\n if (!(0, types_1.isArray)(xs))\n cds.data[xkey][index] = xs = Array.from(xs);\n }\n else {\n xs = glyph.xs.value;\n }\n if (ykey) {\n ys = cds.data[ykey][index];\n if (!(0, types_1.isArray)(ys))\n cds.data[ykey][index] = ys = Array.from(ys);\n }\n else {\n ys = glyph.ys.value;\n }\n const styles = {};\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key] = [this.model.end_style[key]];\n for (const key of (0, object_1.keys)(this.model.node_style)) {\n for (let index = 0; index < (xs.length - 2); index++) {\n styles[key].push(this.model.node_style[key]);\n }\n }\n for (const key of (0, object_1.keys)(this.model.end_style))\n styles[key].push(this.model.end_style[key]);\n this._selected_renderer = renderer;\n this._set_vertices(xs, ys, styles);\n }\n }\n exports.PolyVertexEditToolView = PolyVertexEditToolView;\n PolyVertexEditToolView.__name__ = \"PolyVertexEditToolView\";\n class PolyVertexEditTool extends poly_edit_tool_1.PolyEditTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexEditTool = PolyVertexEditTool;\n _a = PolyVertexEditTool;\n PolyVertexEditTool.__name__ = \"PolyVertexEditTool\";\n PolyVertexEditTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexEditToolView;\n _a.define(({ Any }) => ({\n end_style: [Any, {}],\n node_style: [Any, {}],\n }));\n })();\n}\n","min_source":"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,{}]})))}\n//# sourceMappingURL=poly_edit.min.js.map","min_map":"{\"version\":3,\"file\":\"poly_edit.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"object_1\",\"types_1\",\"poly_edit_tool_1\",\"PolyVertexEditToolView\",\"PolyEditToolView\",\"deactivate\",\"this\",\"_hide_vertices\",\"_selected_renderer\",\"_drawing\",\"_remove_vertex\",\"_emit_cds_changes\",\"data_source\",\"_pan\",\"ev\",\"_basepoint\",\"model\",\"vertex_renderer\",\"points\",\"_drag_points\",\"modifiers\",\"shift\",\"_move_linked\",\"change\",\"emit\",\"_pan_end\",\"renderers\",\"bx\",\"by\",\"renderer\",\"basepoint\",\"_map_drag\",\"point\",\"sx\",\"sy\",\"x\",\"y\",\"px\",\"py\",\"dx\",\"dy\",\"glyph\",\"cds\",\"xkey\",\"ykey\",\"field\",\"index\",\"selected\",\"indices\",\"push\",\"data\",\"_set_vertices\",\"xs\",\"ys\",\"styles\",\"point_glyph\",\"point_cds\",\"pxkey\",\"pykey\",\"isArray\",\"value\",\"key\",\"keys\",\"col\",\"columns\",\"xpaths\",\"ypaths\",\"length\",\"i\",\"_tap\",\"_snap_to_vertex\",\"get_array\",\"nx\",\"splice\",\"ny\",\"_select_event\",\"_select_mode\",\"_show_vertices\",\"active\",\"Array\",\"from\",\"end_style\",\"node_style\",\"__name__\",\"PolyVertexEditTool\",\"PolyEditTool\",\"constructor\",\"attrs\",\"super\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Any\"],\"sources\":[\"0\"],\"mappings\":\"AAA0B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAEvE,IAAIC,EADJF,IAEA,MAAMG,EAAWN,EAAQ,6BACnBO,EAAUP,EAAQ,4BAClBQ,EAAmBR,EAAQ,6CACjC,MAAMS,UAA+BD,EAAiBE,iBAClD,UAAAC,GACIC,KAAKC,iBACAD,KAAKE,qBAGDF,KAAKG,WACVH,KAAKI,iBACLJ,KAAKG,UAAW,GAEpBH,KAAKK,kBAAkBL,KAAKE,mBAAmBI,aAAa,GAAO,GAAM,GAC7E,CACA,IAAAC,CAAKC,GACD,GAAuB,MAAnBR,KAAKS,YAAoD,MAA9BT,KAAKU,MAAMC,gBACtC,OACJ,MAAMC,EAASZ,KAAKa,aAAaL,EAAI,CAACR,KAAKU,MAAMC,kBAC5CH,EAAGM,UAAUC,OACdf,KAAKgB,aAAaJ,GAElBZ,KAAKE,oBACLF,KAAKE,mBAAmBI,YAAYW,OAAOC,MACnD,CACA,QAAAC,CAASX,GACL,GAAuB,MAAnBR,KAAKS,YAAoD,MAA9BT,KAAKU,MAAMC,gBACtC,OACJ,MAAMC,EAASZ,KAAKa,aAAaL,EAAI,CAACR,KA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Aa,+BAE5B1F,EAAG2F,UAAUC,aAAexF,EAC5BJ,EAAG6F,QAAO,EAAGC,UAAU,CACnBZ,UAAW,CAACY,EAAK,CAAC,GAClBX,WAAY,CAACW,EAAK,CAAC,MAG/B\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/restore_tool.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/restore_tool.js","canonical":"models/restore_tool","resolution":"ESM","id":"92294e6ad2","hash":"92294e6ad263c9b651dd5e4b6d8d4576efb38ba565e84a9bf3f5d87d647e89cc","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RestoreTool = exports.RestoreToolView = void 0;\nvar _a;\nconst action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\nconst column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\nconst icons_css_1 = require(\"@bokehjs/styles/icons.css\");\nclass RestoreToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (!source.buffer || (source.buffer.length == 0)) {\n continue;\n }\n source.data = source.buffer.pop();\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n}\nexports.RestoreToolView = RestoreToolView;\nRestoreToolView.__name__ = \"RestoreToolView\";\nclass RestoreTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Restore\";\n this.tool_icon = icons_css_1.tool_icon_undo;\n }\n}\nexports.RestoreTool = RestoreTool;\n_a = RestoreTool;\nRestoreTool.__name__ = \"RestoreTool\";\nRestoreTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = RestoreToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n})();\n//# sourceMappingURL=restore_tool.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"RestoreToolView"},{"type":"named","name":"RestoreTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/restore_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var _a;\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class RestoreToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (!source.buffer || (source.buffer.length == 0)) {\n continue;\n }\n source.data = source.buffer.pop();\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n }\n exports.RestoreToolView = RestoreToolView;\n RestoreToolView.__name__ = \"RestoreToolView\";\n class RestoreTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Restore\";\n this.tool_icon = icons_css_1.tool_icon_undo;\n }\n }\n exports.RestoreTool = RestoreTool;\n _a = RestoreTool;\n RestoreTool.__name__ = \"RestoreTool\";\n RestoreTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = RestoreToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","min_source":"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)),[]]})))}\n//# sourceMappingURL=restore_tool.min.js.map","min_map":"{\"version\":3,\"file\":\"restore_tool.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"action_tool_1\",\"column_data_source_1\",\"icons_css_1\",\"RestoreToolView\",\"ActionToolView\",\"doit\",\"sources\",\"this\",\"model\",\"source\",\"buffer\",\"length\",\"data\",\"pop\",\"change\",\"emit\",\"properties\",\"__name__\",\"RestoreTool\",\"ActionTool\",\"constructor\",\"attrs\",\"super\",\"tool_name\",\"tool_icon\",\"tool_icon_undo\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Array\",\"Ref\",\"ColumnDataSource\"],\"sources\":[\"0\"],\"mappings\":\"AAA6B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAE1E,IAAIC,EADJF,IAEA,MAAMG,EAAgBN,EAAQ,6CACxBO,EAAuBP,EAAQ,8CAC/BQ,EAAcR,EAAQ,6BAC5B,MAAMS,UAAwBH,EAAcI,eACxC,IAAAC,GACI,MAAMC,EAAUC,KAAKC,MAAMF,QAC3B,IAAK,MAAMG,KAAUH,EACZG,EAAOC,QAAmC,GAAxBD,EAAOC,OAAOC,SAGrCF,EAAOG,KAAOH,EAAOC,OAAOG,MAC5BJ,EAAOK,OAAOC,OACdN,EAAOO,WAAWJ,KAAKE,OAAOC,OAEtC,EAEJnB,EAAQO,gBAAkBA,EAC1BA,EAAgBc,SAAW,kBAC3B,MAAMC,UAAoBlB,EAAcmB,WACpC,WAAAC,CAAYC,GACRC,MAAMD,GACNd,KAAKgB,UAAY,UACjBhB,KAAKiB,UAAYtB,EAAYuB,cACjC,EAEJ7B,EAAQsB,YAAcA,EACtBnB,EAAKmB,EACLA,EAAYD,SAAW,cACvBC,EAAYQ,WAAa,+BAErB3B,EAAG4B,UAAUC,aAAezB,EAC5BJ,EAAG8B,QAAO,EAAGC,QAAOC,UAAU,CAC1BzB,QAAS,CAACwB,EAAMC,EAAI9B,EAAqB+B,mBAAoB,OAGzE\"}"}}]}
|
|
1
|
+
{"version":4,"artifacts":[{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/index.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"index.js","canonical":"index","resolution":"ESM","id":"c764d38756","hash":"c764d387562670624c9da140449548667d1588e6dd8d12da2fe04c18f1fadf6b","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GeoViews = void 0;\nconst tslib_1 = require(\"tslib\");\nconst GeoViews = tslib_1.__importStar(require(\"./models\"));\nexports.GeoViews = GeoViews;\nconst base_1 = require(\"@bokehjs/base\");\n(0, base_1.register_models)(GeoViews);\n//# sourceMappingURL=index.js.map\n","type":"js","dependency_paths":[["./models","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/index.js"]],"dependency_map":[],"exported":[],"externals":[],"shims":[]},"code":{"source":"/* index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n const tslib_1 = require(\"tslib\");\n const GeoViews = tslib_1.__importStar(require(\"b4555bea44\") /* ./models */);\n exports.GeoViews = GeoViews;\n const base_1 = require(\"@bokehjs/base\");\n (0, base_1.register_models)(GeoViews);\n}\n","min_source":"function _(e,s,o,t,b){t();const i=e(\"tslib\").__importStar(e(\"b4555bea44\"));o.GeoViews=i;(0,e(\"@bokehjs/base\").register_models)(i)}\n//# sourceMappingURL=index.min.js.map","min_map":"{\"version\":3,\"file\":\"index.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"GeoViews\",\"__importStar\",\"register_models\"],\"sources\":[\"0\"],\"mappings\":\"AAAe,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAC5DD,IACA,MACME,EADUL,EAAQ,SACCM,aAAaN,EAAQ,eAC9CE,EAAQG,SAAWA,GAEnB,EADeL,EAAQ,iBACZO,iBAAiBF,EAChC\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/index.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/index.js","canonical":"models/index","resolution":"ESM","id":"b4555bea44","hash":"b4555bea4497cc5bbb2ea67ae1cbd42552a9de3a7d8633abf56c3a7ca693300d","source":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RestoreTool = exports.PolyVertexEditTool = exports.PolyVertexDrawTool = exports.ClearTool = exports.CheckpointTool = void 0;\nvar checkpoint_tool_1 = require(\"./checkpoint_tool\");\nObject.defineProperty(exports, \"CheckpointTool\", { enumerable: true, get: function () { return checkpoint_tool_1.CheckpointTool; } });\nvar clear_tool_1 = require(\"./clear_tool\");\nObject.defineProperty(exports, \"ClearTool\", { enumerable: true, get: function () { return clear_tool_1.ClearTool; } });\nvar poly_draw_1 = require(\"./poly_draw\");\nObject.defineProperty(exports, \"PolyVertexDrawTool\", { enumerable: true, get: function () { return poly_draw_1.PolyVertexDrawTool; } });\nvar poly_edit_1 = require(\"./poly_edit\");\nObject.defineProperty(exports, \"PolyVertexEditTool\", { enumerable: true, get: function () { return poly_edit_1.PolyVertexEditTool; } });\nvar restore_tool_1 = require(\"./restore_tool\");\nObject.defineProperty(exports, \"RestoreTool\", { enumerable: true, get: function () { return restore_tool_1.RestoreTool; } });\n//# sourceMappingURL=index.js.map\n","type":"js","dependency_paths":[["./checkpoint_tool","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/checkpoint_tool.js"],["./clear_tool","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/clear_tool.js"],["./poly_draw","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_draw.js"],["./poly_edit","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_edit.js"],["./restore_tool","/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/restore_tool.js"]],"dependency_map":[],"exported":[{"type":"bindings","bindings":[[null,"CheckpointTool"]],"module":"./checkpoint_tool"},{"type":"bindings","bindings":[[null,"ClearTool"]],"module":"./clear_tool"},{"type":"bindings","bindings":[[null,"PolyVertexDrawTool"]],"module":"./poly_draw"},{"type":"bindings","bindings":[[null,"PolyVertexEditTool"]],"module":"./poly_edit"},{"type":"bindings","bindings":[[null,"RestoreTool"]],"module":"./restore_tool"}],"externals":[],"shims":[]},"code":{"source":"/* models/index.js */ function _(require, module, exports, __esModule, __esExport) {\n __esModule();\n var checkpoint_tool_1 = require(\"443ddb828d\") /* ./checkpoint_tool */;\n __esExport(\"CheckpointTool\", checkpoint_tool_1.CheckpointTool);\n var clear_tool_1 = require(\"2942ff039e\") /* ./clear_tool */;\n __esExport(\"ClearTool\", clear_tool_1.ClearTool);\n var poly_draw_1 = require(\"3557d74ee0\") /* ./poly_draw */;\n __esExport(\"PolyVertexDrawTool\", poly_draw_1.PolyVertexDrawTool);\n var poly_edit_1 = require(\"238deef1f5\") /* ./poly_edit */;\n __esExport(\"PolyVertexEditTool\", poly_edit_1.PolyVertexEditTool);\n var restore_tool_1 = require(\"7d18037934\") /* ./restore_tool */;\n __esExport(\"RestoreTool\", restore_tool_1.RestoreTool);\n}\n","min_source":"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)}\n//# sourceMappingURL=index.min.js.map","min_map":"{\"version\":3,\"file\":\"index.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"CheckpointTool\",\"ClearTool\",\"PolyVertexDrawTool\",\"PolyVertexEditTool\",\"RestoreTool\"],\"sources\":[\"0\"],\"mappings\":\"AAAsB,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GACnED,IAEAC,EAAW,iBADaJ,EAAQ,cACeK,gBAE/CD,EAAW,YADQJ,EAAQ,cACUM,WAErCF,EAAW,qBADOJ,EAAQ,cACmBO,oBAE7CH,EAAW,qBADOJ,EAAQ,cACmBQ,oBAE7CJ,EAAW,cADUJ,EAAQ,cACYS,YAC7C\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/checkpoint_tool.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/checkpoint_tool.js","canonical":"models/checkpoint_tool","resolution":"ESM","id":"443ddb828d","hash":"443ddb828d6e1ed3af20625263eb7d234e792b1e62156002b4ce2f4427b47b6c","source":"\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CheckpointTool = exports.CheckpointToolView = void 0;\nconst object_1 = require(\"@bokehjs/core/util/object\");\nconst array_1 = require(\"@bokehjs/core/util/array\");\nconst action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\nconst column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\nconst icons_css_1 = require(\"@bokehjs/styles/icons.css\");\nclass CheckpointToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (source.buffer == null) {\n source.buffer = [];\n }\n const data_copy = {};\n for (const [key, column] of (0, object_1.entries)(source.data)) {\n const new_column = [];\n for (const arr of column) {\n if (Array.isArray(arr) || ArrayBuffer.isView(arr)) {\n new_column.push((0, array_1.copy)(arr));\n }\n else {\n new_column.push(arr);\n }\n }\n data_copy[key] = new_column;\n }\n source.buffer.push(data_copy);\n }\n }\n}\nexports.CheckpointToolView = CheckpointToolView;\nCheckpointToolView.__name__ = \"CheckpointToolView\";\nclass CheckpointTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Checkpoint\";\n this.tool_icon = icons_css_1.tool_icon_save;\n }\n}\nexports.CheckpointTool = CheckpointTool;\n_a = CheckpointTool;\nCheckpointTool.__name__ = \"CheckpointTool\";\nCheckpointTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = CheckpointToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n})();\n//# sourceMappingURL=checkpoint_tool.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"CheckpointToolView"},{"type":"named","name":"CheckpointTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/checkpoint_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const object_1 = require(\"@bokehjs/core/util/object\");\n const array_1 = require(\"@bokehjs/core/util/array\");\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class CheckpointToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n if (source.buffer == null) {\n source.buffer = [];\n }\n const data_copy = {};\n for (const [key, column] of (0, object_1.entries)(source.data)) {\n const new_column = [];\n for (const arr of column) {\n if (Array.isArray(arr) || ArrayBuffer.isView(arr)) {\n new_column.push((0, array_1.copy)(arr));\n }\n else {\n new_column.push(arr);\n }\n }\n data_copy[key] = new_column;\n }\n source.buffer.push(data_copy);\n }\n }\n }\n exports.CheckpointToolView = CheckpointToolView;\n CheckpointToolView.__name__ = \"CheckpointToolView\";\n class CheckpointTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Checkpoint\";\n this.tool_icon = icons_css_1.tool_icon_save;\n }\n }\n exports.CheckpointTool = CheckpointTool;\n _a = CheckpointTool;\n CheckpointTool.__name__ = \"CheckpointTool\";\n CheckpointTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = CheckpointToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","min_source":"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)),[]]})))}\n//# sourceMappingURL=checkpoint_tool.min.js.map","min_map":"{\"version\":3,\"file\":\"checkpoint_tool.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"object_1\",\"array_1\",\"action_tool_1\",\"column_data_source_1\",\"icons_css_1\",\"CheckpointToolView\",\"ActionToolView\",\"doit\",\"sources\",\"this\",\"model\",\"source\",\"buffer\",\"data_copy\",\"key\",\"column\",\"entries\",\"data\",\"new_column\",\"arr\",\"Array\",\"isArray\",\"ArrayBuffer\",\"isView\",\"push\",\"copy\",\"__name__\",\"CheckpointTool\",\"ActionTool\",\"constructor\",\"attrs\",\"super\",\"tool_name\",\"tool_icon\",\"tool_icon_save\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Ref\",\"ColumnDataSource\"],\"sources\":[\"0\"],\"mappings\":\"AAAgC,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAC7E,IAAIC,EACJF,IACA,MAAMG,EAAWN,EAAQ,6BACnBO,EAAUP,EAAQ,4BAClBQ,EAAgBR,EAAQ,6CACxBS,EAAuBT,EAAQ,8CAC/BU,EAAcV,EAAQ,6BAC5B,MAAMW,UAA2BH,EAAcI,eAC3C,IAAAC,GACI,MAAMC,EAAUC,KAAKC,MAAMF,QAC3B,IAAK,MAAMG,KAAUH,EAAS,CACL,MAAjBG,EAAOC,SACPD,EAAOC,OAAS,IAEpB,MAAMC,EAAY,CAAC,EACnB,IAAK,MAAOC,EAAKC,KAAW,EAAIf,EAASgB,SAASL,EAAOM,MAAO,CAC5D,MAAMC,EAAa,GACnB,IAAK,MAAMC,KAAOJ,EACVK,MAAMC,QAAQF,IAAQG,YAAYC,OAAOJ,GACzCD,EAAWM,MAAK,EAAIvB,EAAQwB,MAAMN,IAGlCD,EAAWM,KAAKL,GAGxBN,EAAUC,GAAOI,CACrB,CACAP,EAAOC,OAAOY,KAAKX,EACvB,CACJ,EAEJjB,EAAQS,mBAAqBA,EAC7BA,EAAmBqB,SAAW,qBAC9B,MAAMC,UAAuBzB,EAAc0B,WACvC,WAAAC,CAAYC,GACRC,MAAMD,GACNrB,KAAKuB,UAAY,aACjBvB,KAAKwB,UAAY7B,EAAY8B,cACjC,EAEJtC,EAAQ+B,eAAiBA,EACzB5B,EAAK4B,EACLA,EAAeD,SAAW,iBAC1BC,EAAeQ,WAAa,+BAExBpC,EAAGqC,UAAUC,aAAehC,EAC5BN,EAAGuC,QAAO,EAAGlB,QAAOmB,UAAU,CAC1B/B,QAAS,CAACY,EAAMmB,EAAIpC,EAAqBqC,mBAAoB,OAGzE\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/clear_tool.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/clear_tool.js","canonical":"models/clear_tool","resolution":"ESM","id":"2942ff039e","hash":"2942ff039e0ac0bf23e7f79edbd59a47376c9c74f27d3e54ca0d6ef5007414b0","source":"\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClearTool = exports.ClearToolView = void 0;\nconst action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\nconst column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\nconst icons_css_1 = require(\"@bokehjs/styles/icons.css\");\nclass ClearToolView extends action_tool_1.ActionToolView {\n doit() {\n for (const source of this.model.sources) {\n source.clear();\n }\n }\n}\nexports.ClearToolView = ClearToolView;\nClearToolView.__name__ = \"ClearToolView\";\nclass ClearTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Clear data\";\n this.tool_icon = icons_css_1.tool_icon_reset;\n }\n}\nexports.ClearTool = ClearTool;\n_a = ClearTool;\nClearTool.__name__ = \"ClearTool\";\nClearTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = ClearToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n})();\n//# sourceMappingURL=clear_tool.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"ClearToolView"},{"type":"named","name":"ClearTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/clear_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class ClearToolView extends action_tool_1.ActionToolView {\n doit() {\n for (const source of this.model.sources) {\n source.clear();\n }\n }\n }\n exports.ClearToolView = ClearToolView;\n ClearToolView.__name__ = \"ClearToolView\";\n class ClearTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Clear data\";\n this.tool_icon = icons_css_1.tool_icon_reset;\n }\n }\n exports.ClearTool = ClearTool;\n _a = ClearTool;\n ClearTool.__name__ = \"ClearTool\";\n ClearTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = ClearToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","min_source":"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)),[]]})))}\n//# sourceMappingURL=clear_tool.min.js.map","min_map":"{\"version\":3,\"file\":\"clear_tool.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"action_tool_1\",\"column_data_source_1\",\"icons_css_1\",\"ClearToolView\",\"ActionToolView\",\"doit\",\"source\",\"this\",\"model\",\"sources\",\"clear\",\"__name__\",\"ClearTool\",\"ActionTool\",\"constructor\",\"attrs\",\"super\",\"tool_name\",\"tool_icon\",\"tool_icon_reset\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Array\",\"Ref\",\"ColumnDataSource\"],\"sources\":[\"0\"],\"mappings\":\"AAA2B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GACxE,IAAIC,EACJF,IACA,MAAMG,EAAgBN,EAAQ,6CACxBO,EAAuBP,EAAQ,8CAC/BQ,EAAcR,EAAQ,6BAC5B,MAAMS,UAAsBH,EAAcI,eACtC,IAAAC,GACI,IAAK,MAAMC,KAAUC,KAAKC,MAAMC,QAC5BH,EAAOI,OAEf,EAEJd,EAAQO,cAAgBA,EACxBA,EAAcQ,SAAW,gBACzB,MAAMC,UAAkBZ,EAAca,WAClC,WAAAC,CAAYC,GACRC,MAAMD,GACNR,KAAKU,UAAY,aACjBV,KAAKW,UAAYhB,EAAYiB,eACjC,EAEJvB,EAAQgB,UAAYA,EACpBb,EAAKa,EACLA,EAAUD,SAAW,YACrBC,EAAUQ,WAAa,+BAEnBrB,EAAGsB,UAAUC,aAAenB,EAC5BJ,EAAGwB,QAAO,EAAGC,QAAOC,UAAU,CAC1BhB,QAAS,CAACe,EAAMC,EAAIxB,EAAqByB,mBAAoB,OAGzE\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_draw.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/poly_draw.js","canonical":"models/poly_draw","resolution":"ESM","id":"3557d74ee0","hash":"3557d74ee0c8e8b131d7d1ed632ed2020a9026d4fb028586a1a377b6f6907dc3","source":"\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolyVertexDrawTool = exports.PolyVertexDrawToolView = void 0;\nconst vectorization_1 = require(\"@bokehjs/core/vectorization\");\nconst object_1 = require(\"@bokehjs/core/util/object\");\nconst types_1 = require(\"@bokehjs/core/util/types\");\nconst assert_1 = require(\"@bokehjs/core/util/assert\");\nconst poly_draw_tool_1 = require(\"@bokehjs/models/tools/edit/poly_draw_tool\");\nclass PolyVertexDrawToolView extends poly_draw_tool_1.PolyDrawToolView {\n _split_path(x, y) {\n for (const renderer of this.model.renderers) {\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (let index = 0; index < xpaths.length; index++) {\n let xs = xpaths[index];\n if (!(0, types_1.isArray)(xs)) {\n xs = Array.from(xs);\n cds.data[xkey][index] = xs;\n }\n let ys = ypaths[index];\n if (!(0, types_1.isArray)(ys)) {\n ys = Array.from(ys);\n cds.data[ykey][index] = ys;\n }\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y) && (i != 0) && (i != (xs.length - 1))) {\n xpaths.splice(index + 1, 0, xs.slice(i));\n ypaths.splice(index + 1, 0, ys.slice(i));\n xs.splice(i + 1);\n ys.splice(i + 1);\n for (const column of cds.columns()) {\n if ((column !== xkey) && (column != ykey)) {\n cds.data[column].splice(index + 1, 0, cds.data[column][index]);\n }\n }\n return;\n }\n }\n }\n }\n }\n _snap_to_vertex(ev, x, y) {\n const { vertex_renderer } = this.model;\n if (vertex_renderer != null) {\n // If an existing vertex is hit snap to it\n const vertex_selected = this._select_event(ev, \"replace\", [vertex_renderer]);\n const point_ds = vertex_renderer.data_source;\n // Type once dataspecs are typed\n const point_glyph = vertex_renderer.glyph;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (vertex_selected.length > 0) {\n // If existing vertex is hit split path at that location\n // converting to feature vertex\n const index = point_ds.selected.indices[0];\n if (pxkey) {\n x = point_ds.get(pxkey)[index];\n }\n if (pykey) {\n y = point_ds.get(pykey)[index];\n }\n if (ev.type != \"move\") {\n this._split_path(x, y);\n }\n point_ds.selection_manager.clear();\n }\n }\n return [x, y];\n }\n _set_vertices(xs, ys, styles) {\n const { vertex_renderer } = this.model;\n if (vertex_renderer == null) {\n return;\n }\n const point_glyph = vertex_renderer.glyph;\n const point_cds = vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs)) {\n point_cds.set(pxkey, xs);\n }\n else {\n point_glyph.x = { value: xs };\n }\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys)) {\n point_cds.set(pykey, ys);\n }\n else {\n point_glyph.y = { value: ys };\n }\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.set(key, styles[key]);\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.set(col, []);\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _show_vertices() {\n if (!this.model.active) {\n return;\n }\n const { renderers, node_style, end_style } = this.model;\n const xs = [];\n const ys = [];\n const styles = {};\n for (const key of (0, object_1.keys)(end_style)) {\n styles[key] = [];\n }\n for (let i = 0; i < renderers.length; i++) {\n const renderer = renderers[i];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n for (const array of cds.get_array(xkey)) {\n (0, assert_1.assert)((0, types_1.isArray)(array));\n xs.push(...array);\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n for (const [key, val] of (0, object_1.entries)(node_style)) {\n for (let index = 0; index < array.length - 2; index++) {\n styles[key].push(val);\n }\n }\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n }\n for (const array of cds.get_array(ykey)) {\n (0, assert_1.assert)((0, types_1.isArray)(array));\n ys.push(...array);\n }\n if (this._drawing && i == renderers.length - 1) {\n // Skip currently drawn vertex\n xs.splice(xs.length - 1, 1);\n ys.splice(ys.length - 1, 1);\n for (const [_, array] of (0, object_1.entries)(styles)) {\n array.splice(array.length - 1, 1);\n }\n }\n }\n this._set_vertices(xs, ys, styles);\n }\n _remove() {\n const renderer = this.model.renderers[0];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n if ((0, vectorization_1.isField)(glyph.xs)) {\n const xkey = glyph.xs.field;\n const array = cds.get_array(xkey);\n const xidx = array.length - 1;\n const xs = array[xidx];\n xs.splice(xs.length - 1, 1);\n if (xs.length == 1) {\n array.splice(xidx, 1);\n }\n }\n if ((0, vectorization_1.isField)(glyph.ys)) {\n const ykey = glyph.ys.field;\n const array = cds.get_array(ykey);\n const yidx = array.length - 1;\n const ys = array[yidx];\n ys.splice(ys.length - 1, 1);\n if (ys.length == 1) {\n array.splice(yidx, 1);\n }\n }\n this._emit_cds_changes(cds);\n this._drawing = false;\n this._show_vertices();\n }\n}\nexports.PolyVertexDrawToolView = PolyVertexDrawToolView;\nPolyVertexDrawToolView.__name__ = \"PolyVertexDrawToolView\";\nclass PolyVertexDrawTool extends poly_draw_tool_1.PolyDrawTool {\n constructor(attrs) {\n super(attrs);\n }\n}\nexports.PolyVertexDrawTool = PolyVertexDrawTool;\n_a = PolyVertexDrawTool;\nPolyVertexDrawTool.__name__ = \"PolyVertexDrawTool\";\nPolyVertexDrawTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = PolyVertexDrawToolView;\n _a.define(({ Dict, Unknown }) => ({\n end_style: [Dict(Unknown), {}],\n node_style: [Dict(Unknown), {}],\n }));\n})();\n//# sourceMappingURL=poly_draw.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"PolyVertexDrawToolView"},{"type":"named","name":"PolyVertexDrawTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/poly_draw.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const vectorization_1 = require(\"@bokehjs/core/vectorization\");\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const assert_1 = require(\"@bokehjs/core/util/assert\");\n const poly_draw_tool_1 = require(\"@bokehjs/models/tools/edit/poly_draw_tool\");\n class PolyVertexDrawToolView extends poly_draw_tool_1.PolyDrawToolView {\n _split_path(x, y) {\n for (const renderer of this.model.renderers) {\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (let index = 0; index < xpaths.length; index++) {\n let xs = xpaths[index];\n if (!(0, types_1.isArray)(xs)) {\n xs = Array.from(xs);\n cds.data[xkey][index] = xs;\n }\n let ys = ypaths[index];\n if (!(0, types_1.isArray)(ys)) {\n ys = Array.from(ys);\n cds.data[ykey][index] = ys;\n }\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y) && (i != 0) && (i != (xs.length - 1))) {\n xpaths.splice(index + 1, 0, xs.slice(i));\n ypaths.splice(index + 1, 0, ys.slice(i));\n xs.splice(i + 1);\n ys.splice(i + 1);\n for (const column of cds.columns()) {\n if ((column !== xkey) && (column != ykey)) {\n cds.data[column].splice(index + 1, 0, cds.data[column][index]);\n }\n }\n return;\n }\n }\n }\n }\n }\n _snap_to_vertex(ev, x, y) {\n const { vertex_renderer } = this.model;\n if (vertex_renderer != null) {\n // If an existing vertex is hit snap to it\n const vertex_selected = this._select_event(ev, \"replace\", [vertex_renderer]);\n const point_ds = vertex_renderer.data_source;\n // Type once dataspecs are typed\n const point_glyph = vertex_renderer.glyph;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (vertex_selected.length > 0) {\n // If existing vertex is hit split path at that location\n // converting to feature vertex\n const index = point_ds.selected.indices[0];\n if (pxkey) {\n x = point_ds.get(pxkey)[index];\n }\n if (pykey) {\n y = point_ds.get(pykey)[index];\n }\n if (ev.type != \"move\") {\n this._split_path(x, y);\n }\n point_ds.selection_manager.clear();\n }\n }\n return [x, y];\n }\n _set_vertices(xs, ys, styles) {\n const { vertex_renderer } = this.model;\n if (vertex_renderer == null) {\n return;\n }\n const point_glyph = vertex_renderer.glyph;\n const point_cds = vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs)) {\n point_cds.set(pxkey, xs);\n }\n else {\n point_glyph.x = { value: xs };\n }\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys)) {\n point_cds.set(pykey, ys);\n }\n else {\n point_glyph.y = { value: ys };\n }\n }\n if (styles != null) {\n for (const key of (0, object_1.keys)(styles)) {\n point_cds.set(key, styles[key]);\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.set(col, []);\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _show_vertices() {\n if (!this.model.active) {\n return;\n }\n const { renderers, node_style, end_style } = this.model;\n const xs = [];\n const ys = [];\n const styles = {};\n for (const key of (0, object_1.keys)(end_style)) {\n styles[key] = [];\n }\n for (let i = 0; i < renderers.length; i++) {\n const renderer = renderers[i];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n for (const array of cds.get_array(xkey)) {\n (0, assert_1.assert)((0, types_1.isArray)(array));\n xs.push(...array);\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n for (const [key, val] of (0, object_1.entries)(node_style)) {\n for (let index = 0; index < array.length - 2; index++) {\n styles[key].push(val);\n }\n }\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n }\n for (const array of cds.get_array(ykey)) {\n (0, assert_1.assert)((0, types_1.isArray)(array));\n ys.push(...array);\n }\n if (this._drawing && i == renderers.length - 1) {\n // Skip currently drawn vertex\n xs.splice(xs.length - 1, 1);\n ys.splice(ys.length - 1, 1);\n for (const [_, array] of (0, object_1.entries)(styles)) {\n array.splice(array.length - 1, 1);\n }\n }\n }\n this._set_vertices(xs, ys, styles);\n }\n _remove() {\n const renderer = this.model.renderers[0];\n const cds = renderer.data_source;\n const glyph = renderer.glyph;\n if ((0, vectorization_1.isField)(glyph.xs)) {\n const xkey = glyph.xs.field;\n const array = cds.get_array(xkey);\n const xidx = array.length - 1;\n const xs = array[xidx];\n xs.splice(xs.length - 1, 1);\n if (xs.length == 1) {\n array.splice(xidx, 1);\n }\n }\n if ((0, vectorization_1.isField)(glyph.ys)) {\n const ykey = glyph.ys.field;\n const array = cds.get_array(ykey);\n const yidx = array.length - 1;\n const ys = array[yidx];\n ys.splice(ys.length - 1, 1);\n if (ys.length == 1) {\n array.splice(yidx, 1);\n }\n }\n this._emit_cds_changes(cds);\n this._drawing = false;\n this._show_vertices();\n }\n }\n exports.PolyVertexDrawToolView = PolyVertexDrawToolView;\n PolyVertexDrawToolView.__name__ = \"PolyVertexDrawToolView\";\n class PolyVertexDrawTool extends poly_draw_tool_1.PolyDrawTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexDrawTool = PolyVertexDrawTool;\n _a = PolyVertexDrawTool;\n PolyVertexDrawTool.__name__ = \"PolyVertexDrawTool\";\n PolyVertexDrawTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexDrawToolView;\n _a.define(({ Dict, Unknown }) => ({\n end_style: [Dict(Unknown), {}],\n node_style: [Dict(Unknown), {}],\n }));\n })();\n}\n","min_source":"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),{}]})))}\n//# sourceMappingURL=poly_draw.min.js.map","min_map":"{\"version\":3,\"file\":\"poly_draw.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"vectorization_1\",\"object_1\",\"types_1\",\"assert_1\",\"poly_draw_tool_1\",\"PolyVertexDrawToolView\",\"PolyDrawToolView\",\"_split_path\",\"x\",\"y\",\"renderer\",\"this\",\"model\",\"renderers\",\"glyph\",\"cds\",\"data_source\",\"xkey\",\"ykey\",\"xs\",\"field\",\"ys\",\"xpaths\",\"data\",\"ypaths\",\"index\",\"length\",\"isArray\",\"Array\",\"from\",\"i\",\"splice\",\"slice\",\"column\",\"columns\",\"_snap_to_vertex\",\"ev\",\"vertex_renderer\",\"vertex_selected\",\"_select_event\",\"point_ds\",\"point_glyph\",\"pxkey\",\"pykey\",\"selected\",\"indices\",\"get\",\"type\",\"selection_manager\",\"clear\",\"_set_vertices\",\"styles\",\"point_cds\",\"set\",\"value\",\"key\",\"keys\",\"col\",\"_emit_cds_changes\",\"_show_vertices\",\"active\",\"node_style\",\"end_style\",\"array\",\"get_array\",\"assert\",\"push\",\"val\",\"entries\",\"_drawing\",\"_remove\",\"isField\",\"xidx\",\"yidx\",\"__name__\",\"PolyVertexDrawTool\",\"PolyDrawTool\",\"constructor\",\"attrs\",\"super\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Dict\",\"Unknown\"],\"sources\":[\"0\"],\"mappings\":\"AAA0B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GACvE,IAAIC,EACJF,IACA,MAAMG,EAAkBN,EAAQ,+BAC1BO,EAAWP,EAAQ,6BACnBQ,EAAUR,EAAQ,4BAClBS,EAAWT,EAAQ,6BACnBU,EAAmBV,EAAQ,6CACjC,MAAMW,UAA+BD,EAAiBE,iBAClD,WAAAC,CAAYC,EAAGC,GACX,IAAK,MAAMC,KAAYC,KAAKC,MAAMC,UAAW,CACzC,MAAMC,EAAQJ,EAASI,MACjBC,EAAML,EAASM,aACdC,EAAMC,GAAQ,CAACJ,EAAMK,GAAGC,MAAON,EAAMO,GAAGD,OACzCE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,EAAK4C,EAAMS,GACjBrD,EAAGY,OAAOZ,EAAGO,OAAS,EAAG,GACR,GAAbP,EAAGO,QACHqC,EAAMhC,OAAOyC,EAAM,EAE3B,CACA,IAAI,EAAIxE,EAAgBuE,SAASzD,EAAMO,IAAK,CACxC,MAAMH,EAAOJ,EAAMO,GAAGD,MAChB2C,EAAQhD,EAAIiD,UAAU9C,GACtBuD,EAAOV,EAAMrC,OAAS,EACtBL,EAAK0C,EAAMU,GACjBpD,EAAGU,OAAOV,EAAGK,OAAS,EAAG,GACR,GAAbL,EAAGK,QACHqC,EAAMhC,OAAO0C,EAAM,EAE3B,CACA9D,KAAK+C,kBAAkB3C,GACvBJ,KAAK0D,UAAW,EAChB1D,KAAKgD,gBACT,EAEJ/D,EAAQS,uBAAyBA,EACjCA,EAAuBqE,SAAW,yBAClC,MAAMC,UAA2BvE,EAAiBwE,aAC9C,WAAAC,CAAYC,GACRC,MAAMD,EACV,EAEJlF,EAAQ+E,mBAAqBA,EAC7B5E,EAAK4E,EACLA,EAAmBD,SAAW,qBAC9BC,EAAmBK,WAAa,+BAE5BjF,EAAGkF,UAAUC,aAAe7E,EAC5BN,EAAGoF,QAAO,EAAGC,OAAMC,cAAc,CAC7BvB,UAAW,CAACsB,EAAKC,GAAU,CAAC,GAC5BxB,WAAY,CAACuB,EAAKC,GAAU,CAAC,MAGzC\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/poly_edit.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/poly_edit.js","canonical":"models/poly_edit","resolution":"ESM","id":"238deef1f5","hash":"238deef1f5b70608e38100a2ed10a7b3f655db10593de22b5797c78e79402037","source":"\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolyVertexEditTool = exports.PolyVertexEditToolView = void 0;\nconst object_1 = require(\"@bokehjs/core/util/object\");\nconst types_1 = require(\"@bokehjs/core/util/types\");\nconst poly_edit_tool_1 = require(\"@bokehjs/models/tools/edit/poly_edit_tool\");\nclass PolyVertexEditToolView extends poly_edit_tool_1.PolyEditToolView {\n deactivate() {\n this._hide_vertices();\n if (this._selected_renderer == null) {\n return;\n }\n else if (this._drawing) {\n this._remove_vertex();\n this._drawing = false;\n }\n this._emit_cds_changes(this._selected_renderer.data_source, false, true, false);\n }\n _pan(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null) {\n return;\n }\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n if (this._selected_renderer != null) {\n this._selected_renderer.data_source.change.emit();\n }\n }\n _pan_end(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null) {\n return;\n }\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n this._emit_cds_changes(this.model.vertex_renderer.data_source, false, true, true);\n if (this._selected_renderer != null) {\n this._emit_cds_changes(this._selected_renderer.data_source);\n }\n this._basepoint = null;\n }\n _drag_points(ev, renderers) {\n if (this._basepoint == null) {\n return [];\n }\n const [bx, by] = this._basepoint;\n const points = [];\n for (const renderer of renderers) {\n const basepoint = this._map_drag(bx, by, renderer);\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null || basepoint == null) {\n continue;\n }\n const [x, y] = point;\n const [px, py] = basepoint;\n const [dx, dy] = [x - px, y - py];\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n for (const index of cds.selected.indices) {\n const point = [];\n if (xkey) {\n const xs = cds.get(xkey);\n point.push(xs[index]);\n xs[index] += dx;\n }\n if (ykey) {\n const ys = cds.get(ykey);\n point.push(ys[index]);\n ys[index] += dy;\n }\n point.push(dx);\n point.push(dy);\n points.push(point);\n }\n cds.change.emit();\n }\n this._basepoint = [ev.sx, ev.sy];\n return points;\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null) {\n return;\n }\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs)) {\n point_cds.set(pxkey, xs);\n }\n else {\n point_glyph.x = { value: xs };\n }\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys)) {\n point_cds.set(pykey, ys);\n }\n else {\n point_glyph.y = { value: ys };\n }\n }\n if (styles != null) {\n for (const [key, array] of (0, object_1.entries)(styles)) {\n point_cds.set(key, array);\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.set(col, []);\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _move_linked(points) {\n if (this._selected_renderer == null) {\n return;\n }\n const renderer = this._selected_renderer;\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (const point of points) {\n const [x, y, dx, dy] = point;\n for (let index = 0; index < xpaths.length; index++) {\n const xs = xpaths[index];\n const ys = ypaths[index];\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y)) {\n xs[i] += dx;\n ys[i] += dy;\n }\n }\n }\n }\n }\n _tap(ev) {\n if (this.model.vertex_renderer == null) {\n return;\n }\n const renderer = this.model.vertex_renderer;\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null) {\n return;\n }\n else if (this._drawing && this._selected_renderer != null) {\n let [x, y] = point;\n const cds = renderer.data_source;\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n const indices = cds.selected.indices;\n [x, y] = this._snap_to_vertex(ev, x, y);\n const index = indices[0];\n cds.selected.indices = [index + 1];\n if (xkey) {\n const xs = cds.get_array(xkey);\n const nx = xs[index];\n xs[index] = x;\n xs.splice(index + 1, 0, nx);\n }\n if (ykey) {\n const ys = cds.get_array(ykey);\n const ny = ys[index];\n ys[index] = y;\n ys.splice(index + 1, 0, ny);\n }\n cds.change.emit();\n this._emit_cds_changes(this._selected_renderer.data_source, true, false, true);\n return;\n }\n this._select_event(ev, this._select_mode(ev), [renderer]);\n }\n _show_vertices(ev) {\n if (!this.model.active) {\n return;\n }\n const renderers = this._select_event(ev, \"replace\", this.model.renderers);\n if (renderers.length === 0) {\n this._hide_vertices();\n this._selected_renderer = null;\n this._drawing = false;\n return;\n }\n const renderer = renderers[0];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const index = cds.selected.indices[0];\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n let xs;\n let ys;\n if (xkey) {\n xs = cds.get(xkey)[index];\n if (!(0, types_1.isArray)(xs)) {\n cds.get(xkey)[index] = xs = Array.from(xs);\n }\n }\n else {\n xs = glyph.xs.value;\n }\n if (ykey) {\n ys = cds.get(ykey)[index];\n if (!(0, types_1.isArray)(ys)) {\n cds.get(ykey)[index] = ys = Array.from(ys);\n }\n }\n else {\n ys = glyph.ys.value;\n }\n const { end_style, node_style } = this.model;\n const styles = {};\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key] = [val];\n }\n for (const [key, val] of (0, object_1.entries)(node_style)) {\n for (let index = 0; index < xs.length - 2; index++) {\n styles[key].push(val);\n }\n }\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n this._selected_renderer = renderer;\n this._set_vertices(xs, ys, styles);\n }\n}\nexports.PolyVertexEditToolView = PolyVertexEditToolView;\nPolyVertexEditToolView.__name__ = \"PolyVertexEditToolView\";\nclass PolyVertexEditTool extends poly_edit_tool_1.PolyEditTool {\n constructor(attrs) {\n super(attrs);\n }\n}\nexports.PolyVertexEditTool = PolyVertexEditTool;\n_a = PolyVertexEditTool;\nPolyVertexEditTool.__name__ = \"PolyVertexEditTool\";\nPolyVertexEditTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = PolyVertexEditToolView;\n _a.define(({ Dict, Unknown }) => ({\n end_style: [Dict(Unknown), {}],\n node_style: [Dict(Unknown), {}],\n }));\n})();\n//# sourceMappingURL=poly_edit.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"PolyVertexEditToolView"},{"type":"named","name":"PolyVertexEditTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/poly_edit.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const object_1 = require(\"@bokehjs/core/util/object\");\n const types_1 = require(\"@bokehjs/core/util/types\");\n const poly_edit_tool_1 = require(\"@bokehjs/models/tools/edit/poly_edit_tool\");\n class PolyVertexEditToolView extends poly_edit_tool_1.PolyEditToolView {\n deactivate() {\n this._hide_vertices();\n if (this._selected_renderer == null) {\n return;\n }\n else if (this._drawing) {\n this._remove_vertex();\n this._drawing = false;\n }\n this._emit_cds_changes(this._selected_renderer.data_source, false, true, false);\n }\n _pan(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null) {\n return;\n }\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n if (this._selected_renderer != null) {\n this._selected_renderer.data_source.change.emit();\n }\n }\n _pan_end(ev) {\n if (this._basepoint == null || this.model.vertex_renderer == null) {\n return;\n }\n const points = this._drag_points(ev, [this.model.vertex_renderer]);\n if (!ev.modifiers.shift) {\n this._move_linked(points);\n }\n this._emit_cds_changes(this.model.vertex_renderer.data_source, false, true, true);\n if (this._selected_renderer != null) {\n this._emit_cds_changes(this._selected_renderer.data_source);\n }\n this._basepoint = null;\n }\n _drag_points(ev, renderers) {\n if (this._basepoint == null) {\n return [];\n }\n const [bx, by] = this._basepoint;\n const points = [];\n for (const renderer of renderers) {\n const basepoint = this._map_drag(bx, by, renderer);\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null || basepoint == null) {\n continue;\n }\n const [x, y] = point;\n const [px, py] = basepoint;\n const [dx, dy] = [x - px, y - py];\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n for (const index of cds.selected.indices) {\n const point = [];\n if (xkey) {\n const xs = cds.get(xkey);\n point.push(xs[index]);\n xs[index] += dx;\n }\n if (ykey) {\n const ys = cds.get(ykey);\n point.push(ys[index]);\n ys[index] += dy;\n }\n point.push(dx);\n point.push(dy);\n points.push(point);\n }\n cds.change.emit();\n }\n this._basepoint = [ev.sx, ev.sy];\n return points;\n }\n _set_vertices(xs, ys, styles) {\n if (this.model.vertex_renderer == null) {\n return;\n }\n const point_glyph = this.model.vertex_renderer.glyph;\n const point_cds = this.model.vertex_renderer.data_source;\n const [pxkey, pykey] = [point_glyph.x.field, point_glyph.y.field];\n if (pxkey) {\n if ((0, types_1.isArray)(xs)) {\n point_cds.set(pxkey, xs);\n }\n else {\n point_glyph.x = { value: xs };\n }\n }\n if (pykey) {\n if ((0, types_1.isArray)(ys)) {\n point_cds.set(pykey, ys);\n }\n else {\n point_glyph.y = { value: ys };\n }\n }\n if (styles != null) {\n for (const [key, array] of (0, object_1.entries)(styles)) {\n point_cds.set(key, array);\n point_glyph[key] = { field: key };\n }\n }\n else {\n for (const col of point_cds.columns()) {\n point_cds.set(col, []);\n }\n }\n this._emit_cds_changes(point_cds, true, true, false);\n }\n _move_linked(points) {\n if (this._selected_renderer == null) {\n return;\n }\n const renderer = this._selected_renderer;\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n const xpaths = cds.data[xkey];\n const ypaths = cds.data[ykey];\n for (const point of points) {\n const [x, y, dx, dy] = point;\n for (let index = 0; index < xpaths.length; index++) {\n const xs = xpaths[index];\n const ys = ypaths[index];\n for (let i = 0; i < xs.length; i++) {\n if ((xs[i] == x) && (ys[i] == y)) {\n xs[i] += dx;\n ys[i] += dy;\n }\n }\n }\n }\n }\n _tap(ev) {\n if (this.model.vertex_renderer == null) {\n return;\n }\n const renderer = this.model.vertex_renderer;\n const point = this._map_drag(ev.sx, ev.sy, renderer);\n if (point == null) {\n return;\n }\n else if (this._drawing && this._selected_renderer != null) {\n let [x, y] = point;\n const cds = renderer.data_source;\n // Type once dataspecs are typed\n const glyph = renderer.glyph;\n const [xkey, ykey] = [glyph.x.field, glyph.y.field];\n const indices = cds.selected.indices;\n [x, y] = this._snap_to_vertex(ev, x, y);\n const index = indices[0];\n cds.selected.indices = [index + 1];\n if (xkey) {\n const xs = cds.get_array(xkey);\n const nx = xs[index];\n xs[index] = x;\n xs.splice(index + 1, 0, nx);\n }\n if (ykey) {\n const ys = cds.get_array(ykey);\n const ny = ys[index];\n ys[index] = y;\n ys.splice(index + 1, 0, ny);\n }\n cds.change.emit();\n this._emit_cds_changes(this._selected_renderer.data_source, true, false, true);\n return;\n }\n this._select_event(ev, this._select_mode(ev), [renderer]);\n }\n _show_vertices(ev) {\n if (!this.model.active) {\n return;\n }\n const renderers = this._select_event(ev, \"replace\", this.model.renderers);\n if (renderers.length === 0) {\n this._hide_vertices();\n this._selected_renderer = null;\n this._drawing = false;\n return;\n }\n const renderer = renderers[0];\n const glyph = renderer.glyph;\n const cds = renderer.data_source;\n const index = cds.selected.indices[0];\n const [xkey, ykey] = [glyph.xs.field, glyph.ys.field];\n let xs;\n let ys;\n if (xkey) {\n xs = cds.get(xkey)[index];\n if (!(0, types_1.isArray)(xs)) {\n cds.get(xkey)[index] = xs = Array.from(xs);\n }\n }\n else {\n xs = glyph.xs.value;\n }\n if (ykey) {\n ys = cds.get(ykey)[index];\n if (!(0, types_1.isArray)(ys)) {\n cds.get(ykey)[index] = ys = Array.from(ys);\n }\n }\n else {\n ys = glyph.ys.value;\n }\n const { end_style, node_style } = this.model;\n const styles = {};\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key] = [val];\n }\n for (const [key, val] of (0, object_1.entries)(node_style)) {\n for (let index = 0; index < xs.length - 2; index++) {\n styles[key].push(val);\n }\n }\n for (const [key, val] of (0, object_1.entries)(end_style)) {\n styles[key].push(val);\n }\n this._selected_renderer = renderer;\n this._set_vertices(xs, ys, styles);\n }\n }\n exports.PolyVertexEditToolView = PolyVertexEditToolView;\n PolyVertexEditToolView.__name__ = \"PolyVertexEditToolView\";\n class PolyVertexEditTool extends poly_edit_tool_1.PolyEditTool {\n constructor(attrs) {\n super(attrs);\n }\n }\n exports.PolyVertexEditTool = PolyVertexEditTool;\n _a = PolyVertexEditTool;\n PolyVertexEditTool.__name__ = \"PolyVertexEditTool\";\n PolyVertexEditTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = PolyVertexEditToolView;\n _a.define(({ Dict, Unknown }) => ({\n end_style: [Dict(Unknown), {}],\n node_style: [Dict(Unknown), {}],\n }));\n })();\n}\n","min_source":"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),{}]})))}\n//# sourceMappingURL=poly_edit.min.js.map","min_map":"{\"version\":3,\"file\":\"poly_edit.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"object_1\",\"types_1\",\"poly_edit_tool_1\",\"PolyVertexEditToolView\",\"PolyEditToolView\",\"deactivate\",\"this\",\"_hide_vertices\",\"_selected_renderer\",\"_drawing\",\"_remove_vertex\",\"_emit_cds_changes\",\"data_source\",\"_pan\",\"ev\",\"_basepoint\",\"model\",\"vertex_renderer\",\"points\",\"_drag_points\",\"modifiers\",\"shift\",\"_move_linked\",\"change\",\"emit\",\"_pan_end\",\"renderers\",\"bx\",\"by\",\"renderer\",\"basepoint\",\"_map_drag\",\"point\",\"sx\",\"sy\",\"x\",\"y\",\"px\",\"py\",\"dx\",\"dy\",\"glyph\",\"cds\",\"xkey\",\"ykey\",\"field\",\"index\",\"selected\",\"indices\",\"xs\",\"get\",\"push\",\"ys\",\"_set_vertices\",\"styles\",\"point_glyph\",\"point_cds\",\"pxkey\",\"pykey\",\"isArray\",\"set\",\"value\",\"key\",\"array\",\"entries\",\"col\",\"columns\",\"xpaths\",\"data\",\"ypaths\",\"length\",\"i\",\"_tap\",\"_snap_to_vertex\",\"get_array\",\"nx\",\"splice\",\"ny\",\"_select_event\",\"_select_mode\",\"_show_vertices\",\"active\",\"Array\",\"from\",\"end_style\",\"node_style\",\"val\",\"__name__\",\"PolyVertexEditTool\",\"PolyEditTool\",\"constructor\",\"attrs\",\"super\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Dict\",\"Unknown\"],\"sources\":[\"0\"],\"mappings\":\"AAA0B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GACvE,IAAIC,EACJF,IACA,MAAMG,EAAWN,EAAQ,6BACnBO,EAAUP,EAAQ,4BAClBQ,EAAmBR,EAAQ,6CACjC,MAAMS,UAA+BD,EAAiBE,iBAClD,UAAAC,GACIC,KAAKC,iBAC0B,MAA3BD,KAAKE,qBAGAF,KAAKG,WACVH,KAAKI,iBACLJ,KAAKG,UAAW,GAEpBH,KAAKK,kBAAkBL,KAAKE,mBAAmBI,aAAa,GAAO,GAAM,GAC7E,CACA,IAAAC,CAAKC,GACD,GAAuB,MAAnBR,KAAKS,YAAoD,MAA9BT,KAAKU,MAAMC,gBACtC,OAEJ,MAAMC,EAASZ,KAAKa,aAAaL,EAAI,CAACR,KAAKU,MAAMC,kBAC5CH,EAAGM,UAAUC,OACdf,KAAKgB,aAAaJ,GAES,MAA3BZ,KAAKE,oBACLF,KAAKE,mBAAmBI,YAAYW,OAAOC,MAEnD,CACA,QAAAC,CAASX,GACL,GAAuB,MAAnBR,KAAKS,YAAoD,MAA9BT,KAAKU,MAAMC,gBACtC,OAEJ,MAAMC,EAASZ,KAAKa,aAAaL,EAAI,CAACR,KAAKU,MAAMC,kBAC5CH,EAAGM,UAAUC,OACdf,KAAKgB,aAAaJ,GAEtBZ,KAAKK,kBAAkBL,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5BJ,EAAGiG,QAAO,EAAGC,OAAMC,cAAc,CAC7Bd,UAAW,CAACa,EAAKC,GAAU,CAAC,GAC5Bb,WAAY,CAACY,EAAKC,GAAU,CAAC,MAGzC\"}"}},{"module":{"file":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib/models/restore_tool.js","base":"/home/runner/work/geoviews/geoviews/geoviews/dist/lib","base_path":"models/restore_tool.js","canonical":"models/restore_tool","resolution":"ESM","id":"7d18037934","hash":"7d18037934ec920b3babbf347dffd7136e180c40977c2c5b7c423219e832ee8b","source":"\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RestoreTool = exports.RestoreToolView = void 0;\nconst action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\nconst column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\nconst icons_css_1 = require(\"@bokehjs/styles/icons.css\");\nclass RestoreToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n const new_data = source.buffer?.pop();\n if (new_data == null) {\n continue;\n }\n source.data = new_data;\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n}\nexports.RestoreToolView = RestoreToolView;\nRestoreToolView.__name__ = \"RestoreToolView\";\nclass RestoreTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Restore\";\n this.tool_icon = icons_css_1.tool_icon_undo;\n }\n}\nexports.RestoreTool = RestoreTool;\n_a = RestoreTool;\nRestoreTool.__name__ = \"RestoreTool\";\nRestoreTool.__module__ = \"geoviews.models.custom_tools\";\n(() => {\n _a.prototype.default_view = RestoreToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n})();\n//# sourceMappingURL=restore_tool.js.map\n","type":"js","dependency_paths":[],"dependency_map":[],"exported":[{"type":"named","name":"RestoreToolView"},{"type":"named","name":"RestoreTool"}],"externals":[],"shims":[]},"code":{"source":"/* models/restore_tool.js */ function _(require, module, exports, __esModule, __esExport) {\n var _a;\n __esModule();\n const action_tool_1 = require(\"@bokehjs/models/tools/actions/action_tool\");\n const column_data_source_1 = require(\"@bokehjs/models/sources/column_data_source\");\n const icons_css_1 = require(\"@bokehjs/styles/icons.css\");\n class RestoreToolView extends action_tool_1.ActionToolView {\n doit() {\n const sources = this.model.sources;\n for (const source of sources) {\n const new_data = source.buffer?.pop();\n if (new_data == null) {\n continue;\n }\n source.data = new_data;\n source.change.emit();\n source.properties.data.change.emit();\n }\n }\n }\n exports.RestoreToolView = RestoreToolView;\n RestoreToolView.__name__ = \"RestoreToolView\";\n class RestoreTool extends action_tool_1.ActionTool {\n constructor(attrs) {\n super(attrs);\n this.tool_name = \"Restore\";\n this.tool_icon = icons_css_1.tool_icon_undo;\n }\n }\n exports.RestoreTool = RestoreTool;\n _a = RestoreTool;\n RestoreTool.__name__ = \"RestoreTool\";\n RestoreTool.__module__ = \"geoviews.models.custom_tools\";\n (() => {\n _a.prototype.default_view = RestoreToolView;\n _a.define(({ Array, Ref }) => ({\n sources: [Array(Ref(column_data_source_1.ColumnDataSource)), []],\n }));\n })();\n}\n","min_source":"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)),[]]})))}\n//# sourceMappingURL=restore_tool.min.js.map","min_map":"{\"version\":3,\"file\":\"restore_tool.min.js\",\"names\":[\"_\",\"require\",\"module\",\"exports\",\"__esModule\",\"__esExport\",\"_a\",\"action_tool_1\",\"column_data_source_1\",\"icons_css_1\",\"RestoreToolView\",\"ActionToolView\",\"doit\",\"sources\",\"this\",\"model\",\"source\",\"new_data\",\"buffer\",\"pop\",\"data\",\"change\",\"emit\",\"properties\",\"__name__\",\"RestoreTool\",\"ActionTool\",\"constructor\",\"attrs\",\"super\",\"tool_name\",\"tool_icon\",\"tool_icon_undo\",\"__module__\",\"prototype\",\"default_view\",\"define\",\"Array\",\"Ref\",\"ColumnDataSource\"],\"sources\":[\"0\"],\"mappings\":\"AAA6B,SAASA,EAAEC,EAASC,EAAQC,EAASC,EAAYC,GAC1E,IAAIC,EACJF,IACA,MAAMG,EAAgBN,EAAQ,6CACxBO,EAAuBP,EAAQ,8CAC/BQ,EAAcR,EAAQ,6BAC5B,MAAMS,UAAwBH,EAAcI,eACxC,IAAAC,GACI,MAAMC,EAAUC,KAAKC,MAAMF,QAC3B,IAAK,MAAMG,KAAUH,EAAS,CAC1B,MAAMI,EAAWD,EAAOE,QAAQC,MAChB,MAAZF,IAGJD,EAAOI,KAAOH,EACdD,EAAOK,OAAOC,OACdN,EAAOO,WAAWH,KAAKC,OAAOC,OAClC,CACJ,EAEJnB,EAAQO,gBAAkBA,EAC1BA,EAAgBc,SAAW,kBAC3B,MAAMC,UAAoBlB,EAAcmB,WACpC,WAAAC,CAAYC,GACRC,MAAMD,GACNd,KAAKgB,UAAY,UACjBhB,KAAKiB,UAAYtB,EAAYuB,cACjC,EAEJ7B,EAAQsB,YAAcA,EACtBnB,EAAKmB,EACLA,EAAYD,SAAW,cACvBC,EAAYQ,WAAa,+BAErB3B,EAAG4B,UAAUC,aAAezB,EAC5BJ,EAAG8B,QAAO,EAAGC,QAAOC,UAAU,CAC1BzB,QAAS,CAACwB,EAAMC,EAAI9B,EAAqB+B,mBAAoB,OAGzE\"}"}}]}
|