mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 08:19:43 +02:00
Prettier
This commit is contained in:
@@ -41,7 +41,7 @@ export const draw = function (text: string, id: string, _version: string, diagOb
|
|||||||
let root = d3select('body');
|
let root = d3select('body');
|
||||||
|
|
||||||
if (securityLevel === 'sandbox' && sandboxElement) {
|
if (securityLevel === 'sandbox' && sandboxElement) {
|
||||||
root = d3select(sandboxElement.nodes()[0].contentDocument.body)
|
root = d3select(sandboxElement.nodes()[0].contentDocument.body);
|
||||||
}
|
}
|
||||||
const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;
|
const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;
|
||||||
const svg = securityLevel === 'sandbox' ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`);
|
const svg = securityLevel === 'sandbox' ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`);
|
||||||
@@ -150,21 +150,22 @@ export const draw = function (text: string, id: string, _version: string, diagOb
|
|||||||
.attr('class', 'link')
|
.attr('class', 'link')
|
||||||
.style('mix-blend-mode', 'multiply');
|
.style('mix-blend-mode', 'multiply');
|
||||||
|
|
||||||
const gradient = link.append("linearGradient")
|
const gradient = link
|
||||||
.attr("id", d => (d.uid = Uid.next("linearGradient-")).id)
|
.append('linearGradient')
|
||||||
.attr("gradientUnits", "userSpaceOnUse")
|
.attr('id', (d) => (d.uid = Uid.next('linearGradient-')).id)
|
||||||
.attr("x1", d => d.source.x1)
|
.attr('gradientUnits', 'userSpaceOnUse')
|
||||||
.attr("x2", d => d.target.x0);
|
.attr('x1', (d) => d.source.x1)
|
||||||
|
.attr('x2', (d) => d.target.x0);
|
||||||
|
|
||||||
gradient
|
gradient
|
||||||
.append("stop")
|
.append('stop')
|
||||||
.attr("offset", "0%")
|
.attr('offset', '0%')
|
||||||
.attr("stop-color", d => colorScheme(d.source.id));
|
.attr('stop-color', (d) => colorScheme(d.source.id));
|
||||||
|
|
||||||
gradient
|
gradient
|
||||||
.append("stop")
|
.append('stop')
|
||||||
.attr("offset", "100%")
|
.attr('offset', '100%')
|
||||||
.attr("stop-color", d => colorScheme(d.target.id));
|
.attr('stop-color', (d) => colorScheme(d.target.id));
|
||||||
|
|
||||||
link
|
link
|
||||||
.append('path')
|
.append('path')
|
||||||
|
@@ -7,7 +7,6 @@ const prepareTextForParsing = (text: string): string => {
|
|||||||
return textToParse;
|
return textToParse;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Uid {
|
class Uid {
|
||||||
private static count = 0;
|
private static count = 0;
|
||||||
id: string;
|
id: string;
|
||||||
@@ -23,16 +22,8 @@ class Uid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toString(): string {
|
toString(): string {
|
||||||
return "url(" + this.href + ")";
|
return 'url(' + this.href + ')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { Uid, prepareTextForParsing };
|
||||||
Uid,
|
|
||||||
prepareTextForParsing
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user