Author: marekz
Date: 2011-07-10 16:39:03 -0700 (Sun, 10 Jul 2011)
New Revision: 26130

Modified:
   cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/cytoscapeweb-svg.js
   cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/main.html
Log:
Added edge line style (dash, dot). Edited demo graph.

Modified: cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/cytoscapeweb-svg.js
===================================================================
--- cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/cytoscapeweb-svg.js 
2011-07-09 17:04:17 UTC (rev 26129)
+++ cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/cytoscapeweb-svg.js 
2011-07-10 23:39:03 UTC (rev 26130)
@@ -919,15 +919,26 @@
                if (this._elem == null) {
                                this._elem = 
this._visualization._canvas.path(this._getSvgPath()).toBack().click(Util.delegate(this,
 "_onClick")).attr("cursor", "pointer");
                }
+               
+               var dashArray = {
+                       "SOLID": "",
+                       "DASH": "-",
+                       "DOT": ".",
+                       "LONG_DASH": "--"
+               }[this.getRenderedStyle("style")];
 
+
                var attr = {
                        // Update position
-                       "path": this._getSvgPath()
+                       "path": this._getSvgPath(),
+                       "stroke-dasharray" : dashArray,
                };
+               
 
                var attrMap = {
                        "stroke": "color",
                        //"fill": "color",
+               
                        "stroke-width": "width",
                        "stroke-opacity": "opacity"
                };
@@ -939,6 +950,7 @@
                        attr[attrName] =  
this.getRenderedStyle(attrMap[attrName]);
                }
 
+               
                this._elem.attr(attr);
        };
        

Modified: cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/main.html
===================================================================
--- cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/main.html   2011-07-09 
17:04:17 UTC (rev 26129)
+++ cytoscapeweb/branches/gsoc2011/cytoscapeweb-svg/main.html   2011-07-10 
23:39:03 UTC (rev 26130)
@@ -140,19 +140,19 @@
                        
                        graphs.ringGraph = {
                                "nodes": [
-                                       
{"id":"n1","x":38,"y":219,"style":{size: 32, color: "teal", shape: "DIAMOND"}},
-                                       {"id":"n2","x":57,"y":44,"style":{size: 
26, color: "pink"}},
-                                       
{"id":"n3","x":171,"y":28,"style":{size: 16, borderColor: "green", shape: 
"RECTANGLE"}},
-                                       
{"id":"n4","x":251,"y":132,"style":{size: 10, borderColor: "blue", shape: 
"DIAMOND"}},
+                                       
{"id":"n1","x":38,"y":219,"style":{size: 32, borderColor: "black", color: 
"teal", shape: "DIAMOND", borderWidth: 4}},
+                                       {"id":"n2","x":57,"y":44,"style":{size: 
26, color: "chocolate", borderWidth: 6}},
+                                       
{"id":"n3","x":171,"y":28,"style":{size: 16, borderColor: "green", shape: 
"RECTANGLE", borderWidth: 2}},
+                                       
{"id":"n4","x":251,"y":132,"style":{size: 12, borderColor: "blue", shape: 
"DIAMOND", borderWidth:4}},
                                        
{"id":"n5","x":156,"y":220,"style":{borderColor: "red"}}
                                ],
                                "edges": [
-                                       
{"id":"e1","source":"n1","target":"n2","style":{forwardArrowShape: "DELTA"}},
-                                       
{"id":"e2","source":"n2","target":"n3","style":{forwardArrowShape: "DELTA", 
backwardArrowShape: "DELTA"}},
-                                       
{"id":"e3","source":"n3","target":"n4","style":{color: "red", width: 1}},
+                                       
{"id":"e1","source":"n1","target":"n2","style":{forwardArrowShape: "DELTA", 
color: "#394", width: 3}},
+                                       
{"id":"e2","source":"n2","target":"n3","style":{forwardArrowShape: "DELTA", 
backwardArrowShape: "DELTA", width: 3}},
+                                       
{"id":"e3","source":"n3","target":"n4","style":{color: "red", width: 6, style: 
"DASH"}},
                                        
{"id":"e4","source":"n4","target":"n5","style":{forwardArrowShape: "DELTA", 
color: "blue", width: 5}},
                                        
{"id":"e5","source":"n5","target":"n4","style":{forwardArrowShape: "DELTA", 
width: 5}},
-                                       
{"id":"e6","source":"n5","target":"n1","style":{}}
+                                       
{"id":"e6","source":"n5","target":"n1","style":{style: "DOT"}}
                                ]
                        }
                        

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to