Skip to content

Commit

Permalink
[js] highlighted links (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier authored Oct 16, 2019
1 parent e9a6693 commit f4f7aa0
Show file tree
Hide file tree
Showing 3 changed files with 21,029 additions and 20,993 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog

Forthcoming
-----------
* ...
* [qt] capture screenshots, `#114 <https://github.com/splintered-reality/py_trees_js/pull/114>`_
* [js] highlighted links, `#115 <https://github.com/splintered-reality/py_trees_js/pull/115>`_

0.5.0 (2019-08-29)
------------------
Expand Down
25 changes: 25 additions & 0 deletions js/py_trees-0.5.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,31 @@ var py_trees = (function() {
var _canvas_create_link = function({source, target}) {
console.log("_canvas_create_link")
var link = new joint.shapes.standard.Link();
console.log(target)
console.log("Status: ", target.get("status"))
if (target.get("visited")) {
switch(target.get("status")) {
case "SUCCESS":
stroke = 'green'
break;
case "RUNNING":
stroke = 'blue'
break;
case "FAILURE":
stroke = 'red'
break;
case "INVALID":
stroke = 'white'
break;
default:
stroke = 'gray'
}
link.attr({
line: { // selector for the visible <path> SVGElement
stroke: stroke // SVG attribute and value
}
});
}
link.source(source)
link.target(target)
link.connector('smooth')
Expand Down
Loading

0 comments on commit f4f7aa0

Please sign in to comment.