Fix for defect #158
This commit is contained in:
parent
f310eb0574
commit
2204d46ce1
|
@ -28315,6 +28315,7 @@ module.exports.draw = function (text, id) {
|
||||||
var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
||||||
|
|
||||||
elem.style.height = h + 'px';
|
elem.style.height = h + 'px';
|
||||||
|
elem.setAttribute('height', h);
|
||||||
var svg = d3.select('#' + id);
|
var svg = d3.select('#' + id);
|
||||||
|
|
||||||
// http://codepen.io/anon/pen/azLvWR
|
// http://codepen.io/anon/pen/azLvWR
|
||||||
|
@ -30093,10 +30094,11 @@ if (typeof module !== 'undefined' && require.main === module) {
|
||||||
/**
|
/**
|
||||||
* Created by knut on 14-11-19.
|
* Created by knut on 14-11-19.
|
||||||
*/
|
*/
|
||||||
var actors = {};
|
var actors = {};
|
||||||
var actorKeys = [];
|
var actorKeys = [];
|
||||||
var messages = [];
|
var messages = [];
|
||||||
var notes = [];
|
var notes = [];
|
||||||
|
|
||||||
exports.addActor = function(id,name,description){
|
exports.addActor = function(id,name,description){
|
||||||
//console.log('Adding actor: '+id);
|
//console.log('Adding actor: '+id);
|
||||||
actors[id] = {name:name, description:description};
|
actors[id] = {name:name, description:description};
|
||||||
|
@ -30108,6 +30110,9 @@ exports.addMessage = function(idFrom, idTo, message, answer){
|
||||||
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
exports.addSignal = function(idFrom, idTo, message, messageType){
|
exports.addSignal = function(idFrom, idTo, message, messageType){
|
||||||
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
||||||
messages.push({from:idFrom, to:idTo, message:message, type:messageType});
|
messages.push({from:idFrom, to:idTo, message:message, type:messageType});
|
||||||
|
@ -30128,37 +30133,36 @@ exports.getActorKeys = function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.clear = function(){
|
exports.clear = function(){
|
||||||
actors = {};
|
actors = {};
|
||||||
messages = [];
|
messages = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.LINETYPE = {
|
exports.LINETYPE = {
|
||||||
SOLID : 0,
|
SOLID : 0 ,
|
||||||
DOTTED : 1,
|
DOTTED : 1 ,
|
||||||
NOTE : 2,
|
NOTE : 2 ,
|
||||||
SOLID_CROSS : 3,
|
SOLID_CROSS : 3 ,
|
||||||
DOTTED_CROSS: 4,
|
DOTTED_CROSS : 4 ,
|
||||||
SOLID_OPEN : 5,
|
SOLID_OPEN : 5 ,
|
||||||
DOTTED_OPEN : 6,
|
DOTTED_OPEN : 6 ,
|
||||||
LOOP_START : 10,
|
LOOP_START : 10 ,
|
||||||
LOOP_END : 11,
|
LOOP_END : 11 ,
|
||||||
ALT_START : 12,
|
ALT_START : 12 ,
|
||||||
ALT_ELSE : 13,
|
ALT_ELSE : 13 ,
|
||||||
ALT_END : 14,
|
ALT_END : 14 ,
|
||||||
OPT_START : 15,
|
OPT_START : 15 ,
|
||||||
OPT_END : 16
|
OPT_END : 16
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.ARROWTYPE = {
|
exports.ARROWTYPE = {
|
||||||
FILLED : 0,
|
FILLED : 0,
|
||||||
OPEN : 1
|
OPEN : 1
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.PLACEMENT = {
|
exports.PLACEMENT = {
|
||||||
LEFTOF : 0,
|
LEFTOF : 0,
|
||||||
RIGHTOF : 1,
|
RIGHTOF : 1,
|
||||||
OVER : 2
|
OVER : 2
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.addNote = function (actor, placement, message){
|
exports.addNote = function (actor, placement, message){
|
||||||
|
@ -30809,15 +30813,15 @@ exports.getTextObj = function(){
|
||||||
|
|
||||||
exports.getNoteRect = function(){
|
exports.getNoteRect = function(){
|
||||||
var rect = {
|
var rect = {
|
||||||
x: 0,
|
x : 0,
|
||||||
y: 0,
|
y : 0,
|
||||||
fill: '#EDF2AE',
|
fill : '#EDF2AE',
|
||||||
stroke: '#666',
|
stroke : '#666',
|
||||||
width: 100,
|
width : 100,
|
||||||
anchor:'start',
|
anchor : 'start',
|
||||||
height: 100,
|
height : 100,
|
||||||
rx: 0,
|
rx : 0,
|
||||||
ry: 0
|
ry : 0
|
||||||
};
|
};
|
||||||
return rect;
|
return rect;
|
||||||
};
|
};
|
||||||
|
@ -31012,21 +31016,22 @@ var equals = function (val, variable){
|
||||||
};
|
};
|
||||||
|
|
||||||
global.mermaid = {
|
global.mermaid = {
|
||||||
startOnLoad:true,
|
startOnLoad: true,
|
||||||
htmlLabels:true,
|
htmlLabels: true,
|
||||||
init:function(sequenceConfig, nodes){
|
|
||||||
|
init: function(sequenceConfig, nodes) {
|
||||||
init.apply(null, arguments);
|
init.apply(null, arguments);
|
||||||
},
|
},
|
||||||
version:function(){
|
version: function() {
|
||||||
return exports.version();
|
return exports.version();
|
||||||
},
|
},
|
||||||
getParser:function(){
|
getParser: function() {
|
||||||
return flow.parser;
|
return flow.parser;
|
||||||
},
|
},
|
||||||
parse:function(text){
|
parse: function(text) {
|
||||||
return parse(text);
|
return parse(text);
|
||||||
},
|
},
|
||||||
parseError:function(err,hash){
|
parseError: function(err, hash) {
|
||||||
console.log('Mermaid Syntax error:');
|
console.log('Mermaid Syntax error:');
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
@ -31068,6 +31073,9 @@ if(typeof document !== 'undefined'){
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var apa = 1;
|
||||||
|
var bapselsin = 2;
|
||||||
|
|
||||||
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||||
},{"../package.json":84,"./diagrams/example/exampleDb":85,"./diagrams/example/exampleRenderer":86,"./diagrams/example/parser/example":87,"./diagrams/flowchart/flowRenderer":90,"./diagrams/flowchart/graphDb":91,"./diagrams/flowchart/parser/dot":92,"./diagrams/flowchart/parser/flow":93,"./diagrams/gantt/ganttDb":95,"./diagrams/gantt/ganttRenderer":96,"./diagrams/gantt/parser/gantt":97,"./diagrams/sequenceDiagram/parser/sequenceDiagram":99,"./diagrams/sequenceDiagram/sequenceDb":100,"./diagrams/sequenceDiagram/sequenceRenderer":101,"./utils":104,"he":81}],104:[function(require,module,exports){
|
},{"../package.json":84,"./diagrams/example/exampleDb":85,"./diagrams/example/exampleRenderer":86,"./diagrams/example/parser/example":87,"./diagrams/flowchart/flowRenderer":90,"./diagrams/flowchart/graphDb":91,"./diagrams/flowchart/parser/dot":92,"./diagrams/flowchart/parser/flow":93,"./diagrams/gantt/ganttDb":95,"./diagrams/gantt/ganttRenderer":96,"./diagrams/gantt/parser/gantt":97,"./diagrams/sequenceDiagram/parser/sequenceDiagram":99,"./diagrams/sequenceDiagram/sequenceDb":100,"./diagrams/sequenceDiagram/sequenceRenderer":101,"./utils":104,"he":81}],104:[function(require,module,exports){
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -28283,6 +28283,7 @@ module.exports.draw = function (text, id) {
|
||||||
var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
||||||
|
|
||||||
elem.style.height = h + 'px';
|
elem.style.height = h + 'px';
|
||||||
|
elem.setAttribute('height', h);
|
||||||
var svg = d3.select('#' + id);
|
var svg = d3.select('#' + id);
|
||||||
|
|
||||||
// http://codepen.io/anon/pen/azLvWR
|
// http://codepen.io/anon/pen/azLvWR
|
||||||
|
@ -30061,10 +30062,11 @@ if (typeof module !== 'undefined' && require.main === module) {
|
||||||
/**
|
/**
|
||||||
* Created by knut on 14-11-19.
|
* Created by knut on 14-11-19.
|
||||||
*/
|
*/
|
||||||
var actors = {};
|
var actors = {};
|
||||||
var actorKeys = [];
|
var actorKeys = [];
|
||||||
var messages = [];
|
var messages = [];
|
||||||
var notes = [];
|
var notes = [];
|
||||||
|
|
||||||
exports.addActor = function(id,name,description){
|
exports.addActor = function(id,name,description){
|
||||||
//console.log('Adding actor: '+id);
|
//console.log('Adding actor: '+id);
|
||||||
actors[id] = {name:name, description:description};
|
actors[id] = {name:name, description:description};
|
||||||
|
@ -30076,6 +30078,9 @@ exports.addMessage = function(idFrom, idTo, message, answer){
|
||||||
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
exports.addSignal = function(idFrom, idTo, message, messageType){
|
exports.addSignal = function(idFrom, idTo, message, messageType){
|
||||||
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
||||||
messages.push({from:idFrom, to:idTo, message:message, type:messageType});
|
messages.push({from:idFrom, to:idTo, message:message, type:messageType});
|
||||||
|
@ -30096,37 +30101,36 @@ exports.getActorKeys = function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.clear = function(){
|
exports.clear = function(){
|
||||||
actors = {};
|
actors = {};
|
||||||
messages = [];
|
messages = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.LINETYPE = {
|
exports.LINETYPE = {
|
||||||
SOLID : 0,
|
SOLID : 0 ,
|
||||||
DOTTED : 1,
|
DOTTED : 1 ,
|
||||||
NOTE : 2,
|
NOTE : 2 ,
|
||||||
SOLID_CROSS : 3,
|
SOLID_CROSS : 3 ,
|
||||||
DOTTED_CROSS: 4,
|
DOTTED_CROSS : 4 ,
|
||||||
SOLID_OPEN : 5,
|
SOLID_OPEN : 5 ,
|
||||||
DOTTED_OPEN : 6,
|
DOTTED_OPEN : 6 ,
|
||||||
LOOP_START : 10,
|
LOOP_START : 10 ,
|
||||||
LOOP_END : 11,
|
LOOP_END : 11 ,
|
||||||
ALT_START : 12,
|
ALT_START : 12 ,
|
||||||
ALT_ELSE : 13,
|
ALT_ELSE : 13 ,
|
||||||
ALT_END : 14,
|
ALT_END : 14 ,
|
||||||
OPT_START : 15,
|
OPT_START : 15 ,
|
||||||
OPT_END : 16
|
OPT_END : 16
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.ARROWTYPE = {
|
exports.ARROWTYPE = {
|
||||||
FILLED : 0,
|
FILLED : 0,
|
||||||
OPEN : 1
|
OPEN : 1
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.PLACEMENT = {
|
exports.PLACEMENT = {
|
||||||
LEFTOF : 0,
|
LEFTOF : 0,
|
||||||
RIGHTOF : 1,
|
RIGHTOF : 1,
|
||||||
OVER : 2
|
OVER : 2
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.addNote = function (actor, placement, message){
|
exports.addNote = function (actor, placement, message){
|
||||||
|
@ -30777,15 +30781,15 @@ exports.getTextObj = function(){
|
||||||
|
|
||||||
exports.getNoteRect = function(){
|
exports.getNoteRect = function(){
|
||||||
var rect = {
|
var rect = {
|
||||||
x: 0,
|
x : 0,
|
||||||
y: 0,
|
y : 0,
|
||||||
fill: '#EDF2AE',
|
fill : '#EDF2AE',
|
||||||
stroke: '#666',
|
stroke : '#666',
|
||||||
width: 100,
|
width : 100,
|
||||||
anchor:'start',
|
anchor : 'start',
|
||||||
height: 100,
|
height : 100,
|
||||||
rx: 0,
|
rx : 0,
|
||||||
ry: 0
|
ry : 0
|
||||||
};
|
};
|
||||||
return rect;
|
return rect;
|
||||||
};
|
};
|
||||||
|
@ -30980,21 +30984,22 @@ var equals = function (val, variable){
|
||||||
};
|
};
|
||||||
|
|
||||||
global.mermaid = {
|
global.mermaid = {
|
||||||
startOnLoad:true,
|
startOnLoad: true,
|
||||||
htmlLabels:true,
|
htmlLabels: true,
|
||||||
init:function(sequenceConfig, nodes){
|
|
||||||
|
init: function(sequenceConfig, nodes) {
|
||||||
init.apply(null, arguments);
|
init.apply(null, arguments);
|
||||||
},
|
},
|
||||||
version:function(){
|
version: function() {
|
||||||
return exports.version();
|
return exports.version();
|
||||||
},
|
},
|
||||||
getParser:function(){
|
getParser: function() {
|
||||||
return flow.parser;
|
return flow.parser;
|
||||||
},
|
},
|
||||||
parse:function(text){
|
parse: function(text) {
|
||||||
return parse(text);
|
return parse(text);
|
||||||
},
|
},
|
||||||
parseError:function(err,hash){
|
parseError: function(err, hash) {
|
||||||
console.log('Mermaid Syntax error:');
|
console.log('Mermaid Syntax error:');
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
@ -31036,6 +31041,9 @@ if(typeof document !== 'undefined'){
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var apa = 1;
|
||||||
|
var bapselsin = 2;
|
||||||
|
|
||||||
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||||
},{"../package.json":84,"./diagrams/example/exampleDb":85,"./diagrams/example/exampleRenderer":86,"./diagrams/example/parser/example":87,"./diagrams/flowchart/flowRenderer":90,"./diagrams/flowchart/graphDb":91,"./diagrams/flowchart/parser/dot":92,"./diagrams/flowchart/parser/flow":93,"./diagrams/gantt/ganttDb":95,"./diagrams/gantt/ganttRenderer":96,"./diagrams/gantt/parser/gantt":97,"./diagrams/sequenceDiagram/parser/sequenceDiagram":99,"./diagrams/sequenceDiagram/sequenceDb":100,"./diagrams/sequenceDiagram/sequenceRenderer":101,"./utils":104,"he":81}],104:[function(require,module,exports){
|
},{"../package.json":84,"./diagrams/example/exampleDb":85,"./diagrams/example/exampleRenderer":86,"./diagrams/example/parser/example":87,"./diagrams/flowchart/flowRenderer":90,"./diagrams/flowchart/graphDb":91,"./diagrams/flowchart/parser/dot":92,"./diagrams/flowchart/parser/flow":93,"./diagrams/gantt/ganttDb":95,"./diagrams/gantt/ganttRenderer":96,"./diagrams/gantt/parser/gantt":97,"./diagrams/sequenceDiagram/parser/sequenceDiagram":99,"./diagrams/sequenceDiagram/sequenceDb":100,"./diagrams/sequenceDiagram/sequenceRenderer":101,"./utils":104,"he":81}],104:[function(require,module,exports){
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because one or more lines are too long
10
lib/cli.js
10
lib/cli.js
|
@ -24,6 +24,7 @@ function cli(options) {
|
||||||
, verbose: 'v'
|
, verbose: 'v'
|
||||||
, phantomPath: 'e'
|
, phantomPath: 'e'
|
||||||
, sequenceConfig: 'c'
|
, sequenceConfig: 'c'
|
||||||
|
, ganttConfig: 'g'
|
||||||
, css: 't'
|
, css: 't'
|
||||||
}
|
}
|
||||||
, 'boolean': ['help', 'png', 'svg']
|
, 'boolean': ['help', 'png', 'svg']
|
||||||
|
@ -45,6 +46,7 @@ function cli(options) {
|
||||||
, " -e --phantomPath Specify the path to the phantomjs executable"
|
, " -e --phantomPath Specify the path to the phantomjs executable"
|
||||||
, " -t --css Specify the path to a CSS file to be included when processing output"
|
, " -t --css Specify the path to a CSS file to be included when processing output"
|
||||||
, " -c --sequenceConfig Specify the path to the file with the configuration to be applied in the sequence diagram"
|
, " -c --sequenceConfig Specify the path to the file with the configuration to be applied in the sequence diagram"
|
||||||
|
, " -g --ganttConfig Specify the path to the file with the configuration to be applied in the gantt diagram"
|
||||||
, " -h --help Show this message"
|
, " -h --help Show this message"
|
||||||
, " -v --verbose Show logging"
|
, " -v --verbose Show logging"
|
||||||
, " --version Print version and quit"
|
, " --version Print version and quit"
|
||||||
|
@ -74,7 +76,7 @@ cli.prototype.parse = function(argv, next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure that parameter-expecting options have parameters
|
// ensure that parameter-expecting options have parameters
|
||||||
;['outputDir', 'phantomPath', 'sequenceConfig', 'css'].forEach(function(i) {
|
;['outputDir', 'phantomPath', 'sequenceConfig', 'ganttConfig', 'css'].forEach(function(i) {
|
||||||
if(typeof options[i] !== 'undefined') {
|
if(typeof options[i] !== 'undefined') {
|
||||||
if (typeof options[i] !== 'string' || options[i].length < 1) {
|
if (typeof options[i] !== 'string' || options[i].length < 1) {
|
||||||
this.errors.push(new Error(i + " expects a value."))
|
this.errors.push(new Error(i + " expects a value."))
|
||||||
|
@ -94,6 +96,12 @@ cli.prototype.parse = function(argv, next) {
|
||||||
options.sequenceConfig = checkConfig(options.sequenceConfig)
|
options.sequenceConfig = checkConfig(options.sequenceConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (options.ganttConfig) {
|
||||||
|
options.ganttConfig = checkConfig(options.ganttConfig)
|
||||||
|
console.log('Got conf'+options.ganttConfig);
|
||||||
|
}
|
||||||
|
|
||||||
if (options.css) {
|
if (options.css) {
|
||||||
try {
|
try {
|
||||||
options.css = fs.readFileSync(options.css, 'utf8')
|
options.css = fs.readFileSync(options.css, 'utf8')
|
||||||
|
|
|
@ -20,6 +20,7 @@ function processMermaid(files, _options, _next) {
|
||||||
, options.svg
|
, options.svg
|
||||||
, options.css || ''
|
, options.css || ''
|
||||||
, options.sequenceConfig
|
, options.sequenceConfig
|
||||||
|
, options.ganttConfig
|
||||||
, options.verbose
|
, options.verbose
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -28,18 +28,24 @@ var system = require('system')
|
||||||
, fs = require('fs')
|
, fs = require('fs')
|
||||||
, webpage = require('webpage')
|
, webpage = require('webpage')
|
||||||
|
|
||||||
|
|
||||||
var page = webpage.create()
|
var page = webpage.create()
|
||||||
, files = phantom.args.slice(6, phantom.args.length)
|
, files = phantom.args.slice(7, phantom.args.length)
|
||||||
, options = {
|
, options = {
|
||||||
outputDir: phantom.args[0]
|
outputDir: phantom.args[0]
|
||||||
, png: phantom.args[1] === 'true' ? true : false
|
, png: phantom.args[1] === 'true' ? true : false
|
||||||
, svg: phantom.args[2] === 'true' ? true : false
|
, svg: phantom.args[2] === 'true' ? true : false
|
||||||
, css: phantom.args[3] !== '' ? phantom.args[3] : '* { margin: 0; padding: 0; }'
|
, css: phantom.args[3] !== '' ? phantom.args[3] : '* { margin: 0; padding: 0; }'
|
||||||
, sequenceConfig: phantom.args[4]
|
, sequenceConfig: phantom.args[4]
|
||||||
, verbose: phantom.args[5] === 'true' ? true : false
|
, ganttConfig: phantom.args[5]
|
||||||
|
, verbose: phantom.args[6] === 'true' ? true : false
|
||||||
}
|
}
|
||||||
, log = logger(options.verbose)
|
, log = logger(options.verbose)
|
||||||
|
|
||||||
|
|
||||||
|
console.log('options');
|
||||||
|
console.log(options.ganttConfig);
|
||||||
|
|
||||||
page.content = [
|
page.content = [
|
||||||
'<html>'
|
'<html>'
|
||||||
, '<head>'
|
, '<head>'
|
||||||
|
@ -68,8 +74,9 @@ files.forEach(function(file) {
|
||||||
// look like it. we need to serialize then unserialize the svgContent that's
|
// look like it. we need to serialize then unserialize the svgContent that's
|
||||||
// taken from the DOM
|
// taken from the DOM
|
||||||
svgContent = page.evaluate(executeInPage, {
|
svgContent = page.evaluate(executeInPage, {
|
||||||
contents: contents,
|
contents : contents,
|
||||||
sequenceConfig: options.sequenceConfig
|
ganttConfig : options.ganttConfig,
|
||||||
|
sequenceConfig : options.sequenceConfig
|
||||||
})
|
})
|
||||||
oDOM = oParser.parseFromString(svgContent, "text/xml")
|
oDOM = oParser.parseFromString(svgContent, "text/xml")
|
||||||
|
|
||||||
|
@ -193,6 +200,7 @@ function executeInPage(data) {
|
||||||
var xmlSerializer = new XMLSerializer()
|
var xmlSerializer = new XMLSerializer()
|
||||||
, contents = data.contents
|
, contents = data.contents
|
||||||
, sequenceConfig = data.sequenceConfig
|
, sequenceConfig = data.sequenceConfig
|
||||||
|
, ganttConfig = data.ganttConfig
|
||||||
, toRemove
|
, toRemove
|
||||||
, el
|
, el
|
||||||
, elContent
|
, elContent
|
||||||
|
@ -221,6 +229,17 @@ function executeInPage(data) {
|
||||||
document.body.appendChild(sc)
|
document.body.appendChild(sc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(typeof ganttConfig !== undefined && ganttConfig !== 'undefined'){
|
||||||
|
console.log('Got ganttConfig');
|
||||||
|
sc = document.createElement("script")
|
||||||
|
scContent = document.createTextNode('mermaid.ganttConfig = JSON.parse(' + JSON.stringify(ganttConfig) + ');')
|
||||||
|
sc.appendChild(scContent)
|
||||||
|
|
||||||
|
document.body.appendChild(sc)
|
||||||
|
}else{
|
||||||
|
console.log('No gantt config');
|
||||||
|
}
|
||||||
|
|
||||||
mermaid.init();
|
mermaid.init();
|
||||||
|
|
||||||
svg = document.querySelector('svg')
|
svg = document.querySelector('svg')
|
||||||
|
|
|
@ -21,4 +21,3 @@ gantt
|
||||||
Add gantt diagram to demo page :after a1 , 2h
|
Add gantt diagram to demo page :after a1 , 2h
|
||||||
Add gantt to diagram to demo page :after a1 , 2h
|
Add gantt to diagram to demo page :after a1 , 2h
|
||||||
```
|
```
|
||||||
testa
|
|
|
@ -38,6 +38,7 @@ module.exports.draw = function (text, id) {
|
||||||
var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
||||||
|
|
||||||
elem.style.height = h + 'px';
|
elem.style.height = h + 'px';
|
||||||
|
elem.setAttribute('height', h);
|
||||||
var svg = d3.select('#' + id);
|
var svg = d3.select('#' + id);
|
||||||
|
|
||||||
// http://codepen.io/anon/pen/azLvWR
|
// http://codepen.io/anon/pen/azLvWR
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
/**
|
/**
|
||||||
* Created by knut on 14-11-19.
|
* Created by knut on 14-11-19.
|
||||||
*/
|
*/
|
||||||
var actors = {};
|
var actors = {};
|
||||||
var actorKeys = [];
|
var actorKeys = [];
|
||||||
var messages = [];
|
var messages = [];
|
||||||
var notes = [];
|
var notes = [];
|
||||||
|
|
||||||
exports.addActor = function(id,name,description){
|
exports.addActor = function(id,name,description){
|
||||||
//console.log('Adding actor: '+id);
|
//console.log('Adding actor: '+id);
|
||||||
actors[id] = {name:name, description:description};
|
actors[id] = {name:name, description:description};
|
||||||
|
@ -16,6 +17,9 @@ exports.addMessage = function(idFrom, idTo, message, answer){
|
||||||
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
exports.addSignal = function(idFrom, idTo, message, messageType){
|
exports.addSignal = function(idFrom, idTo, message, messageType){
|
||||||
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
||||||
messages.push({from:idFrom, to:idTo, message:message, type:messageType});
|
messages.push({from:idFrom, to:idTo, message:message, type:messageType});
|
||||||
|
@ -36,37 +40,36 @@ exports.getActorKeys = function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.clear = function(){
|
exports.clear = function(){
|
||||||
actors = {};
|
actors = {};
|
||||||
messages = [];
|
messages = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.LINETYPE = {
|
exports.LINETYPE = {
|
||||||
SOLID : 0,
|
SOLID : 0 ,
|
||||||
DOTTED : 1,
|
DOTTED : 1 ,
|
||||||
NOTE : 2,
|
NOTE : 2 ,
|
||||||
SOLID_CROSS : 3,
|
SOLID_CROSS : 3 ,
|
||||||
DOTTED_CROSS: 4,
|
DOTTED_CROSS : 4 ,
|
||||||
SOLID_OPEN : 5,
|
SOLID_OPEN : 5 ,
|
||||||
DOTTED_OPEN : 6,
|
DOTTED_OPEN : 6 ,
|
||||||
LOOP_START : 10,
|
LOOP_START : 10 ,
|
||||||
LOOP_END : 11,
|
LOOP_END : 11 ,
|
||||||
ALT_START : 12,
|
ALT_START : 12 ,
|
||||||
ALT_ELSE : 13,
|
ALT_ELSE : 13 ,
|
||||||
ALT_END : 14,
|
ALT_END : 14 ,
|
||||||
OPT_START : 15,
|
OPT_START : 15 ,
|
||||||
OPT_END : 16
|
OPT_END : 16
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.ARROWTYPE = {
|
exports.ARROWTYPE = {
|
||||||
FILLED : 0,
|
FILLED : 0,
|
||||||
OPEN : 1
|
OPEN : 1
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.PLACEMENT = {
|
exports.PLACEMENT = {
|
||||||
LEFTOF : 0,
|
LEFTOF : 0,
|
||||||
RIGHTOF : 1,
|
RIGHTOF : 1,
|
||||||
OVER : 2
|
OVER : 2
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.addNote = function (actor, placement, message){
|
exports.addNote = function (actor, placement, message){
|
||||||
|
|
|
@ -217,15 +217,15 @@ exports.getTextObj = function(){
|
||||||
|
|
||||||
exports.getNoteRect = function(){
|
exports.getNoteRect = function(){
|
||||||
var rect = {
|
var rect = {
|
||||||
x: 0,
|
x : 0,
|
||||||
y: 0,
|
y : 0,
|
||||||
fill: '#EDF2AE',
|
fill : '#EDF2AE',
|
||||||
stroke: '#666',
|
stroke : '#666',
|
||||||
width: 100,
|
width : 100,
|
||||||
anchor:'start',
|
anchor : 'start',
|
||||||
height: 100,
|
height : 100,
|
||||||
rx: 0,
|
rx : 0,
|
||||||
ry: 0
|
ry : 0
|
||||||
};
|
};
|
||||||
return rect;
|
return rect;
|
||||||
};
|
};
|
||||||
|
|
18
src/main.js
18
src/main.js
|
@ -186,21 +186,22 @@ var equals = function (val, variable){
|
||||||
};
|
};
|
||||||
|
|
||||||
global.mermaid = {
|
global.mermaid = {
|
||||||
startOnLoad:true,
|
startOnLoad: true,
|
||||||
htmlLabels:true,
|
htmlLabels: true,
|
||||||
init:function(sequenceConfig, nodes){
|
|
||||||
|
init: function(sequenceConfig, nodes) {
|
||||||
init.apply(null, arguments);
|
init.apply(null, arguments);
|
||||||
},
|
},
|
||||||
version:function(){
|
version: function() {
|
||||||
return exports.version();
|
return exports.version();
|
||||||
},
|
},
|
||||||
getParser:function(){
|
getParser: function() {
|
||||||
return flow.parser;
|
return flow.parser;
|
||||||
},
|
},
|
||||||
parse:function(text){
|
parse: function(text) {
|
||||||
return parse(text);
|
return parse(text);
|
||||||
},
|
},
|
||||||
parseError:function(err,hash){
|
parseError: function(err, hash) {
|
||||||
console.log('Mermaid Syntax error:');
|
console.log('Mermaid Syntax error:');
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
@ -241,3 +242,6 @@ if(typeof document !== 'undefined'){
|
||||||
exports.contentLoaded();
|
exports.contentLoaded();
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var apa = 1;
|
||||||
|
var bapselsin = 2;
|
||||||
|
|
140
test/gantt.html
140
test/gantt.html
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<script src="../dist/mermaid.full.js"></script>
|
<script src="../dist/mermaid.full.js"></script>
|
||||||
<link rel="stylesheet" href="seq.css"/>
|
<link rel="stylesheet" href="../dist/mermaid.forest.css"/>
|
||||||
<script>
|
<script>
|
||||||
var mermaid_config = {
|
var mermaid_config = {
|
||||||
startOnLoad:true
|
startOnLoad:true
|
||||||
|
@ -44,143 +44,7 @@
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<script>
|
|
||||||
function apa(){
|
|
||||||
console.log('CLICKED');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
background: #fff;
|
|
||||||
font-family: 'Open-Sans',sans-serif;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid .tick {
|
|
||||||
stroke: lightgrey;
|
|
||||||
opacity: 0.3;
|
|
||||||
shape-rendering: crispEdges;
|
|
||||||
}
|
|
||||||
.grid path {
|
|
||||||
stroke-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.taskText {
|
|
||||||
text-anchor:middle;
|
|
||||||
font-size:11px;
|
|
||||||
}
|
|
||||||
.taskText0, .taskText3 {
|
|
||||||
fill:black;
|
|
||||||
}
|
|
||||||
.taskText1, .taskText2 {
|
|
||||||
fill:white;
|
|
||||||
}
|
|
||||||
.taskTextOutsideRight {
|
|
||||||
fill:black;
|
|
||||||
text-anchor:start;
|
|
||||||
font-size:11px;
|
|
||||||
}
|
|
||||||
.taskTextOutsideLeft {
|
|
||||||
fill:black;
|
|
||||||
text-anchor:end;
|
|
||||||
font-size:11px;
|
|
||||||
}
|
|
||||||
.taskTextOutside0,.taskTextOutside2, {
|
|
||||||
fill:black;
|
|
||||||
}
|
|
||||||
.taskTextOutside1, .taskTextOutside3 {
|
|
||||||
fill:darkblue;
|
|
||||||
}
|
|
||||||
.titleText {
|
|
||||||
text-anchor:middle;
|
|
||||||
font-size:18px;
|
|
||||||
fill:#633;
|
|
||||||
}
|
|
||||||
.section {
|
|
||||||
stroke:none;
|
|
||||||
opacity:0.2;
|
|
||||||
}
|
|
||||||
.section0 {
|
|
||||||
fill:#6666FF;
|
|
||||||
}
|
|
||||||
.section1 {
|
|
||||||
fill:white;
|
|
||||||
opacity:0.2;
|
|
||||||
}
|
|
||||||
.section2 {
|
|
||||||
fill:orange;
|
|
||||||
opacity:0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.task {
|
|
||||||
/*stroke:none;*/
|
|
||||||
}
|
|
||||||
.task0 {
|
|
||||||
fill: #ffffdd;
|
|
||||||
}
|
|
||||||
.task1 {
|
|
||||||
fill: #8a90dd;
|
|
||||||
}
|
|
||||||
.task2 {
|
|
||||||
fill: #8a90dd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sectionTitle {
|
|
||||||
text-anchor:start;
|
|
||||||
font-size:11px;
|
|
||||||
text-height:14px;
|
|
||||||
}
|
|
||||||
.sectionTitle0 { fill:#454545;}
|
|
||||||
.sectionTitle1 { fill:#454545;}
|
|
||||||
.sectionTitle2 { fill:#454545;}
|
|
||||||
.sectionTitle3 { fill:#b23473;}
|
|
||||||
.done0, .done1, .done2, .done3 {
|
|
||||||
stroke:grey;
|
|
||||||
fill: lightgrey;
|
|
||||||
stroke-width:2;
|
|
||||||
}
|
|
||||||
.crit0, .crit1, .crit2, .crit3 {
|
|
||||||
stroke:#ff8888;
|
|
||||||
fill: red;
|
|
||||||
stroke-width:2;
|
|
||||||
}
|
|
||||||
.activeCrit0, .activeCrit1, .activeCrit2, .activeCrit3 {
|
|
||||||
stroke:#ff8888;
|
|
||||||
fill: #ffffc0;
|
|
||||||
stroke-width:2;
|
|
||||||
}
|
|
||||||
.doneCrit0, .doneCrit1, .doneCrit2, .doneCrit3 {
|
|
||||||
stroke:#ff8888;
|
|
||||||
fill: lightgrey;
|
|
||||||
stroke-width:2;
|
|
||||||
cursor: pointer;
|
|
||||||
shape-rendering: crispEdges;
|
|
||||||
}
|
|
||||||
.active0 {
|
|
||||||
stroke:black;
|
|
||||||
fill: #ffffdd;
|
|
||||||
stroke-width:2;
|
|
||||||
}
|
|
||||||
.active1 {
|
|
||||||
stroke:black;
|
|
||||||
fill: #8a90dd;
|
|
||||||
stroke-width:2;
|
|
||||||
}
|
|
||||||
.active2 {
|
|
||||||
stroke:black;
|
|
||||||
fill: #8a90dd;
|
|
||||||
stroke-width:2;
|
|
||||||
}
|
|
||||||
.today {
|
|
||||||
fill:none;
|
|
||||||
stroke:red;
|
|
||||||
stroke-width:2px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>scale tests</h1>
|
<h1>scale tests</h1>
|
||||||
|
|
Loading…
Reference in New Issue