mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-04 08:06:43 +02:00
spelling: id
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
@@ -11,7 +11,7 @@ describe('Git Graph diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('2: should render a simple gitgraph with commit on main branch with Id', () => {
|
it('2: should render a simple gitgraph with commit on main branch with id', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`gitGraph
|
`gitGraph
|
||||||
commit id: "One"
|
commit id: "One"
|
||||||
@@ -253,7 +253,7 @@ describe('Git Graph diagram', () => {
|
|||||||
`
|
`
|
||||||
gitGraph
|
gitGraph
|
||||||
checkout main
|
checkout main
|
||||||
%% Make sure to manually set the ID of all commits, for consistent visual tests
|
%% Make sure to manually set the id of all commits, for consistent visual tests
|
||||||
commit id: "1-abcdefg"
|
commit id: "1-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
branch branch1
|
branch branch1
|
||||||
@@ -343,7 +343,7 @@ gitGraph
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('16: should render a simple gitgraph with commit on main branch with Id | Vertical Branch', () => {
|
it('16: should render a simple gitgraph with commit on main branch with id | Vertical Branch', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`gitGraph TB:
|
`gitGraph TB:
|
||||||
commit id: "One"
|
commit id: "One"
|
||||||
@@ -585,7 +585,7 @@ gitGraph
|
|||||||
`
|
`
|
||||||
gitGraph TB:
|
gitGraph TB:
|
||||||
checkout main
|
checkout main
|
||||||
%% Make sure to manually set the ID of all commits, for consistent visual tests
|
%% Make sure to manually set the id of all commits, for consistent visual tests
|
||||||
commit id: "1-abcdefg"
|
commit id: "1-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
branch branch1
|
branch branch1
|
||||||
@@ -1024,7 +1024,7 @@ gitGraph TB:
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('51: should render a simple gitgraph with commit on main branch with Id | Vertical Branch - Bottom-to-top', () => {
|
it('51: should render a simple gitgraph with commit on main branch with id | Vertical Branch - Bottom-to-top', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`gitGraph BT:
|
`gitGraph BT:
|
||||||
commit id: "One"
|
commit id: "One"
|
||||||
@@ -1266,7 +1266,7 @@ gitGraph TB:
|
|||||||
`
|
`
|
||||||
gitGraph BT:
|
gitGraph BT:
|
||||||
checkout main
|
checkout main
|
||||||
%% Make sure to manually set the ID of all commits, for consistent visual tests
|
%% Make sure to manually set the id of all commits, for consistent visual tests
|
||||||
commit id: "1-abcdefg"
|
commit id: "1-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
branch branch1
|
branch branch1
|
||||||
@@ -1491,7 +1491,7 @@ gitGraph TB:
|
|||||||
`
|
`
|
||||||
gitGraph
|
gitGraph
|
||||||
switch main
|
switch main
|
||||||
%% Make sure to manually set the ID of all commits, for consistent visual tests
|
%% Make sure to manually set the id of all commits, for consistent visual tests
|
||||||
commit id: "1-abcdefg"
|
commit id: "1-abcdefg"
|
||||||
switch main
|
switch main
|
||||||
branch branch1
|
branch branch1
|
||||||
|
@@ -148,7 +148,7 @@
|
|||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class Person {
|
class Person {
|
||||||
+Id : Guid
|
+ID : Guid
|
||||||
+FirstName : string
|
+FirstName : string
|
||||||
+LastName : string
|
+LastName : string
|
||||||
-privateProperty : string
|
-privateProperty : string
|
||||||
|
@@ -50,7 +50,7 @@ There are three types of components to a requirement diagram: requirement, eleme
|
|||||||
|
|
||||||
The grammar for defining each is defined below. Words denoted in angle brackets, such as `<word>`, are enumerated keywords that have options elaborated in a table. `user_defined_...` is use in any place where user input is expected.
|
The grammar for defining each is defined below. Words denoted in angle brackets, such as `<word>`, are enumerated keywords that have options elaborated in a table. `user_defined_...` is use in any place where user input is expected.
|
||||||
|
|
||||||
An important note on user text: all input can be surrounded in quotes or not. For example, both `Id: "here is an example"` and `Id: here is an example` are both valid. However, users must be careful with unquoted input. The parser will fail if another keyword is detected.
|
An important note on user text: all input can be surrounded in quotes or not. For example, both `id: "here is an example"` and `id: here is an example` are both valid. However, users must be careful with unquoted input. The parser will fail if another keyword is detected.
|
||||||
|
|
||||||
### Requirement
|
### Requirement
|
||||||
|
|
||||||
|
@@ -143,7 +143,7 @@ export const render = async (
|
|||||||
height: node.height,
|
height: node.height,
|
||||||
};
|
};
|
||||||
if (node.isGroup) {
|
if (node.isGroup) {
|
||||||
log.debug('Id abc88 subgraph = ', node.id, node.x, node.y, node.labelData);
|
log.debug('id abc88 subgraph = ', node.id, node.x, node.y, node.labelData);
|
||||||
const subgraphEl = subgraphsEl.insert('g').attr('class', 'subgraph');
|
const subgraphEl = subgraphsEl.insert('g').attr('class', 'subgraph');
|
||||||
// TODO use faster way of cloning
|
// TODO use faster way of cloning
|
||||||
const clusterNode = JSON.parse(JSON.stringify(node));
|
const clusterNode = JSON.parse(JSON.stringify(node));
|
||||||
@@ -152,10 +152,10 @@ export const render = async (
|
|||||||
clusterNode.width = Math.max(clusterNode.width, node.labelData.width);
|
clusterNode.width = Math.max(clusterNode.width, node.labelData.width);
|
||||||
await insertCluster(subgraphEl, clusterNode);
|
await insertCluster(subgraphEl, clusterNode);
|
||||||
|
|
||||||
log.debug('Id (UIO)= ', node.id, node.width, node.shape, node.labels);
|
log.debug('id (UIO)= ', node.id, node.width, node.shape, node.labels);
|
||||||
} else {
|
} else {
|
||||||
log.info(
|
log.info(
|
||||||
'Id NODE = ',
|
'id NODE = ',
|
||||||
node.id,
|
node.id,
|
||||||
node.x,
|
node.x,
|
||||||
node.y,
|
node.y,
|
||||||
|
@@ -106,7 +106,7 @@ Required edgeData for proper rendering:
|
|||||||
|
|
||||||
| property | description |
|
| property | description |
|
||||||
| ---------- | -------------------------------------------------------------------- |
|
| ---------- | -------------------------------------------------------------------- |
|
||||||
| id | Id of the edge |
|
| id | ID of the edge |
|
||||||
| arrowHead | overlap between arrowHead and arrowType? |
|
| arrowHead | overlap between arrowHead and arrowType? |
|
||||||
| arrowType | overlap between arrowHead and arrowType? |
|
| arrowType | overlap between arrowHead and arrowType? |
|
||||||
| style | |
|
| style | |
|
||||||
|
@@ -99,7 +99,7 @@ export class ClassDB implements DiagramDB {
|
|||||||
/**
|
/**
|
||||||
* Function called by parser when a node definition has been found.
|
* Function called by parser when a node definition has been found.
|
||||||
*
|
*
|
||||||
* @param id - Id of the class to add
|
* @param id - ID of the class to add
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
public addClass(_id: string) {
|
public addClass(_id: string) {
|
||||||
@@ -524,7 +524,7 @@ export class ClassDB implements DiagramDB {
|
|||||||
/**
|
/**
|
||||||
* Function called by parser when a namespace definition has been found.
|
* Function called by parser when a namespace definition has been found.
|
||||||
*
|
*
|
||||||
* @param id - Id of the namespace to add
|
* @param id - ID of the namespace to add
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
public addNamespace(id: string) {
|
public addNamespace(id: string) {
|
||||||
@@ -553,8 +553,8 @@ export class ClassDB implements DiagramDB {
|
|||||||
/**
|
/**
|
||||||
* Function called by parser when a namespace definition has been found.
|
* Function called by parser when a namespace definition has been found.
|
||||||
*
|
*
|
||||||
* @param id - Id of the namespace to add
|
* @param id - ID of the namespace to add
|
||||||
* @param classNames - Ids of the class to add
|
* @param classNames - IDs of the class to add
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
public addClassesToNamespace(id: string, classNames: string[]) {
|
public addClassesToNamespace(id: string, classNames: string[]) {
|
||||||
|
@@ -1232,7 +1232,7 @@ describe('when parsing a gitGraph', function () {
|
|||||||
expect(true).toBe(false);
|
expect(true).toBe(false);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
expect(e.message).toBe(
|
expect(e.message).toBe(
|
||||||
'Incorrect usage of "merge". Commit with id:1-111 already exists, use different custom Id'
|
'Incorrect usage of "merge". Commit with id:1-111 already exists, use different custom id'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -222,7 +222,7 @@ export const merge = (mergeDB: MergeDB): void => {
|
|||||||
const error: any = new Error(
|
const error: any = new Error(
|
||||||
'Incorrect usage of "merge". Commit with id:' +
|
'Incorrect usage of "merge". Commit with id:' +
|
||||||
customId +
|
customId +
|
||||||
' already exists, use different custom Id'
|
' already exists, use different custom id'
|
||||||
);
|
);
|
||||||
error.hash = {
|
error.hash = {
|
||||||
text: `merge ${otherBranch} ${customId} ${overrideType} ${customTags?.join(' ')}`,
|
text: `merge ${otherBranch} ${customId} ${overrideType} ${customTags?.join(' ')}`,
|
||||||
|
@@ -149,7 +149,7 @@ function positionNodes(db: MindmapDB, cy: cytoscape.Core) {
|
|||||||
data.y = node.position().y;
|
data.y = node.position().y;
|
||||||
positionNode(db, data);
|
positionNode(db, data);
|
||||||
const el = db.getElementById(data.nodeId);
|
const el = db.getElementById(data.nodeId);
|
||||||
log.info('Id:', id, 'Position: (', node.position().x, ', ', node.position().y, ')', data);
|
log.info('id:', id, 'Position: (', node.position().x, ', ', node.position().y, ')', data);
|
||||||
el.attr(
|
el.attr(
|
||||||
'transform',
|
'transform',
|
||||||
`translate(${node.position().x - data.width / 2}, ${node.position().y - data.height / 2})`
|
`translate(${node.position().x - data.width / 2}, ${node.position().y - data.height / 2})`
|
||||||
|
@@ -27,7 +27,7 @@ There are three types of components to a requirement diagram: requirement, eleme
|
|||||||
|
|
||||||
The grammar for defining each is defined below. Words denoted in angle brackets, such as `<word>`, are enumerated keywords that have options elaborated in a table. `user_defined_...` is use in any place where user input is expected.
|
The grammar for defining each is defined below. Words denoted in angle brackets, such as `<word>`, are enumerated keywords that have options elaborated in a table. `user_defined_...` is use in any place where user input is expected.
|
||||||
|
|
||||||
An important note on user text: all input can be surrounded in quotes or not. For example, both `Id: "here is an example"` and `Id: here is an example` are both valid. However, users must be careful with unquoted input. The parser will fail if another keyword is detected.
|
An important note on user text: all input can be surrounded in quotes or not. For example, both `id: "here is an example"` and `id: here is an example` are both valid. However, users must be careful with unquoted input. The parser will fail if another keyword is detected.
|
||||||
|
|
||||||
### Requirement
|
### Requirement
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ export async function requirementBox<T extends SVGGraphicsElement>(
|
|||||||
if (isRequirementNode) {
|
if (isRequirementNode) {
|
||||||
const idHeight = await addText(
|
const idHeight = await addText(
|
||||||
shapeSvg,
|
shapeSvg,
|
||||||
`${requirementNode.requirementId ? `Id: ${requirementNode.requirementId}` : ''}`,
|
`${requirementNode.requirementId ? `id: ${requirementNode.requirementId}` : ''}`,
|
||||||
accumulativeHeight,
|
accumulativeHeight,
|
||||||
node.labelStyle
|
node.labelStyle
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user