Skip to content

Commit 38c7163

Browse files
committed
Addition of drag to labels and update of Flask
1 parent f4f1a70 commit 38c7163

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

functree/static/src/js/functree.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ const FuncTree = class {
395395
const selectedLabel = d3.select('#label-' + nodeId)
396396
if (selectedLabel.empty()) {
397397
const selectedNode = d3.select('#' + nodeId)
398-
d3.select("#labels")
398+
const text = d3.select("#labels")
399399
.append('g')
400400
.attr('id', 'label-' + nodeId)
401401
.attr('transform', selectedNode .attr("transform"))
@@ -405,6 +405,18 @@ const FuncTree = class {
405405
.attr('font-size', 4)
406406
.attr('fill', '#555')
407407
.text(selectedNode.attr("data-original-title").replace(/\[.*\] /, ''))
408+
// add drag behavior
409+
text.call(d3.behavior.drag()
410+
.on('dragstart', () => {
411+
d3.event.sourceEvent.stopPropagation();
412+
})
413+
.on('drag', function(d) {
414+
d3.select(this)
415+
.attr('y', 0)
416+
.attr('transform', 'translate(' + d3.event.x + ',' + d3.event.y + ')');
417+
})
418+
);
419+
408420
} else {
409421
selectedLabel.remove()
410422
}

functree/templates/about.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ <h3>Publications</h3>
2525
<hr />
2626
<h3>Change log</h3>
2727
<br />
28-
<h5>Version 0.7.6.2 (dev)</h5>
28+
<h5>Version 0.7.6.2 (2019-02-15)</h5>
2929
<ul>
3030
<li>Addition of a toggle action to show/hide node labels
3131
<li>Addition of a description to the database selection
32+
<li>Upgrade of Flask
3233
</ul>
3334
<h5>Version 0.7.6.1 (2019-01-18)</h5>
3435
<ul>

functree/templates/mapping.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h2>Mapping</h2>
6464
<div class="form-group{% if form.distribute.errors %} has-error{% endif %}">
6565
<div class="col-sm-offset-2 col-sm-10">
6666
<div class="checkbox">
67-
<label> {{ form.distribute }} <b>[dev-feature]</b> {{ form.distribute.label.text }}
67+
<label> {{ form.distribute }} <span class="label label-info">beta feature</span> {{ form.distribute.label.text }}
6868
</label>
6969
</div>
7070
{% if form.distribute.errors %}

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CairoSVG==2.0.3
44
cffi==1.10.0
55
click==6.7
66
cssselect==1.0.1
7-
Flask==0.12.2
7+
Flask==0.12.4
88
Flask-Caching==1.3.3
99
Flask-DebugToolbar==0.10.1
1010
Flask-HTTPAuth==3.2.3

0 commit comments

Comments
 (0)