mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-20 08:46:44 +02:00
Cleanup of code
This commit is contained in:
@@ -302,6 +302,9 @@ module.exports.draw = function (text, id) {
|
|||||||
exports.bounds.init();
|
exports.bounds.init();
|
||||||
var diagram = d3.select('#'+id);
|
var diagram = d3.select('#'+id);
|
||||||
|
|
||||||
|
var startx;
|
||||||
|
var stopx;
|
||||||
|
|
||||||
// Fetch data from the parsing
|
// Fetch data from the parsing
|
||||||
var actors = sq.yy.getActors();
|
var actors = sq.yy.getActors();
|
||||||
var actorKeys = sq.yy.getActorKeys();
|
var actorKeys = sq.yy.getActorKeys();
|
||||||
@@ -381,9 +384,6 @@ module.exports.draw = function (text, id) {
|
|||||||
drawMessage(diagram, startx, stopx, exports.bounds.getVerticalPos(), msg);
|
drawMessage(diagram, startx, stopx, exports.bounds.getVerticalPos(), msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var startx;
|
|
||||||
var stopx;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var box = exports.bounds.getBounds();
|
var box = exports.bounds.getBounds();
|
||||||
|
@@ -51,7 +51,7 @@ exports.drawLabel = function(elem , txtObject){
|
|||||||
rectData.class = 'labelBox';
|
rectData.class = 'labelBox';
|
||||||
//rectData.color = 'white';
|
//rectData.color = 'white';
|
||||||
|
|
||||||
var label = exports.drawRect(elem, rectData);
|
exports.drawRect(elem, rectData);
|
||||||
|
|
||||||
txtObject.y = txtObject.y + txtObject.labelMargin;
|
txtObject.y = txtObject.y + txtObject.labelMargin;
|
||||||
txtObject.x = txtObject.x + 0.5*txtObject.labelMargin;
|
txtObject.x = txtObject.x + 0.5*txtObject.labelMargin;
|
||||||
@@ -79,16 +79,16 @@ exports.drawActor = function(elem, left,description,conf){
|
|||||||
.attr("stroke-width", '0.5px')
|
.attr("stroke-width", '0.5px')
|
||||||
.attr("stroke", '#999');
|
.attr("stroke", '#999');
|
||||||
|
|
||||||
g.append("rect")
|
var rect = exports.getNoteRect();
|
||||||
.attr("x", left)
|
rect.x = left;
|
||||||
.attr("y", 0)
|
rect.fill = '#eaeaea';
|
||||||
.attr("fill", '#eaeaea')
|
rect.width = conf.width;
|
||||||
.attr("stroke", '#666')
|
rect.height = conf.height;
|
||||||
.attr("width", conf.width)
|
rect.class = 'actor';
|
||||||
.attr("height", conf.height)
|
rect.rx = 3;
|
||||||
.attr("class", 'actor')
|
rect.ry = 3;
|
||||||
.attr("rx", 3)
|
exports.drawRect(g, rect);
|
||||||
.attr("ry", 3);
|
|
||||||
g.append("text") // text label for the x axis
|
g.append("text") // text label for the x axis
|
||||||
.attr("x", center)
|
.attr("x", center)
|
||||||
.attr("y", (conf.height/2)+5)
|
.attr("y", (conf.height/2)+5)
|
||||||
@@ -103,7 +103,7 @@ exports.drawActor = function(elem, left,description,conf){
|
|||||||
exports.insertArrowHead = function(elem){
|
exports.insertArrowHead = function(elem){
|
||||||
elem.append("defs").append("marker")
|
elem.append("defs").append("marker")
|
||||||
.attr("id", "arrowhead")
|
.attr("id", "arrowhead")
|
||||||
.attr("refX", 5) /*must be smarter way to calculate shift*/
|
.attr("refX", 5)
|
||||||
.attr("refY", 2)
|
.attr("refY", 2)
|
||||||
.attr("markerWidth", 6)
|
.attr("markerWidth", 6)
|
||||||
.attr("markerHeight", 4)
|
.attr("markerHeight", 4)
|
||||||
@@ -117,11 +117,11 @@ exports.insertArrowHead = function(elem){
|
|||||||
exports.insertArrowCrossHead = function(elem){
|
exports.insertArrowCrossHead = function(elem){
|
||||||
elem.append("defs").append("marker")
|
elem.append("defs").append("marker")
|
||||||
.attr("id", "crosshead")
|
.attr("id", "crosshead")
|
||||||
.attr("refX", 15) /*must be smarter way to calculate shift*/
|
|
||||||
.attr("refY", 4)
|
|
||||||
.attr("markerWidth", 8)
|
.attr("markerWidth", 8)
|
||||||
.attr("markerHeight", 8)
|
.attr("markerHeight", 8)
|
||||||
.attr("orient", "auto")
|
.attr("orient", "auto")
|
||||||
|
.attr("refX", 15)
|
||||||
|
.attr("refY", 4)
|
||||||
.append("path")
|
.append("path")
|
||||||
.attr("fill",'none')
|
.attr("fill",'none')
|
||||||
.attr("stroke",'#000000')
|
.attr("stroke",'#000000')
|
||||||
|
Reference in New Issue
Block a user