mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Merge branch 'master' of https://github.com/knsv/mermaid
Conflicts: dist/mermaid.full.js dist/mermaid.full.min.js dist/mermaid.slim.js dist/mermaid.slim.min.js
This commit is contained in:
commit
ee6ad01209
10662
dist/mermaid.full.js
vendored
10662
dist/mermaid.full.js
vendored
File diff suppressed because one or more lines are too long
28
dist/mermaid.full.min.js
vendored
28
dist/mermaid.full.min.js
vendored
File diff suppressed because one or more lines are too long
9491
dist/mermaid.slim.js
vendored
9491
dist/mermaid.slim.js
vendored
File diff suppressed because it is too large
Load Diff
18
dist/mermaid.slim.min.js
vendored
18
dist/mermaid.slim.min.js
vendored
File diff suppressed because one or more lines are too long
@ -17,6 +17,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chalk": "^0.5.1",
|
||||
"d3": "~3.4.13",
|
||||
"dagre-d3": "~0.3.2",
|
||||
"he": "^0.5.0",
|
||||
"minimist": "^1.1.0",
|
||||
@ -71,6 +72,7 @@
|
||||
"mock-browser": "^0.90.27",
|
||||
"path": "^0.4.9",
|
||||
"phantomjs": "^1.9.12",
|
||||
"proxyquire": "^1.3.1",
|
||||
"rewire": "^2.1.3",
|
||||
"rimraf": "^2.2.8",
|
||||
"semantic-ui": "^1.4.1",
|
||||
|
15
src/diagrams/sequenceDiagram/d3.js
vendored
Normal file
15
src/diagrams/sequenceDiagram/d3.js
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/* global window */
|
||||
|
||||
var d3;
|
||||
|
||||
if (require) {
|
||||
try {
|
||||
d3 = require("d3");
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (!d3) {
|
||||
d3 = window.d3;
|
||||
}
|
||||
|
||||
module.exports = d3;
|
@ -1,8 +1,16 @@
|
||||
/**
|
||||
* Created by knut on 14-11-18.
|
||||
*/
|
||||
var proxyquire = require('proxyquire');
|
||||
|
||||
var newD3;
|
||||
var d3 = {
|
||||
select:function(){
|
||||
return new newD3();
|
||||
}
|
||||
};
|
||||
var sq = require('./parser/sequenceDiagram').parser;
|
||||
var sd = require('./sequenceRenderer');
|
||||
var sd = proxyquire('./sequenceRenderer', { './d3': d3 });
|
||||
|
||||
var str;
|
||||
describe('when parsing a sequenceDiagram',function() {
|
||||
@ -480,7 +488,7 @@ describe('when rendering a sequenceDiagram',function() {
|
||||
};
|
||||
sq.yy.parseError = parseError;
|
||||
|
||||
function newD3() {
|
||||
newD3 = function() {
|
||||
var o = {
|
||||
append: function (type) {
|
||||
return newD3();
|
||||
@ -508,16 +516,8 @@ describe('when rendering a sequenceDiagram',function() {
|
||||
};
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
var _d3 = {
|
||||
select:function(){
|
||||
return new newD3();
|
||||
}
|
||||
};
|
||||
|
||||
d3 = _d3;
|
||||
|
||||
conf = {
|
||||
diagramMarginX:50,
|
||||
diagramMarginY:10,
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* globals d3 */
|
||||
/**
|
||||
* Created by knut on 14-11-23.
|
||||
*/
|
||||
@ -6,6 +5,7 @@
|
||||
var sq = require('./parser/sequenceDiagram').parser;
|
||||
sq.yy = require('./sequenceDb');
|
||||
var svgDraw = require('./svgDraw');
|
||||
var d3 = require('./d3');
|
||||
var conf = {
|
||||
|
||||
diagramMarginX:50,
|
||||
|
Loading…
x
Reference in New Issue
Block a user