Skip to content

Commit

Permalink
Added arrow head to async arrow with cross
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Jan 9, 2015
1 parent 9527237 commit 36b389b
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 32 deletions.
33 changes: 23 additions & 10 deletions dist/mermaid.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -16602,19 +16602,32 @@ exports.insertArrowHead = function(elem){
* Setup arrow head and define the marker. The result is appended to the svg.
*/
exports.insertArrowCrossHead = function(elem){
elem.append("defs").append("marker")
var defs = elem.append("defs");
var marker = defs.append("marker")
.attr("id", "crosshead")
.attr("markerWidth", 8)
.attr("markerWidth", 15)
.attr("markerHeight", 8)
.attr("orient", "auto")
.attr("refX", 15)
.attr("refY", 4)
.append("path")
.attr("fill",'none')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 1,1 L 7,7 M 7,1 L 1,7"); //this is actual shape for arrowhead
.attr("refX", 16)
.attr("refY", 4);

// The arrow
marker.append("path")
.attr("fill",'black')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 9,2 V 6 L16,4 Z");

// The cross
marker.append("path")
.attr("fill",'none')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 0,1 L 6,7 M 6,1 L 0,7")
; //this is actual shape for arrowhead

};

exports.getTextObj = function(){
Expand Down
2 changes: 1 addition & 1 deletion dist/mermaid.full.min.js

Large diffs are not rendered by default.

33 changes: 23 additions & 10 deletions dist/mermaid.slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -16570,19 +16570,32 @@ exports.insertArrowHead = function(elem){
* Setup arrow head and define the marker. The result is appended to the svg.
*/
exports.insertArrowCrossHead = function(elem){
elem.append("defs").append("marker")
var defs = elem.append("defs");
var marker = defs.append("marker")
.attr("id", "crosshead")
.attr("markerWidth", 8)
.attr("markerWidth", 15)
.attr("markerHeight", 8)
.attr("orient", "auto")
.attr("refX", 15)
.attr("refY", 4)
.append("path")
.attr("fill",'none')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 1,1 L 7,7 M 7,1 L 1,7"); //this is actual shape for arrowhead
.attr("refX", 16)
.attr("refY", 4);

// The arrow
marker.append("path")
.attr("fill",'black')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 9,2 V 6 L16,4 Z");

// The cross
marker.append("path")
.attr("fill",'none')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 0,1 L 6,7 M 6,1 L 0,7")
; //this is actual shape for arrowhead

};

exports.getTextObj = function(){
Expand Down
2 changes: 1 addition & 1 deletion dist/mermaid.slim.min.js

Large diffs are not rendered by default.

33 changes: 23 additions & 10 deletions src/diagrams/sequenceDiagram/svgDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,32 @@ exports.insertArrowHead = function(elem){
* Setup arrow head and define the marker. The result is appended to the svg.
*/
exports.insertArrowCrossHead = function(elem){
elem.append("defs").append("marker")
var defs = elem.append("defs");
var marker = defs.append("marker")
.attr("id", "crosshead")
.attr("markerWidth", 8)
.attr("markerWidth", 15)
.attr("markerHeight", 8)
.attr("orient", "auto")
.attr("refX", 15)
.attr("refY", 4)
.append("path")
.attr("fill",'none')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 1,1 L 7,7 M 7,1 L 1,7"); //this is actual shape for arrowhead
.attr("refX", 16)
.attr("refY", 4);

// The arrow
marker.append("path")
.attr("fill",'black')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 9,2 V 6 L16,4 Z");

// The cross
marker.append("path")
.attr("fill",'none')
.attr("stroke",'#000000')
.style("stroke-dasharray", ("0, 0"))
.attr("stroke-width",'1px')
.attr("d", "M 0,1 L 6,7 M 6,1 L 0,7")
; //this is actual shape for arrowhead

};

exports.getTextObj = function(){
Expand Down

0 comments on commit 36b389b

Please sign in to comment.