mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-03 04:14:15 +01:00
Added logger for dealing with issue #179
Added markdown files for the documentation. parseError exposed from the mermaidAPI
This commit is contained in:
@@ -7,7 +7,7 @@ describe('when parsing an info graph it',function() {
|
||||
ex = require('./parser/example').parser;
|
||||
ex.yy = require('./exampleDb');
|
||||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
log.debug('Syntax error:' + err);
|
||||
};
|
||||
//ex.yy.parseError = parseError;
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Created by knut on 15-01-14.
|
||||
*/
|
||||
|
||||
var log = require('../../logger').create();
|
||||
var message = '';
|
||||
var info = false;
|
||||
|
||||
@@ -22,5 +22,5 @@ exports.getInfo = function(){
|
||||
};
|
||||
|
||||
exports.parseError = function(err,hash){
|
||||
mermaid.parseError(err,hash);
|
||||
mermaidAPI.parseError(err,hash);
|
||||
};
|
||||
@@ -4,7 +4,7 @@
|
||||
var db = require('./exampleDb');
|
||||
var exampleParser = require('./parser/example.js');
|
||||
var d3 = require('../../d3');
|
||||
|
||||
var log = require('../../logger').create();
|
||||
/**
|
||||
* Draws a an info picture in the tag with id: id based on the graph definition in text.
|
||||
* @param text
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* global window */
|
||||
|
||||
var log = require('../../logger').create();
|
||||
var dagreD3;
|
||||
//console.log('setting up dagre-d3');
|
||||
//log.debug('setting up dagre-d3');
|
||||
if (require) {
|
||||
try {
|
||||
dagreD3 = require("dagre-d3");
|
||||
//console.log('Got it (dagre-d3)');
|
||||
} catch (e) {console.log('Could not load dagre-d3');}
|
||||
//log.debug('Got it (dagre-d3)');
|
||||
} catch (e) {log.debug('Could not load dagre-d3');}
|
||||
}
|
||||
|
||||
if (!dagreD3) {
|
||||
|
||||
@@ -6,6 +6,8 @@ var flow = require('./parser/flow');
|
||||
var dot = require('./parser/dot');
|
||||
var d3 = require('../../d3');
|
||||
var dagreD3 = require('./dagre-d3');
|
||||
var log = require('../../logger').create();
|
||||
|
||||
var conf = {
|
||||
};
|
||||
module.exports.setConf = function(cnf){
|
||||
@@ -49,7 +51,7 @@ exports.addVertices = function (vert, g) {
|
||||
*/
|
||||
var classStr = '';
|
||||
|
||||
//console.log(vertice.classes);
|
||||
//log.debug(vertice.classes);
|
||||
|
||||
if(vertice.classes.length >0){
|
||||
classStr = vertice.classes.join(" ");
|
||||
@@ -230,7 +232,7 @@ exports.getClasses = function (text, isDot) {
|
||||
* @param id
|
||||
*/
|
||||
exports.draw = function (text, id,isDot) {
|
||||
|
||||
log.debug('Drawing flowchart');
|
||||
var parser;
|
||||
graph.clear();
|
||||
if(isDot){
|
||||
@@ -283,7 +285,7 @@ exports.draw = function (text, id,isDot) {
|
||||
// Fetch the verices/nodes and edges/links from the parsed graph definition
|
||||
var vert = graph.getVertices();
|
||||
|
||||
//console.log(vert);
|
||||
//log.debug(vert);
|
||||
var edges = graph.getEdges();
|
||||
|
||||
i = 0;
|
||||
@@ -294,7 +296,7 @@ exports.draw = function (text, id,isDot) {
|
||||
d3.selectAll('cluster').append('text');
|
||||
|
||||
for(j=0;j<subG.nodes.length;j++){
|
||||
//console.log('Setting node',subG.nodes[j],' to subgraph '+id);
|
||||
//log.debug('Setting node',subG.nodes[j],' to subgraph '+id);
|
||||
g.setParent(subG.nodes[j],subG.id);
|
||||
}
|
||||
}
|
||||
@@ -438,7 +440,7 @@ exports.draw = function (text, id,isDot) {
|
||||
|
||||
if (subG.title !== 'undefined') {
|
||||
var clusterRects = document.querySelectorAll('#' + id + ' #' + subG.id + ' rect');
|
||||
//console.log('looking up: #' + id + ' #' + subG.id)
|
||||
//log.debug('looking up: #' + id + ' #' + subG.id)
|
||||
var clusterEl = document.querySelectorAll('#' + id + ' #' + subG.id);
|
||||
|
||||
var xPos = clusterRects[0].x.baseVal.value;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Created by knut on 14-11-03.
|
||||
*/
|
||||
|
||||
var log = require('../../logger').create();
|
||||
var vertices = {};
|
||||
var edges = [];
|
||||
var classes = [];
|
||||
@@ -63,7 +63,7 @@ exports.addVertex = function (id, text, type, style) {
|
||||
* @param linktext
|
||||
*/
|
||||
exports.addLink = function (start, end, type, linktext) {
|
||||
//console.log('Got edge', start, end);
|
||||
//log.debug('Got edge', start, end);
|
||||
var edge = {start: start, end: end, type: undefined, text: ''};
|
||||
linktext = type.text;
|
||||
|
||||
@@ -158,7 +158,7 @@ exports.setClickEvent = function (id,functionName) {
|
||||
}
|
||||
});
|
||||
}else{
|
||||
//console.log('Checking now for ::'+id);
|
||||
//log.debug('Checking now for ::'+id);
|
||||
if(typeof vertices[id] !== 'undefined'){
|
||||
funs.push(function(){
|
||||
var elem = document.getElementById(id);
|
||||
@@ -166,7 +166,7 @@ exports.setClickEvent = function (id,functionName) {
|
||||
elem.onclick = function(){eval(functionName+'(\'' + id + '\')');}; // jshint ignore:line
|
||||
}
|
||||
else{
|
||||
//console.log('id was null: '+id);
|
||||
//log.debug('id was null: '+id);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -251,8 +251,8 @@ exports.addSubGraph = function (list, title) {
|
||||
|
||||
|
||||
var subGraph = {id:'subGraph'+subCount, nodes:nodeList,title:title};
|
||||
//console.log('subGraph:' + subGraph.title + subGraph.id);
|
||||
//console.log(subGraph.nodes);
|
||||
//log.debug('subGraph:' + subGraph.title + subGraph.id);
|
||||
//log.debug(subGraph.nodes);
|
||||
subGraphs.push(subGraph);
|
||||
subCount = subCount + 1;
|
||||
return subGraph.id;
|
||||
@@ -262,11 +262,11 @@ var getPosForId = function(id){
|
||||
var i;
|
||||
for(i=0;i<subGraphs.length;i++){
|
||||
if(subGraphs[i].id===id){
|
||||
//console.log('Found pos for ',id,' ',i);
|
||||
//log.debug('Found pos for ',id,' ',i);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
//console.log('No pos found for ',id,' ',i);
|
||||
//log.debug('No pos found for ',id,' ',i);
|
||||
return -1;
|
||||
};
|
||||
var secCount = -1;
|
||||
@@ -332,5 +332,5 @@ exports.getSubGraphs = function (list) {
|
||||
};
|
||||
|
||||
exports.parseError = function(err,hash){
|
||||
mermaid.parseError(err,hash);
|
||||
mermaidAPI.parseError(err,hash);
|
||||
};
|
||||
@@ -10,7 +10,7 @@ describe('when parsing ',function(){
|
||||
flow.parser.yy = require('../graphDb');
|
||||
flow.parser.yy.clear();
|
||||
/*flow.parser.parse.parseError= function parseError(str, hash) {
|
||||
console.logconsole.log(str);
|
||||
log.debugconsole.log(str);
|
||||
}*/
|
||||
});
|
||||
|
||||
@@ -1054,7 +1054,7 @@ describe('when parsing ',function(){
|
||||
expect(edges.length).toBe(0);
|
||||
expect(vert['i-d'].styles.length).toBe(0);
|
||||
});
|
||||
//console.log(flow.parser.parse('graph TD;style Q background:#fff;'));
|
||||
//log.debug(flow.parser.parse('graph TD;style Q background:#fff;'));
|
||||
it('should handle styles for vertices',function(){
|
||||
var res = flow.parser.parse('graph TD;style Q background:#fff;');
|
||||
|
||||
@@ -1067,7 +1067,7 @@ describe('when parsing ',function(){
|
||||
expect(vert['Q'].styles[0]).toBe('background:#fff');
|
||||
});
|
||||
|
||||
//console.log(flow.parser.parse('graph TD;style Q background:#fff;'));
|
||||
//log.debug(flow.parser.parse('graph TD;style Q background:#fff;'));
|
||||
it('should handle styles for edges',function(){
|
||||
var res = flow.parser.parse('graph TD;a-->b;\nstyle #0 stroke: #f66;');
|
||||
|
||||
|
||||
15
src/diagrams/gantt/d3.js
vendored
15
src/diagrams/gantt/d3.js
vendored
@@ -1,15 +0,0 @@
|
||||
/* global window */
|
||||
|
||||
/*var d3;
|
||||
|
||||
if (require) {
|
||||
try {
|
||||
d3 = require("d3");
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (!d3) {
|
||||
d3 = window.d3;
|
||||
}
|
||||
|
||||
module.exports = d3;*/
|
||||
@@ -7,7 +7,7 @@ describe('when parsing a gantt diagram it',function() {
|
||||
gantt = require('./parser/gantt').parser;
|
||||
gantt.yy = require('./ganttDb');
|
||||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
log.debug('Syntax error:' + err);
|
||||
};
|
||||
//ex.yy.parseError = parseError;
|
||||
});
|
||||
@@ -32,6 +32,17 @@ describe('when parsing a gantt diagram it',function() {
|
||||
|
||||
gantt.parse(str);
|
||||
});
|
||||
/**
|
||||
* Beslutsflöde inligt nedan. Obs bla bla bla
|
||||
* ```
|
||||
* graph TD
|
||||
* A[Hard pledge] -- text on link -->B(Round edge)
|
||||
* B --> C{to do or not to do}
|
||||
* C -->|Too| D[Result one]
|
||||
* C -->|Doo| E[Result two]
|
||||
```
|
||||
* params bapa - a unique bapap
|
||||
*/
|
||||
it('should handle a task definition', function () {
|
||||
var str = 'gantt\n' +
|
||||
'dateFormat yyyy-mm-dd\n' +
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Created by knut on 15-01-14.
|
||||
*/
|
||||
var moment = require('moment');
|
||||
var log = require('../../logger').create();
|
||||
|
||||
var dateFormat = '';
|
||||
var title = '';
|
||||
@@ -59,8 +60,8 @@ exports.getTasks=function(){
|
||||
|
||||
|
||||
var getStartDate = function(prevTime, dateFormat, str){
|
||||
//console.log('Deciding start date:'+str);
|
||||
//console.log('with dateformat:'+dateFormat);
|
||||
//log.debug('Deciding start date:'+str);
|
||||
//log.debug('with dateformat:'+dateFormat);
|
||||
|
||||
str = str.trim();
|
||||
|
||||
@@ -81,9 +82,9 @@ var getStartDate = function(prevTime, dateFormat, str){
|
||||
if(moment(str,dateFormat.trim(),true).isValid()){
|
||||
return moment(str,dateFormat.trim(),true).toDate();
|
||||
}else{
|
||||
console.log('Invalid date:'+str);
|
||||
console.log('With date format:'+dateFormat.trim());
|
||||
//console.log('----');
|
||||
log.debug('Invalid date:'+str);
|
||||
log.debug('With date format:'+dateFormat.trim());
|
||||
//log.debug('----');
|
||||
}
|
||||
|
||||
// Default date - now
|
||||
@@ -230,5 +231,5 @@ exports.addTask = function(descr,data){
|
||||
};
|
||||
|
||||
exports.parseError = function(err,hash){
|
||||
mermaid.parseError(err,hash);
|
||||
mermaidAPI.parseError(err,hash);
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* Created by knut on 14-11-18.
|
||||
*/
|
||||
var log = require('../../logger').create();
|
||||
describe('when using the ganttDb',function() {
|
||||
var parseError, gantt;
|
||||
var moment = require('moment');
|
||||
@@ -11,7 +12,7 @@ describe('when using the ganttDb',function() {
|
||||
gDb = require('./ganttDb');
|
||||
gDb.clear();
|
||||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
log.debug('Syntax error:' + err);
|
||||
};
|
||||
//ex.yy.parseError = parseError;
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ var gantt = require('./parser/gantt').parser;
|
||||
gantt.yy = require('./ganttDb');
|
||||
var d3 = require('../../d3');
|
||||
var moment = require('moment');
|
||||
|
||||
var log = require('../../logger').create();
|
||||
|
||||
var daysInChart;
|
||||
var conf = {
|
||||
@@ -365,7 +365,7 @@ module.exports.draw = function (text, id) {
|
||||
if (i > 0) {
|
||||
for (var j = 0; j < i; j++) {
|
||||
prevGap += numOccurances[i - 1][1];
|
||||
// console.log(prevGap);
|
||||
// log.debug(prevGap);
|
||||
return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -5,15 +5,15 @@ var actors = {};
|
||||
var actorKeys = [];
|
||||
var messages = [];
|
||||
var notes = [];
|
||||
var log = require('../../logger').create();
|
||||
|
||||
|
||||
exports.addActor = function(id,name,description){
|
||||
//console.log('Adding actor: '+id);
|
||||
actors[id] = {name:name, description:description};
|
||||
actorKeys.push(id);
|
||||
};
|
||||
|
||||
exports.addMessage = function(idFrom, idTo, message, answer){
|
||||
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
||||
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ exports.addMessage = function(idFrom, idTo, message, answer){
|
||||
*
|
||||
*/
|
||||
exports.addSignal = function(idFrom, idTo, message, messageType){
|
||||
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
||||
log.debug('Adding message from='+idFrom+' to='+idTo+' message='+message+' type='+messageType);
|
||||
messages.push({from:idFrom, to:idTo, message:message, type:messageType});
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ exports.addNote = function (actor, placement, message){
|
||||
|
||||
|
||||
exports.parseError = function(err,hash){
|
||||
mermaid.parseError(err,hash);
|
||||
mermaidAPI.parseError(err,hash);
|
||||
};
|
||||
|
||||
exports.apply = function(param){
|
||||
@@ -90,7 +90,7 @@ exports.apply = function(param){
|
||||
exports.apply(item);
|
||||
});
|
||||
} else {
|
||||
// console.log(param);
|
||||
// log.debug(param);
|
||||
switch(param.type){
|
||||
case 'addActor':
|
||||
exports.addActor(param.actor, param.actor, param.actor);
|
||||
@@ -102,7 +102,7 @@ exports.apply = function(param){
|
||||
exports.addSignal(param.from, param.to, param.msg, param.signalType);
|
||||
break;
|
||||
case 'loopStart':
|
||||
//console.log('Loop text: ',param.loopText);
|
||||
//log.debug('Loop text: ',param.loopText);
|
||||
exports.addSignal(undefined, undefined, param.loopText, param.signalType);
|
||||
//yy.addSignal(undefined, undefined, $2, yy.LINETYPE.LOOP_START);
|
||||
break;
|
||||
@@ -110,7 +110,7 @@ exports.apply = function(param){
|
||||
exports.addSignal(undefined, undefined, undefined, param.signalType);
|
||||
break;
|
||||
case 'optStart':
|
||||
//console.log('Loop text: ',param.loopText);
|
||||
//log.debug('Loop text: ',param.loopText);
|
||||
exports.addSignal(undefined, undefined, param.optText, param.signalType);
|
||||
//yy.addSignal(undefined, undefined, $2, yy.LINETYPE.LOOP_START);
|
||||
break;
|
||||
@@ -118,7 +118,7 @@ exports.apply = function(param){
|
||||
exports.addSignal(undefined, undefined, undefined, param.signalType);
|
||||
break;
|
||||
case 'altStart':
|
||||
//console.log('Loop text: ',param.loopText);
|
||||
//log.debug('Loop text: ',param.loopText);
|
||||
exports.addSignal(undefined, undefined, param.altText, param.signalType);
|
||||
//yy.addSignal(undefined, undefined, $2, yy.LINETYPE.LOOP_START);
|
||||
break;
|
||||
@@ -129,7 +129,5 @@ exports.apply = function(param){
|
||||
exports.addSignal(undefined, undefined, undefined, param.signalType);
|
||||
break;
|
||||
}
|
||||
|
||||
// console.log('xxx',param);
|
||||
}
|
||||
};
|
||||
@@ -2,7 +2,7 @@
|
||||
* Created by knut on 14-11-18.
|
||||
*/
|
||||
var proxyquire = require('proxyquire');
|
||||
|
||||
var log = require('../../logger').create();
|
||||
|
||||
var sq = require('./parser/sequenceDiagram').parser;
|
||||
var newD3;
|
||||
@@ -22,8 +22,8 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
sq.yy = require('./sequenceDb');
|
||||
sq.yy.clear();
|
||||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
console.log(hash);
|
||||
log.debug('Syntax error:' + err);
|
||||
log.debug(hash);
|
||||
};
|
||||
sq.yy.parseError = parseError;
|
||||
});
|
||||
@@ -69,7 +69,7 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
|
||||
sq.parse(str);
|
||||
var actors = sq.yy.getActors();
|
||||
//console.log(actors);
|
||||
//log.debug(actors);
|
||||
expect(actors.Alice.description).toBe('Alice');
|
||||
expect(actors.Bob.description).toBe('Bob');
|
||||
|
||||
@@ -86,7 +86,7 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
|
||||
sq.parse(str);
|
||||
var actors = sq.yy.getActors();
|
||||
//console.log(actors);
|
||||
//log.debug(actors);
|
||||
expect(actors.Alice.description).toBe('Alice');
|
||||
expect(actors.Bob.description).toBe('Bob');
|
||||
|
||||
@@ -107,7 +107,7 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
expect(actors.Bob.description).toBe('Bob');
|
||||
|
||||
var messages = sq.yy.getMessages();
|
||||
//console.log(messages);
|
||||
//log.debug(messages);
|
||||
|
||||
|
||||
expect(messages.length).toBe(1);
|
||||
@@ -124,7 +124,7 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
expect(actors.Bob.description).toBe('Bob');
|
||||
|
||||
var messages = sq.yy.getMessages();
|
||||
//console.log(messages);
|
||||
//log.debug(messages);
|
||||
|
||||
|
||||
expect(messages.length).toBe(1);
|
||||
@@ -246,12 +246,12 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
|
||||
sq.parse(str);
|
||||
var actors = sq.yy.getActors();
|
||||
//console.log(actors);
|
||||
//log.debug(actors);
|
||||
expect(actors.Alice.description).toBe('Alice');
|
||||
actors.Bob.description = 'Bob';
|
||||
|
||||
var messages = sq.yy.getMessages();
|
||||
//console.log(messages);
|
||||
//log.debug(messages);
|
||||
|
||||
expect(messages.length).toBe(5);
|
||||
expect(messages[0].from).toBe('Alice');
|
||||
@@ -271,12 +271,12 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
|
||||
sq.parse(str);
|
||||
var actors = sq.yy.getActors();
|
||||
//console.log(actors);
|
||||
//log.debug(actors);
|
||||
expect(actors.Alice.description).toBe('Alice');
|
||||
actors.Bob.description = 'Bob';
|
||||
|
||||
var messages = sq.yy.getMessages();
|
||||
//console.log(messages);
|
||||
//log.debug(messages);
|
||||
|
||||
expect(messages.length).toBe(5);
|
||||
expect(messages[0].from).toBe('Alice');
|
||||
@@ -289,12 +289,12 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
|
||||
sq.parse(str);
|
||||
var actors = sq.yy.getActors();
|
||||
//console.log(actors);
|
||||
//log.debug(actors);
|
||||
expect(actors.Alice.description).toBe('Alice');
|
||||
actors.Bob.description = 'Bob';
|
||||
|
||||
var messages = sq.yy.getMessages();
|
||||
//console.log(messages);
|
||||
//log.debug(messages);
|
||||
|
||||
expect(messages.length).toBe(4);
|
||||
expect(messages[0].from).toBe('Alice');
|
||||
@@ -322,7 +322,7 @@ describe('when parsing a sequenceDiagram',function() {
|
||||
actors.Bob.description = 'Bob';
|
||||
|
||||
var messages = sq.yy.getMessages();
|
||||
//console.log(messages);
|
||||
//log.debug(messages);
|
||||
|
||||
expect(messages.length).toBe(7);
|
||||
expect(messages[0].from).toBe('Alice');
|
||||
@@ -337,8 +337,8 @@ describe('when checking the bounds in a sequenceDiagram',function() {
|
||||
sq.yy = require('./sequenceDb');
|
||||
sq.yy.clear();
|
||||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
console.log(hash);
|
||||
log.debug('Syntax error:' + err);
|
||||
log.debug(hash);
|
||||
};
|
||||
sq.yy.parseError = parseError;
|
||||
|
||||
@@ -487,8 +487,8 @@ describe('when rendering a sequenceDiagram',function() {
|
||||
sq.yy = require('./sequenceDb');
|
||||
sq.yy.clear();
|
||||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
console.log(hash);
|
||||
log.debug('Syntax error:' + err);
|
||||
log.debug(hash);
|
||||
};
|
||||
sq.yy.parseError = parseError;
|
||||
|
||||
@@ -682,8 +682,8 @@ describe('when rendering a sequenceDiagram with actor mirror activated',function
|
||||
sq.yy = require('./sequenceDb');
|
||||
sq.yy.clear();
|
||||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
console.log(hash);
|
||||
log.debug('Syntax error:' + err);
|
||||
log.debug(hash);
|
||||
};
|
||||
sq.yy.parseError = parseError;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ var sq = require('./parser/sequenceDiagram').parser;
|
||||
sq.yy = require('./sequenceDb');
|
||||
var svgDraw = require('./svgDraw');
|
||||
var d3 = require('../../d3');
|
||||
var log = require('../../logger').create();
|
||||
|
||||
var conf = {
|
||||
|
||||
diagramMarginX:50,
|
||||
@@ -380,7 +382,7 @@ module.exports.draw = function (text, id) {
|
||||
if(conf.useMaxWidth) {
|
||||
diagram.attr("height", '100%');
|
||||
diagram.attr("width", '100%');
|
||||
diagram.attr('style', 'max-width:' + (width) + 'px;')
|
||||
diagram.attr('style', 'max-width:' + (width) + 'px;');
|
||||
}else{
|
||||
diagram.attr("height",height);
|
||||
diagram.attr("width", width );
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* Created by knut on 14-12-20.
|
||||
*/
|
||||
var log = require('../../logger').create();
|
||||
exports.drawRect = function(elem , rectData){
|
||||
var rectElem = elem.append("rect");
|
||||
rectElem.attr("x", rectData.x);
|
||||
|
||||
Reference in New Issue
Block a user