| author | ymh <ymh.work@gmail.com> |
| Thu, 04 Jun 2015 13:44:55 +0200 | |
| changeset 462 | 255b66d1ce78 |
| parent 461 | 48235ed6b07d |
| child 532 | 030f2e4c0664 |
| permissions | -rw-r--r-- |
| 284 | 1 |
|
2 |
define(['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) { |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
3 |
'use strict'; |
|
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
4 |
|
| 284 | 5 |
var Utils = requtils.getUtils(); |
6 |
||
7 |
/* Edge Class Begin */ |
|
8 |
||
9 |
//var Edge = Renderer.Edge = Utils.inherit(Renderer._BaseRepresentation); |
|
10 |
var Edge = Utils.inherit(BaseRepresentation); |
|
11 |
||
12 |
_(Edge.prototype).extend({ |
|
13 |
_init: function() { |
|
14 |
this.renderer.edge_layer.activate(); |
|
15 |
this.type = "Edge"; |
|
| 450 | 16 |
this.hidden = false; |
17 |
this.ghost = false; |
|
| 284 | 18 |
this.from_representation = this.renderer.getRepresentationByModel(this.model.get("from")); |
19 |
this.to_representation = this.renderer.getRepresentationByModel(this.model.get("to")); |
|
20 |
this.bundle = this.renderer.addToBundles(this); |
|
21 |
this.line = new paper.Path(); |
|
22 |
this.line.add([0,0],[0,0],[0,0]); |
|
23 |
this.line.__representation = this; |
|
24 |
this.line.strokeWidth = this.options.edge_stroke_width; |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
25 |
this.arrow_scale = 1; |
| 284 | 26 |
this.arrow = new paper.Path(); |
27 |
this.arrow.add( |
|
28 |
[ 0, 0 ], |
|
29 |
[ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ], |
|
30 |
[ 0, this.options.edge_arrow_width ] |
|
31 |
); |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
32 |
this.arrow.pivot = new paper.Point([ this.options.edge_arrow_length / 2, this.options.edge_arrow_width / 2 ]); |
| 284 | 33 |
this.arrow.__representation = this; |
34 |
this.text = $('<div class="Rk-Label Rk-Edge-Label">').appendTo(this.renderer.labels_$); |
|
35 |
this.arrow_angle = 0; |
|
36 |
if (this.options.editor_mode) { |
|
37 |
var Renderer = requtils.getRenderer(); |
|
38 |
this.normal_buttons = [ |
|
39 |
new Renderer.EdgeEditButton(this.renderer, null), |
|
40 |
new Renderer.EdgeRemoveButton(this.renderer, null) |
|
41 |
]; |
|
42 |
this.pending_delete_buttons = [ |
|
43 |
new Renderer.EdgeRevertButton(this.renderer, null) |
|
44 |
]; |
|
45 |
this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons); |
|
46 |
for (var i = 0; i < this.all_buttons.length; i++) { |
|
47 |
this.all_buttons[i].source_representation = this; |
|
48 |
} |
|
49 |
this.active_buttons = []; |
|
50 |
} else { |
|
51 |
this.active_buttons = this.all_buttons = []; |
|
52 |
} |
|
53 |
||
54 |
if (this.renderer.minimap) { |
|
55 |
this.renderer.minimap.edge_layer.activate(); |
|
56 |
this.minimap_line = new paper.Path(); |
|
57 |
this.minimap_line.add([0,0],[0,0]); |
|
58 |
this.minimap_line.__representation = this.renderer.minimap.miniframe.__representation; |
|
59 |
this.minimap_line.strokeWidth = 1; |
|
60 |
} |
|
61 |
}, |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
62 |
_getStrokeWidth: function() { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
63 |
var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
64 |
return this.options.edge_stroke_width + (thickness-1) * (this.options.edge_stroke_max_width - this.options.edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
65 |
}, |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
66 |
_getSelectedStrokeWidth: function() { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
67 |
var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
68 |
return this.options.selected_edge_stroke_width + (thickness-1) * (this.options.selected_edge_stroke_max_width - this.options.selected_edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
69 |
}, |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
70 |
_getArrowScale: function() { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
71 |
var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
72 |
return 1 + (thickness-1) * ((this.options.edge_arrow_max_width / this.options.edge_arrow_width) - 1) / (this.options.edge_stroke_witdh_scale-1); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
73 |
}, |
| 284 | 74 |
redraw: function() { |
75 |
var from = this.model.get("from"), |
|
76 |
to = this.model.get("to"); |
|
| 450 | 77 |
if (!from || !to || (this.hidden && !this.ghost)) { |
| 284 | 78 |
return; |
79 |
} |
|
80 |
this.from_representation = this.renderer.getRepresentationByModel(from); |
|
81 |
this.to_representation = this.renderer.getRepresentationByModel(to); |
|
| 450 | 82 |
if (typeof this.from_representation === "undefined" || typeof this.to_representation === "undefined" || |
| 453 | 83 |
(this.from_representation.hidden && !this.from_representation.ghost) || |
|
461
48235ed6b07d
Merge with a3bf10beb710d1cfdda455ab98705f9e7a631739
ymh <ymh.work@gmail.com>
diff
changeset
|
84 |
(this.to_representation.hidden && !this.to_representation.ghost)) { |
| 453 | 85 |
this.hide(); |
| 284 | 86 |
return; |
87 |
} |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
88 |
var _strokeWidth = this._getStrokeWidth(), |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
89 |
_arrow_scale = this._getArrowScale(), |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
90 |
_p0a = this.from_representation.paper_coords, |
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
91 |
_p1a = this.to_representation.paper_coords, |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
92 |
_v = _p1a.subtract(_p0a), |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
93 |
_r = _v.length, |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
94 |
_u = _v.divide(_r), |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
95 |
_ortho = new paper.Point([- _u.y, _u.x]), |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
96 |
_group_pos = this.bundle.getPosition(this), |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
97 |
_delta = _ortho.multiply( this.options.edge_gap_in_bundles * _group_pos ), |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
98 |
_p0b = _p0a.add(_delta), /* Adding a 4 px difference */ |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
99 |
_p1b = _p1a.add(_delta), /* to differentiate bundled links */ |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
100 |
_a = _v.angle, |
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
101 |
_textdelta = _ortho.multiply(this.options.edge_label_distance + 0.5 * _arrow_scale * this.options.edge_arrow_width), |
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
102 |
_handle = _v.divide(3), |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
103 |
_color = (this.model.has("style") && this.model.get("style").color) || (this.model.get("created_by") || Utils._USER_PLACEHOLDER(this.renkan)).get("color"), |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
104 |
_dash = (this.model.has("style") && this.model.get("style").dash) ? this.options.default_dash_array : null, |
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
105 |
_opacity; |
| 284 | 106 |
|
107 |
if (this.model.get("delete_scheduled") || this.from_representation.model.get("delete_scheduled") || this.to_representation.model.get("delete_scheduled")) { |
|
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
108 |
_opacity = 0.5; |
| 284 | 109 |
this.line.dashArray = [2, 2]; |
110 |
} else { |
|
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
111 |
_opacity = this.ghost ? this.options.ghost_opacity : 1; |
| 284 | 112 |
this.line.dashArray = null; |
113 |
} |
|
114 |
||
115 |
var old_act_btn = this.active_buttons; |
|
116 |
||
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
117 |
this.arrow.visible = |
|
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
118 |
(this.model.has("style") && this.model.get("style").arrow) || |
|
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
119 |
!this.model.has("style") || |
|
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
120 |
typeof this.model.get("style").arrow === 'undefined'; |
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
121 |
|
| 284 | 122 |
this.active_buttons = this.model.get("delete_scheduled") ? this.pending_delete_buttons : this.normal_buttons; |
123 |
||
124 |
if (this.selected && this.renderer.isEditable() && old_act_btn !== this.active_buttons) { |
|
125 |
old_act_btn.forEach(function(b) { |
|
126 |
b.hide(); |
|
127 |
}); |
|
128 |
this.active_buttons.forEach(function(b) { |
|
129 |
b.show(); |
|
130 |
}); |
|
131 |
} |
|
132 |
||
133 |
this.paper_coords = _p0b.add(_p1b).divide(2); |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
134 |
this.line.strokeWidth = _strokeWidth; |
| 284 | 135 |
this.line.strokeColor = _color; |
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
136 |
this.line.dashArray = _dash; |
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
137 |
this.line.opacity = _opacity; |
| 284 | 138 |
this.line.segments[0].point = _p0a; |
139 |
this.line.segments[1].point = this.paper_coords; |
|
140 |
this.line.segments[1].handleIn = _handle.multiply(-1); |
|
141 |
this.line.segments[1].handleOut = _handle; |
|
142 |
this.line.segments[2].point = _p1a; |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
143 |
this.arrow.scale(_arrow_scale / this.arrow_scale); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
144 |
this.arrow_scale = _arrow_scale; |
| 284 | 145 |
this.arrow.fillColor = _color; |
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
146 |
this.arrow.opacity = _opacity; |
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
147 |
this.arrow.rotate(_a - this.arrow_angle, this.arrow.bounds.center); |
| 284 | 148 |
this.arrow.position = this.paper_coords; |
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
149 |
|
| 284 | 150 |
this.arrow_angle = _a; |
151 |
if (_a > 90) { |
|
152 |
_a -= 180; |
|
153 |
_textdelta = _textdelta.multiply(-1); |
|
154 |
} |
|
155 |
if (_a < -90) { |
|
156 |
_a += 180; |
|
157 |
_textdelta = _textdelta.multiply(-1); |
|
158 |
} |
|
159 |
var _text = this.model.get("title") || this.renkan.translate(this.options.label_untitled_edges) || ""; |
|
160 |
_text = Utils.shortenText(_text, this.options.node_label_max_length); |
|
161 |
this.text.text(_text); |
|
162 |
var _textpos = this.paper_coords.add(_textdelta); |
|
163 |
this.text.css({ |
|
164 |
left: _textpos.x, |
|
165 |
top: _textpos.y, |
|
166 |
transform: "rotate(" + _a + "deg)", |
|
167 |
"-moz-transform": "rotate(" + _a + "deg)", |
|
168 |
"-webkit-transform": "rotate(" + _a + "deg)", |
|
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
169 |
opacity: _opacity |
| 284 | 170 |
}); |
171 |
this.text_angle = _a; |
|
172 |
||
173 |
var _pc = this.paper_coords; |
|
174 |
this.all_buttons.forEach(function(b) { |
|
175 |
b.moveTo(_pc); |
|
176 |
}); |
|
177 |
||
178 |
if (this.renderer.minimap) { |
|
179 |
this.minimap_line.strokeColor = _color; |
|
180 |
this.minimap_line.segments[0].point = this.renderer.toMinimapCoords(new paper.Point(this.from_representation.model.get("position"))); |
|
181 |
this.minimap_line.segments[1].point = this.renderer.toMinimapCoords(new paper.Point(this.to_representation.model.get("position"))); |
|
182 |
} |
|
183 |
}, |
|
| 450 | 184 |
hide: function(){ |
185 |
this.hidden = true; |
|
186 |
this.ghost = false; |
|
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
187 |
|
| 450 | 188 |
this.text.hide(); |
189 |
this.line.visible = false; |
|
190 |
this.arrow.visible = false; |
|
191 |
this.minimap_line.visible = false; |
|
192 |
}, |
|
193 |
show: function(ghost){ |
|
194 |
this.ghost = ghost; |
|
|
461
48235ed6b07d
Merge with a3bf10beb710d1cfdda455ab98705f9e7a631739
ymh <ymh.work@gmail.com>
diff
changeset
|
195 |
if (this.ghost) { |
| 450 | 196 |
this.text.css('opacity', 0.3); |
197 |
this.line.opacity = 0.3; |
|
198 |
this.arrow.opacity = 0.3; |
|
199 |
this.minimap_line.opacity = 0.3; |
|
|
461
48235ed6b07d
Merge with a3bf10beb710d1cfdda455ab98705f9e7a631739
ymh <ymh.work@gmail.com>
diff
changeset
|
200 |
} else { |
| 450 | 201 |
this.hidden = false; |
|
462
255b66d1ce78
remove magical constant, put ghost opacity in the defaults.
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
202 |
|
| 450 | 203 |
this.text.css('opacity', 1); |
204 |
this.line.opacity = 1; |
|
205 |
this.arrow.opacity = 1; |
|
206 |
this.minimap_line.opacity = 1; |
|
207 |
} |
|
208 |
this.text.show(); |
|
209 |
this.line.visible = true; |
|
210 |
this.arrow.visible = true; |
|
211 |
this.minimap_line.visible = true; |
|
212 |
this.redraw(); |
|
213 |
}, |
|
| 284 | 214 |
openEditor: function() { |
215 |
this.renderer.removeRepresentationsOfType("editor"); |
|
216 |
var _editor = this.renderer.addRepresentation("EdgeEditor",null); |
|
217 |
_editor.source_representation = this; |
|
218 |
_editor.draw(); |
|
219 |
}, |
|
220 |
select: function() { |
|
221 |
this.selected = true; |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
222 |
this.line.strokeWidth = this._getSelectedStrokeWidth(); |
| 284 | 223 |
if (this.renderer.isEditable()) { |
224 |
this.active_buttons.forEach(function(b) { |
|
225 |
b.show(); |
|
226 |
}); |
|
227 |
} |
|
228 |
if (!this.options.editor_mode) { |
|
229 |
this.openEditor(); |
|
230 |
} |
|
231 |
this._super("select"); |
|
232 |
}, |
|
233 |
unselect: function(_newTarget) { |
|
234 |
if (!_newTarget || _newTarget.source_representation !== this) { |
|
235 |
this.selected = false; |
|
236 |
if (this.options.editor_mode) { |
|
237 |
this.all_buttons.forEach(function(b) { |
|
238 |
b.hide(); |
|
239 |
}); |
|
240 |
} |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
241 |
this.line.strokeWidth = this._getStrokeWidth(); |
| 284 | 242 |
this._super("unselect"); |
243 |
} |
|
244 |
}, |
|
245 |
mousedown: function(_event, _isTouch) { |
|
246 |
if (_isTouch) { |
|
247 |
this.renderer.unselectAll(); |
|
248 |
this.select(); |
|
249 |
} |
|
250 |
}, |
|
251 |
mouseup: function(_event, _isTouch) { |
|
252 |
if (!this.renkan.read_only && this.renderer.is_dragging) { |
|
253 |
this.from_representation.saveCoords(); |
|
254 |
this.to_representation.saveCoords(); |
|
255 |
this.from_representation.is_dragging = false; |
|
256 |
this.to_representation.is_dragging = false; |
|
257 |
} else { |
|
258 |
if (!_isTouch) { |
|
259 |
this.openEditor(); |
|
260 |
} |
|
261 |
this.model.trigger("clicked"); |
|
262 |
} |
|
263 |
this.renderer.click_target = null; |
|
264 |
this.renderer.is_dragging = false; |
|
265 |
}, |
|
266 |
paperShift: function(_delta) { |
|
267 |
if (this.options.editor_mode) { |
|
268 |
if (!this.options.read_only) { |
|
269 |
this.from_representation.paperShift(_delta); |
|
270 |
this.to_representation.paperShift(_delta); |
|
271 |
} |
|
272 |
} else { |
|
273 |
this.renderer.paperShift(_delta); |
|
274 |
} |
|
275 |
}, |
|
276 |
destroy: function() { |
|
277 |
this._super("destroy"); |
|
278 |
this.line.remove(); |
|
279 |
this.arrow.remove(); |
|
280 |
this.text.remove(); |
|
281 |
if (this.renderer.minimap) { |
|
282 |
this.minimap_line.remove(); |
|
283 |
} |
|
284 |
this.all_buttons.forEach(function(b) { |
|
285 |
b.destroy(); |
|
286 |
}); |
|
287 |
var _this = this; |
|
| 433 | 288 |
this.bundle.edges = _.reject(this.bundle.edges, function(_edge) { |
| 284 | 289 |
return _this === _edge; |
290 |
}); |
|
291 |
} |
|
| 433 | 292 |
}).value(); |
| 284 | 293 |
|
294 |
return Edge; |
|
295 |
||
296 |
}); |