diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json new file mode 100644 index 000000000..02e425437 --- /dev/null +++ b/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/cypress/integration/rendering/sequencediagram.spec.js b/cypress/integration/rendering/sequencediagram.spec.js index eccc23358..3e67c0437 100644 --- a/cypress/integration/rendering/sequencediagram.spec.js +++ b/cypress/integration/rendering/sequencediagram.spec.js @@ -614,16 +614,14 @@ context('Sequence diagram', () => { //Be aware that the syntax for "properties" is likely to be changed. imgSnapshotTest( ` - %%{init: { "config": { "hideUnusedParticipants": true }}}%% + %%{init: { "config": { "sequence": {"hideUnusedParticipants": true }}}}%% sequenceDiagram participant a `, { logLevel: 0, sequence: { mirrorActors: false, noteFontSize: 18, noteFontFamily: 'Arial' }, - }, - false, - (svg) => expect(svg.get('rect')).to.be.empty() + } ); }); }); diff --git a/cypress/platform/knsv.html b/cypress/platform/knsv.html index 92c395453..fb9efffbc 100644 --- a/cypress/platform/knsv.html +++ b/cypress/platform/knsv.html @@ -26,58 +26,16 @@ -
-pie title Pets adopted by volunteers - "Dogs" : 386 - "Cats" : 85 - "Rats" : 15 -
-
-gantt - title Adding GANTT diagram functionality to mermaid - excludes :excludes the named dates/days from being included in a charted task.. - section Screening - Lexplore :active, des1, 2023-01-06,2023-01-08 - H4 :active, des2, 2024-01-09, 3d - Future task : des3, after des2, 5d - Future task2 : des4, after des3, 5d -
-
-info -
-
-gitGraph: -options -{ - "nodeSpacing": 150, - "nodeRadius": 10 -} -end -commit -branch newbranch -checkout newbranch -commit -commit -checkout master -commit -commit -merge newbranch -
+ + +
-sequenceDiagram - title: with colon: - participant a as Alice - participant j as John - note right of a: Hello world! - properties a: {"class": "internal-service-actor", "type": "@clock"} - properties j: {"class": "external-service-actor", "type": "@computer"} - links a: {"Repo": "https://www.contoso.com/repo", "Swagger": "https://www.contoso.com/swagger"} - links j: {"Repo": "https://www.contoso.com/repo"} - links a: {"Dashboard": "https://www.contoso.com/dashboard", "On-Call": "https://www.contoso.com/oncall"} - link a: Contacts @ https://contacts.contoso.com/?contact=alice@contoso.com - a->>j: Hello John, how are you? - j-->>a: Great!
+ %%{init: { 'logLevel': 'debug', 'theme': 'base', 'sequence': {'hideUnusedParticipants': true, 'showCommitLabel':true,'mainBranchName': 'MetroLine1'}} }%% + + sequenceDiagram + participant a +
journey title My working day @@ -145,12 +103,6 @@ requirementDiagram a1-->a2-->a3 end
-
- flowchart LR - Function-->URL-->A-->B-->C - click Function clickByFlow "Add a div" - click URL "https://mermaid-js.github.io/mermaid/#/" "Visit mermaid docs" _blank -
gantt dateFormat YYYY-MM-DD @@ -257,13 +209,14 @@ class Class10 { htmlLabels: true, }, // gantt: { axisFormat: '%m/%d/%Y' }, - sequence: { - actorFontFamily: 'courier', - actorMargin: 50, - showSequenceNumbers: false, - // forceMenus: true, - }, - // sequenceDiagram: { actorMargin: 300, forceMenus: false }, // deprecated + // sequence: { + // actorFontFamily: 'courier', + // actorMargin: 50, + // showSequenceNumbers: false, + // // hideUnusedParticipants: true, + // // forceMenus: true, + // }, + // // sequenceDiagram: { actorMargin: 300, forceMenus: false }, // deprecated // fontFamily: '"times", sans-serif', // fontFamily: 'courier', state: { diff --git a/src/defaultConfig.js b/src/defaultConfig.js index 63085b0ea..46ed5a0c4 100644 --- a/src/defaultConfig.js +++ b/src/defaultConfig.js @@ -230,6 +230,7 @@ const config = { /** The object containing configurations specific for sequence diagrams */ sequence: { + hideUnusedParticipants: false, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ---------------------------- | ------- | -------- | ------------------ | diff --git a/src/diagrams/sequence/sequenceRenderer.js b/src/diagrams/sequence/sequenceRenderer.js index 8cc3279a6..528387fd7 100644 --- a/src/diagrams/sequence/sequenceRenderer.js +++ b/src/diagrams/sequence/sequenceRenderer.js @@ -461,7 +461,7 @@ export const drawActors = function ( newActors.add(message.from); newActors.add(message.to); }); - actorKeys = actorKeys.filter((actorKey) => newActors.includes(actorKey)); + actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey)); } // Draw the actors