Maintenance - Mise à jour mensuelle Lundi 6 Avril 2020 entre 7h00 et 9h00

Commit 23a6a8fe authored by Penom Nom's avatar Penom Nom

update grap

parent b4597456
......@@ -412,11 +412,11 @@ class JFlowServer (object):
nodes = []
for node in g.nodes():
if Workflow.INPUT_GRAPH_LABEL in g.node_attributes(node):
nodes.append({"name": node, "type": "input"})
nodes.append({"name": node, "display_name": g.node_attributes(node)[1], "type": "input"})
elif Workflow.INPUTS_GRAPH_LABEL in g.node_attributes(node):
nodes.append({"name": node, "type": "inputs"})
nodes.append({"name": node, "display_name": g.node_attributes(node)[1], "type": "inputs"})
elif Workflow.COMPONENT_GRAPH_LABEL in g.node_attributes(node):
nodes.append({"name": node, "type": "component"})
nodes.append({"name": node, "display_name": g.node_attributes(node)[1], "type": "component"})
status["nodes"] = nodes
status["edges"] = g.edges()
return status
......
......@@ -153,11 +153,11 @@ if __name__ == '__main__':
inputs, components = [], []
for node in gr.nodes():
if Workflow.INPUT_GRAPH_LABEL in gr.node_attributes(node):
inputs.append(node)
inputs.append(gr.node_attributes(node)[1])
elif Workflow.INPUTS_GRAPH_LABEL in gr.node_attributes(node):
inputs.append(node)
inputs.append(gr.node_attributes(node)[1])
elif Workflow.COMPONENT_GRAPH_LABEL in gr.node_attributes(node):
components.append(node)
components.append(gr.node_attributes(node)[1])
print "inputs: ", inputs
print "components: ", components
print "edges: ", gr.edges()
......
......@@ -346,14 +346,17 @@ class Workflow(threading.Thread):
if issubclass(ioparameter.__class__, InputFile):
gr.add_node(ioparameter.name)
gr.add_node_attribute(ioparameter.name, self.INPUT_GRAPH_LABEL)
gr.add_node_attribute(ioparameter.name, ioparameter.display_name)
all_nodes[ioparameter.name] = None
elif issubclass(ioparameter.__class__, InputFileList):
gr.add_node(ioparameter.name)
gr.add_node_attribute(ioparameter.name, self.INPUTS_GRAPH_LABEL)
gr.add_node_attribute(ioparameter.name, ioparameter.display_name)
all_nodes[ioparameter.name] = None
for cpt in self.components:
gr.add_node(cpt.get_nameid())
gr.add_node_attribute(cpt.get_nameid(), self.COMPONENT_GRAPH_LABEL)
gr.add_node_attribute(cpt.get_nameid(), cpt.get_nameid())
all_nodes[cpt.get_nameid()] = None
for cpt in self.components:
for ioparameter in cpt.__dict__.values():
......
......@@ -13568,29 +13568,226 @@ var cytoscape;
var tmpLineWidth = context.lineWidth;
context.beginPath();
context.lineWidth = 2;
context.lineCap = 'round';
context.strokeStyle = 'white';
context.moveTo(-10, 0);
context.lineTo( 10, 0);
context.moveTo( 10, 0);
context.lineTo( 7,-3);
context.moveTo( 10, 0);
context.lineTo( 7, 3);
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
context.shadowBlur = 8;
context.shadowColor = "#353535";
context.arc( 0, 0, 30, 0, 2 * Math.PI, false);
context.stroke();
context.beginPath();
context.shadowOffsetX = 2;
context.shadowOffsetY = 3;
context.moveTo( 8, 10);
context.lineTo( -8, 10);
context.moveTo( -8, 10);
context.lineTo( -8,-10);
context.moveTo( -8,-10);
context.lineTo( 4,-10);
context.moveTo( 8, 10);
context.lineTo( 8, -6);
context.moveTo( 8, -6);
context.lineTo( 4,-10);
context.moveTo( 8, -6);
context.lineTo( 4, -6);
context.moveTo( 4,-10);
context.lineTo( 4, -6);
context.stroke();
context.closePath();
context.lineWidth = 0.75;
context.beginPath();
context.moveTo( -5,-5.7);
context.lineTo( 1,-5.7);
context.moveTo( -5,-2.7);
context.lineTo( 5,-2.7);
context.moveTo( -5, 0.3);
context.lineTo( 5, 0.3);
context.moveTo( -5, 3.3);
context.lineTo( 5, 3.3);
context.moveTo( -5, 6.3);
context.lineTo( 5, 6.3);
context.stroke();
context.closePath();
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
context.shadowBlur = 0;
}
else if(node._private.data.type == 'inputs') {
var tmpLineWidth = context.lineWidth;
context.beginPath();
context.lineWidth = 2;
context.lineCap = 'round';
context.strokeStyle = 'white';
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
context.shadowBlur = 8;
context.shadowColor = "#353535";
context.arc( 0, 0, 30, 0, 2 * Math.PI, false);
context.stroke();
context.beginPath();
context.shadowOffsetX = 2;
context.shadowOffsetY = 3;
context.moveTo( -6, 6);
context.lineTo(-11, 6);
context.moveTo(-11, 6);
context.lineTo(-11,-14);
context.moveTo(-11,-14);
context.lineTo( 1,-14);
context.moveTo( 5, -7);
context.lineTo( 5,-10);
context.moveTo( 5,-10);
context.lineTo( 1,-14);
context.moveTo( 5,-10);
context.lineTo( 1,-10);
context.moveTo( 1,-14);
context.lineTo( 1,-10);
context.stroke();
context.closePath();
context.lineWidth = 0.75;
context.beginPath();
context.moveTo( -8,-9.7);
context.lineTo( -2,-9.7);
context.moveTo( -8,-6.7);
context.lineTo( -5,-6.7);
context.moveTo( -8,-3.7);
context.lineTo( -6,-3.7);
context.moveTo( -8,-0.7);
context.lineTo( -6,-0.7);
context.moveTo( -8, 2.3);
context.lineTo( -6, 2.3);
context.stroke();
context.closePath();
//
context.lineWidth = 2;
context.beginPath();
context.moveTo( 11, 14);
context.lineTo( -5, 14);
context.moveTo( -5, 14);
context.lineTo( -5, -6);
context.moveTo( -5, -6);
context.lineTo( 7, -6);
context.moveTo( 11, 14);
context.lineTo( 11, -2);
context.moveTo( 11, -2);
context.lineTo( 7, -6);
context.moveTo( 11, -2);
context.lineTo( 7, -2);
context.moveTo( 7, -6);
context.lineTo( 7, -2);
context.stroke();
context.closePath();
context.lineWidth = 0.75;
context.beginPath();
context.moveTo( -2,-1.7);
context.lineTo( 4,-1.7);
context.moveTo( -2, 1.3);
context.lineTo( 8, 1.3);
context.moveTo( -2, 4.3);
context.lineTo( 8, 4.3);
context.moveTo( -2, 7.3);
context.lineTo( 8, 7.3);
context.moveTo( -2,10.3);
context.lineTo( 8,10.3);
context.stroke();
context.closePath();
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
context.shadowBlur = 0;
}
else if(node._private.data.type == 'component') {
var tmpLineWidth = context.lineWidth,
tmpStrokeStyle = context.strokeStyle;
context.beginPath();
context.lineWidth = 2.5;
context.lineCap = 'square';
context.strokeStyle = 'white';
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
context.shadowBlur = 8;
context.shadowColor = "black";
context.shadowColor = "#353535";
context.arc( 0, 0, 39, 0, 2 * Math.PI, false);
context.stroke();
context.beginPath();
context.shadowOffsetX = 2;
context.shadowOffsetY = 3;
//DNA
/*for(var y = -13; y < 17; y++) {
var x = 5 * Math.sin(y / 9.05);
context.lineTo(x, y);
}
for(var y = -17; y < 13; y++) {
var x = -5 * Math.sin(y / 9.05);
if(y==-17){
context.moveTo(x, y);
}
context.lineTo(x, y);
}*/
context.arc( 2, -9, 8, 0.00, 2.00 * Math.PI, false);
context.arc( 2, -9, 10.4, 0.00, 0.03 * Math.PI, false);
context.moveTo(8, -3);
context.arc( 2, -9, 10.4, 0.25 * Math.PI, 0.28 * Math.PI, false);
context.moveTo(2, -1);
context.arc( 2, -9, 10.4, 0.50 * Math.PI, 0.53 * Math.PI, false);
context.moveTo(-4, -3);
context.arc( 2, -9, 10.4, 0.75 * Math.PI, 0.78 * Math.PI, false);
context.moveTo(-6, -9);
context.arc( 2, -9, 10.4, 1.00 * Math.PI, 1.03 * Math.PI, false);
context.moveTo(-4, -15);
context.arc( 2, -9, 10.4, 1.25 * Math.PI, 1.28 * Math.PI, false);
context.moveTo(2, -17);
context.arc( 2, -9, 10.4, 1.50 * Math.PI, 1.53 * Math.PI, false);
context.moveTo(8, -15);
context.arc( 2, -9, 10.4, 1.75 * Math.PI, 1.78 * Math.PI, false);
context.stroke();
context.beginPath();
context.arc(-7, 9, 6, 0.15 * Math.PI, 2.15 * Math.PI, false);
context.moveTo(-1,12);
context.arc(-7, 9, 8.4, 0.15 * Math.PI, 0.18 * Math.PI, false);
context.moveTo(-5,15);
context.arc(-7, 9, 8.4, 0.40 * Math.PI, 0.43 * Math.PI, false);
context.moveTo(-10,15);
context.arc(-7, 9, 8.4, 0.65 * Math.PI, 0.68 * Math.PI, false);
context.moveTo(-13,11);
context.arc(-7, 9, 8.4, 0.90 * Math.PI, 0.93 * Math.PI, false);
context.moveTo(-13, 6);
context.arc(-7, 9, 8.4, 1.15 * Math.PI, 1.18 * Math.PI, false);
context.moveTo( -9, 3);
context.arc(-7, 9, 8.4, 1.40 * Math.PI, 1.43 * Math.PI, false);
context.moveTo( -4, 3);
context.arc(-7, 9, 8.4, 1.65 * Math.PI, 1.68 * Math.PI, false);
context.moveTo( -1, 7);
context.arc(-7, 9, 8.4, 1.90 * Math.PI, 1.93 * Math.PI, false);
context.stroke();
context.beginPath();
context.arc(8, 10, 3, 0.00, 2 * Math.PI, false);
context.arc(8, 10, 5, 0.00, 0.00 * Math.PI, false);
context.moveTo(10, 13.5);
context.arc(8, 10, 5, 0.33 * Math.PI, 0.33 * Math.PI, false);
context.moveTo(6.2, 13.5);
context.arc(8, 10, 5, 0.66 * Math.PI, 0.66 * Math.PI, false);
context.moveTo(5, 10);
context.arc(8, 10, 5, 0.99 * Math.PI, 0.99 * Math.PI, false);
context.moveTo(6.2, 7);
context.arc(8, 10, 5, 1.33 * Math.PI, 1.33 * Math.PI, false);
context.moveTo(9.8, 7);
context.arc(8, 10, 5, 1.66 * Math.PI, 1.66 * Math.PI, false);
context.stroke();
context.closePath();
context.lineWidth = tmpLineWidth;
context.strokeStyle = tmpStrokeStyle;
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
context.shadowBlur = 0;
/* var img = new Image();
//img.src = 'http://simpleicon.com/wp-content/uploads/gear-8.png';
//img.onload = function(){
//context.drawImage(img,pos.x,pos.y,50,50);
}*/
}
// Border width, draw border
......@@ -13689,7 +13886,7 @@ var cytoscape;
//PATCH !!!
context.globalAlpha = 1;
context.beginPath();
context.arc(x, y, 31, 0, 2 * Math.PI, false);
context.arc(x, y, 30, 0, 2 * Math.PI, false);
var my_gradient = context.createLinearGradient(0,0,0,40);
if(node[0].css('border-width') == '0.8px') {
context.shadowColor = 'darkgrey';
......@@ -13705,28 +13902,16 @@ var cytoscape;
}
context.fillStyle = my_gradient;
context.fill();
//context.lineWidth = 0;
//context.strokeStyle = '#7c7c7c';
//context.stroke();
context.closePath();
/*context.beginPath();
context.shadowOffsetX = 0;
context.shadowOffsetY = 0;
context.closePath();
context.fill();*/
context.beginPath();
context.moveTo(x,y-40);
context.lineWidth = 2;
context.lineCap = 'square';
context.moveTo(x,y-39);
context.lineTo(x,y-31);
context.strokeStyle = 'white';
context.stroke();
context.closePath();
context.beginPath();
context.strokeStyle = '#a2a2a2';
context.closePath();
//END PATCH
};
......
......@@ -188,17 +188,17 @@
}
}
for (var i in data.nodes) {
if(data.nodes[i].type == "input") {
if(data.nodes[i].type == "input" || data.nodes[i].type == "inputs") {
nodes.push({ data: {
id: data.nodes[i].name,
name: data.nodes[i].name,
name: data.nodes[i].display_name,
type: data.nodes[i].type }
});
}
else if(data.nodes[i].type == "component") {
nodes.push({ data: {
id: data.nodes[i].name,
name: data.nodes[i].name,
name: data.nodes[i].display_name,
type: data.nodes[i].type,
err: components[data.nodes[i].name].err,
wai: components[data.nodes[i].name].wai,
......@@ -213,7 +213,7 @@
edges.push({ data: { source: data.edges[i][0], target: data.edges[i][1] } });
}
}
// handle if there is some errors
$this.$element.find("#wfstatus_error_panel").hide();
if( data.errors != null ) {
......@@ -221,6 +221,22 @@
$this.$element.find("#wfstatus_error_location").text( data.errors["location"] );
$this.$element.find("#wfstatus_error_panel").show();
}
var layoptions = {
name: 'breadthfejofijefirst',
fit: true, // whether to fit the viewport to the graph
directed: true, // whether the tree is directed downwards (or edges can point in any direction if false)
padding: 30, // padding on fit
circle: false, // put depths in concentric circles if true, put depths top down if false
boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space
roots: undefined, // the roots of the trees
maximalAdjustments: 0, // how many times to try to position the nodes in a maximal way (i.e. no backtracking)
animate: false, // whether to transition the node positions
animationDuration: 500, // duration of animation in ms if enabled
ready: undefined, // callback on layoutready
stop: undefined // callback on layoutstop*/
};
$('#cytoscape_panel').cytoscape({
style: cytoscape.stylesheet()
......@@ -228,7 +244,7 @@
.css({
'width': '80px',
'height': '80px',
'content': 'data(id)',
'content': 'data(name)',
'pie-size': '100%',
'pie-1-background-color': 'lightgrey', //Error
'pie-1-background-size': 'mapData(err, 0, 100, 0, 100)',
......@@ -244,21 +260,19 @@
'text-valign': 'bottom',
'color': 'black',
'font-family': '"Trebuchet MS",Verdana,"Lucida Grande", Tahoma, Helvetica, sans-serif',
'border-opacity' : 1,
'border-width' : '0.05em',
'border-width' : '0',
'font-size': '10px'
})
.selector('node[type = "input"]')
.selector('node[type ^= "input"]')
.css({
'width': '62px',
'height': '62px',
'content': 'data(id)',
'content': 'data(name)',
'text-valign': 'bottom',
'color': 'black',
'font-family': '"Trebuchet MS",Verdana,"Lucida Grande", Tahoma, Helvetica, sans-serif',
'font-size': '10px',
'border-opacity' : 0.8,
'border-width' : '0.03em',
'border-width' : '0'
})
.selector('edge')
.css({
......@@ -286,31 +300,29 @@
},
ready: function(){
window.cy = this;
cy.elements().unselectify();
cy.on('mouseover', 'node', function(e){
var node = e.cyTarget;
if(node._private.data.type == 'input') {
node.animate({css: {'border-opacity': '0.5','background-opacity':'0.5'} }, {duration: 100});
if(node._private.data.type == 'input' || node._private.data.type == 'inputs') {
node.animate({css: {'background-opacity':'0.5'} }, {duration: 100});
}
else {
node.animate({css: {'border-opacity': '0.5','background-opacity':'0.2'} }, {duration: 100});
node.animate({css: {'background-opacity':'0.2'} }, {duration: 100});
}
});
cy.on('mouseout', 'node', function(e){
var node = e.cyTarget;
if(node._private.data.type == 'button') {
node.animate({css: {'border-opacity': '0.6','background-opacity':'0.7'} }, {duration: 100});
node.animate({css: {'background-opacity':'0.7'} }, {duration: 100});
}
else {
node.animate({css: {'border-opacity': '0.6','background-opacity':'0.9'} }, {duration: 100});
node.animate({css: {'background-opacity':'1'} }, {duration: 100});
}
});
cy.on('tap', 'node', function(e){
var node = e.cyTarget;
var neighborhood = node.neighborhood().add(node);
cy.remove("node[type = 'button']");
if(node.id() == 'reset') {
$this.reset(node._private.data.cname);
}
......@@ -318,10 +330,11 @@
//$this.info(node._private.data.cname);
}
else if(node._private.data.type == 'component'){
cy.elements().animate({css: {'border-width':0.7} }, {duration: 1});
cy.elements().unlock();
if(node.css('border-width') != '0.8px') {
node.animate({css: {'border-width':0.8} }, {duration: 1});
if(cy.$("node[id = 'reset']").inside()) {
cy.remove("node[type = 'button']");
cy.elements().unlock();
}
else {
cy.add(
{ group: "nodes",
data: { id: "reset", name: "", cname: node.id(), type: "button" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment