Release 0.2.6
* Default shape set to rect when none is set
This commit is contained in:
parent
9a35844731
commit
0c87128902
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mermaid",
|
||||
"version": "0.2.5",
|
||||
"version": "0.2.6",
|
||||
"authors": [
|
||||
"knsv <knut@sveido.com>"
|
||||
],
|
||||
|
|
|
@ -712,7 +712,7 @@ var addVertices = function (vert, g) {
|
|||
style = styleFromStyleArr(style, vertice.styles);
|
||||
|
||||
// Use vertice id as text in the box if no text is provided by the graph definition
|
||||
if (vertice.text === undefined) {
|
||||
if (typeof vertice.text === 'undefined') {
|
||||
verticeText = vertice.id;
|
||||
}
|
||||
else {
|
||||
|
@ -740,8 +740,9 @@ var addVertices = function (vert, g) {
|
|||
case 'circle':
|
||||
_shape = 'circle';
|
||||
break;
|
||||
default:
|
||||
_shape = 'rect';
|
||||
}
|
||||
|
||||
// Add the node
|
||||
g.setNode(vertice.id, {labelType: "html",shape:_shape, label: verticeText, rx: radious, ry: radious, style: style, id:vertice.id});
|
||||
});
|
||||
|
@ -958,12 +959,14 @@ var init = function () {
|
|||
|
||||
};
|
||||
|
||||
exports.tester = function(){};
|
||||
|
||||
/**
|
||||
* Version management
|
||||
* @returns {string}
|
||||
*/
|
||||
exports.version = function(){
|
||||
return '0.2.5';
|
||||
return '0.2.6';
|
||||
};
|
||||
|
||||
var equals = function (val, variable){
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -680,7 +680,7 @@ var addVertices = function (vert, g) {
|
|||
style = styleFromStyleArr(style, vertice.styles);
|
||||
|
||||
// Use vertice id as text in the box if no text is provided by the graph definition
|
||||
if (vertice.text === undefined) {
|
||||
if (typeof vertice.text === 'undefined') {
|
||||
verticeText = vertice.id;
|
||||
}
|
||||
else {
|
||||
|
@ -708,8 +708,9 @@ var addVertices = function (vert, g) {
|
|||
case 'circle':
|
||||
_shape = 'circle';
|
||||
break;
|
||||
default:
|
||||
_shape = 'rect';
|
||||
}
|
||||
|
||||
// Add the node
|
||||
g.setNode(vertice.id, {labelType: "html",shape:_shape, label: verticeText, rx: radious, ry: radious, style: style, id:vertice.id});
|
||||
});
|
||||
|
@ -926,12 +927,14 @@ var init = function () {
|
|||
|
||||
};
|
||||
|
||||
exports.tester = function(){};
|
||||
|
||||
/**
|
||||
* Version management
|
||||
* @returns {string}
|
||||
*/
|
||||
exports.version = function(){
|
||||
return '0.2.5';
|
||||
return '0.2.6';
|
||||
};
|
||||
|
||||
var equals = function (val, variable){
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -50,7 +50,7 @@ var addVertices = function (vert, g) {
|
|||
style = styleFromStyleArr(style, vertice.styles);
|
||||
|
||||
// Use vertice id as text in the box if no text is provided by the graph definition
|
||||
if (vertice.text === undefined) {
|
||||
if (typeof vertice.text === 'undefined') {
|
||||
verticeText = vertice.id;
|
||||
}
|
||||
else {
|
||||
|
@ -78,8 +78,9 @@ var addVertices = function (vert, g) {
|
|||
case 'circle':
|
||||
_shape = 'circle';
|
||||
break;
|
||||
default:
|
||||
_shape = 'rect';
|
||||
}
|
||||
|
||||
// Add the node
|
||||
g.setNode(vertice.id, {labelType: "html",shape:_shape, label: verticeText, rx: radious, ry: radious, style: style, id:vertice.id});
|
||||
});
|
||||
|
@ -296,12 +297,14 @@ var init = function () {
|
|||
|
||||
};
|
||||
|
||||
exports.tester = function(){};
|
||||
|
||||
/**
|
||||
* Version management
|
||||
* @returns {string}
|
||||
*/
|
||||
exports.version = function(){
|
||||
return '0.2.5';
|
||||
return '0.2.6';
|
||||
};
|
||||
|
||||
var equals = function (val, variable){
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
var rewire = require("rewire");
|
||||
var utils = require("./utils");
|
||||
|
||||
describe('when using main and ',function() {
|
||||
describe('when detecting chart type ',function() {
|
||||
var main;
|
||||
beforeEach(function () {
|
||||
|
@ -22,7 +23,7 @@ describe('when detecting chart type ',function() {
|
|||
div = document.createElement('div');
|
||||
mermaid_config ={startOnLoad : false};
|
||||
main = rewire('./main');
|
||||
expect(main.version()).toBe('0.2.5');
|
||||
expect(main.version()).toBe('0.2.6');
|
||||
});
|
||||
it('should not call start anything with an empty document', function () {
|
||||
|
||||
|
@ -41,4 +42,27 @@ describe('when detecting chart type ',function() {
|
|||
mermaid.init();
|
||||
expect(utils.detectType).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
xdescribe('when calling addEdges ',function() {
|
||||
var main;
|
||||
beforeEach(function () {
|
||||
main = rewire('./main');
|
||||
});
|
||||
it('should have a version', function () {
|
||||
var edge = {start: 'start', end: 'end', type: 'arrow', text: 'test text'};
|
||||
var edges = [edge];
|
||||
var mockG = {
|
||||
setEdge:function(start, end,options,name){}
|
||||
};
|
||||
spyOn(mockG,'setEdge');
|
||||
main.__set__('exports.apa',function(a,b){
|
||||
addEdges(a,b);
|
||||
});
|
||||
main.apa(edges,mockG);
|
||||
expect(mockG.setEdge).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
|
@ -34,19 +34,19 @@
|
|||
E-->I[Ingvild];
|
||||
click A apa;
|
||||
</div>
|
||||
<div class="mermaid">
|
||||
<div class="mermaid2">
|
||||
graph TD;
|
||||
id1>This is the text in the box];
|
||||
</div>
|
||||
<h1>Shapes</h1>
|
||||
<div class="mermaidw">
|
||||
<div class="mermaid">
|
||||
graph TD;
|
||||
sq[Square shape]-->ci((Circle shape));
|
||||
od>Odd shape]---|Two line<br>edge comment|ro;
|
||||
od2>Really long text in an Odd shape]-->od3>Really long text with linebreak<br>in an Odd shape];
|
||||
di{Diamond is <br/> broken}-->ro(Rounded<br>square<br>shape);
|
||||
di-->ro2(Rounded square shape);
|
||||
e((Inner circle));
|
||||
e((Inner circle))-->f;
|
||||
style e red;
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue