mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-12 11:59:39 +02:00
perf(er): pre-calculcate er UUID namespace
Pre-calculate the entity-relationship diagram namespace UUID. This UUID is always constant, so we can pre-calculate it to save a bit of processing power on the client. Co-authored-by: "Ashley Engelund (weedySeaDragon @ github)" <ashley.engelund@gmail.com> Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
This commit is contained in:
@@ -643,11 +643,20 @@ export const draw = function (text, id, _version, diagObj) {
|
|||||||
svg.attr('viewBox', `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);
|
svg.attr('viewBox', `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);
|
||||||
}; // draw
|
}; // draw
|
||||||
|
|
||||||
/** UUID namespace for ER diagram IDs */
|
/**
|
||||||
const MERMAID_ERDIAGRAM_UUID = uuid5(
|
* UUID namespace for ER diagram IDs
|
||||||
'https://mermaid-js.github.io/mermaid/syntax/entityRelationshipDiagram.html',
|
*
|
||||||
uuid5.URL
|
* This can be generated via running:
|
||||||
);
|
*
|
||||||
|
* ```js
|
||||||
|
* const { v5: uuid5 } = await import('uuid');
|
||||||
|
* uuid5(
|
||||||
|
* 'https://mermaid-js.github.io/mermaid/syntax/entityRelationshipDiagram.html',
|
||||||
|
* uuid5.URL
|
||||||
|
* );
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
const MERMAID_ERDIAGRAM_UUID = '28e9f9db-3c8d-5aa5-9faf-44286ae5937c';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a unique id based on the given string. Start with the prefix, then a hyphen, then the
|
* Return a unique id based on the given string. Start with the prefix, then a hyphen, then the
|
||||||
|
Reference in New Issue
Block a user