mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
Fix for merge error
This commit is contained in:
67
dist/mermaidAPI.js
vendored
67
dist/mermaidAPI.js
vendored
@@ -47965,7 +47965,7 @@ module.exports={
|
||||
"dist-slim-mermaid": "node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js",
|
||||
"dist-slim-mermaidAPI": "node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js",
|
||||
"dist-mermaid": "node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js",
|
||||
"dist-mermaid-nomin": "node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && node bin/mermaid -v -s testgitgraph.mm && testgitgraph.mm.svg",
|
||||
"dist-mermaid-nomin": "node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js",
|
||||
"dist-mermaidAPI": "node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",
|
||||
"dist": "npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"
|
||||
},
|
||||
@@ -48069,7 +48069,7 @@ module.exports={
|
||||
|
||||
var d3;
|
||||
|
||||
if (require) {
|
||||
if (typeof require !== 'undefined') {
|
||||
try {
|
||||
d3 = require('d3');
|
||||
} catch (e) {
|
||||
@@ -50975,6 +50975,7 @@ exports.draw = function (text, id, isDot) {
|
||||
|
||||
var Logger = require('../../logger');
|
||||
var log = new Logger.Log();
|
||||
var utils = require('../../utils');
|
||||
|
||||
var d3 = require('../../d3');
|
||||
var vertices = {};
|
||||
@@ -51081,6 +51082,9 @@ exports.updateLink = function (pos, style) {
|
||||
if (pos === 'default') {
|
||||
edges.defaultStyle = style;
|
||||
} else {
|
||||
if (utils.isSubstringInArray('fill', style) === -1) {
|
||||
style.push('fill:none');
|
||||
}
|
||||
edges[pos].style = style;
|
||||
}
|
||||
};
|
||||
@@ -51369,7 +51373,7 @@ exports.parseError = function (err, hash) {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../../d3":108,"../../logger":130}],118:[function(require,module,exports){
|
||||
},{"../../d3":108,"../../logger":130,"../../utils":132}],118:[function(require,module,exports){
|
||||
(function (process){
|
||||
/* parser generated by jison 0.4.17 */
|
||||
/*
|
||||
@@ -57011,8 +57015,8 @@ var conf = {
|
||||
// width of activation box
|
||||
activationWidth: 10,
|
||||
|
||||
//text placement as: tspan | fo | <else> only text as before
|
||||
textPlacement: 'fo'
|
||||
//text placement as: tspan | fo | old only text as before
|
||||
textPlacement: 'tspan'
|
||||
};
|
||||
|
||||
exports.bounds = {
|
||||
@@ -57691,14 +57695,12 @@ exports.getNoteRect = function () {
|
||||
var _drawTextCandidateFunc = (function () {
|
||||
function byText(content, g, x, y, width, height, textAttrs) {
|
||||
var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content);
|
||||
for (var key in textAttrs) {
|
||||
text.attr(key, textAttrs[key]);
|
||||
}
|
||||
};
|
||||
_setTextAttrs(text, textAttrs);
|
||||
}
|
||||
|
||||
function byTspan(content, g, x, y, width, height, textAttrs) {
|
||||
var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle');
|
||||
var tspan = text.append('tspan').attr('x', x + width / 2).attr('dy', '0').text(content);
|
||||
text.append('tspan').attr('x', x + width / 2).attr('dy', '0').text(content);
|
||||
|
||||
if (typeof text.textwrap !== 'undefined') {
|
||||
text.textwrap({ //d3textwrap
|
||||
@@ -57709,14 +57711,11 @@ var _drawTextCandidateFunc = (function () {
|
||||
if (tspans.length > 0 && tspans[0].length > 0) {
|
||||
tspans = tspans[0];
|
||||
//set y of <text> to the mid y of the first line
|
||||
text.attr('y', y + (height / 2. - text[0][0].getBBox().height * (1 - 1.0 / tspans.length) / 2.)).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
|
||||
text.attr('y', y + (height / 2.0 - text[0][0].getBBox().height * (1 - 1.0 / tspans.length) / 2.0)).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in textAttrs) {
|
||||
text.attr(key, textAttrs[key]);
|
||||
}
|
||||
};
|
||||
_setTextAttrs(text, textAttrs);
|
||||
}
|
||||
|
||||
function byFo(content, g, x, y, width, height, textAttrs) {
|
||||
var s = g.append('switch');
|
||||
@@ -57727,14 +57726,19 @@ var _drawTextCandidateFunc = (function () {
|
||||
text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
|
||||
|
||||
byTspan(content, s, x, y, width, height, textAttrs);
|
||||
_setTextAttrs(text, textAttrs);
|
||||
}
|
||||
|
||||
for (var key in textAttrs) {
|
||||
text.attr(key, textAttrs[key]);
|
||||
function _setTextAttrs(toText, fromTextAttrsDict) {
|
||||
for (var key in fromTextAttrsDict) {
|
||||
if (fromTextAttrsDict.hasOwnProperty(key)) {
|
||||
toText.attr(key, fromTextAttrsDict[key]);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return function (conf) {
|
||||
return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'tspan' ? byTspan : byText;
|
||||
return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -57820,10 +57824,7 @@ function Log(level) {
|
||||
args.unshift('[' + formatTime(new Date()) + '] ');
|
||||
console.log.apply(console, args.map(function (a) {
|
||||
if (typeof a === "object") {
|
||||
if (a.stack !== undefined) {
|
||||
return a.stack;
|
||||
}
|
||||
return JSON.stringify(a, null, 2);
|
||||
return a.toString() + JSON.stringify(a, null, 2);
|
||||
}
|
||||
return a;
|
||||
}));
|
||||
@@ -58519,7 +58520,7 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) {
|
||||
}
|
||||
} else {
|
||||
if (classes[className].styles instanceof Array) {
|
||||
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
||||
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>circle, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58547,5 +58548,21 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) {
|
||||
|
||||
exports.cloneCssStyles = cloneCssStyles;
|
||||
|
||||
/**
|
||||
* @function isSubstringInArray
|
||||
* Detects whether a substring in present in a given array
|
||||
* @param {string} str The substring to detect
|
||||
* @param {array} arr The array to search
|
||||
* @returns {number} the array index containing the substring or -1 if not present
|
||||
**/
|
||||
var isSubstringInArray = function isSubstringInArray(str, arr) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (arr[i].match(str)) return i;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
exports.isSubstringInArray = isSubstringInArray;
|
||||
|
||||
},{"./logger":130}]},{},[131])(131)
|
||||
});
|
Reference in New Issue
Block a user