Skip to content

Commit 59c8b07

Browse files
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into renovate/patch-all-patch
2 parents ddc1cfe + 9e72bbf commit 59c8b07

File tree

11 files changed

+207
-184
lines changed

11 files changed

+207
-184
lines changed

.changeset/deep-times-make.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/moody-fans-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'mermaid': patch
3+
---
4+
5+
fix: Resolve gantt chart crash due to invalid array length

.github/workflows/e2e-timings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
echo "EOF" >> $GITHUB_OUTPUT
5959
6060
- name: Commit and create pull request
61-
uses: peter-evans/create-pull-request@18e469570b1cf0dfc11d60ec121099f8ff3e617a
61+
uses: peter-evans/create-pull-request@915d841dae6a4f191bb78faf61a257411d7be4d2
6262
with:
6363
add-paths: |
6464
cypress/timings.json

cypress/integration/rendering/gantt.spec.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,4 +803,34 @@ describe('Gantt diagram', () => {
803803
{}
804804
);
805805
});
806+
it('should handle numeric timestamps with dateFormat x', () => {
807+
imgSnapshotTest(
808+
`
809+
gantt
810+
title Process time profile (ms)
811+
dateFormat x
812+
axisFormat %L
813+
tickInterval 250millisecond
814+
815+
section Pipeline
816+
Parse JSON p1: 000, 120
817+
`,
818+
{}
819+
);
820+
});
821+
it('should handle numeric timestamps with dateFormat X', () => {
822+
imgSnapshotTest(
823+
`
824+
gantt
825+
title Process time profile (ms)
826+
dateFormat X
827+
axisFormat %L
828+
tickInterval 250millisecond
829+
830+
section Pipeline
831+
Parse JSON p1: 000, 120
832+
`,
833+
{}
834+
);
835+
});
806836
});

cypress/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"target": "es2020",
44
"lib": ["es2020", "dom"],
5-
"types": ["cypress", "node", "@argos-ci/cypress/dist/support.d.ts"],
5+
"types": ["cypress", "node", "@argos-ci/cypress/support"],
66
"allowImportingTsExtensions": true,
77
"noEmit": true
88
},

docs/syntax/userJourney.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ Each user journey is split into sections, these describe the part of the task
3838
the user is trying to complete.
3939

4040
Tasks syntax is `Task name: <score>: <comma separated list of actors>`
41+
42+
Score is a number between 1 and 5, inclusive.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
"devDependencies": {
6666
"@applitools/eyes-cypress": "^3.44.9",
67-
"@argos-ci/cypress": "^5.0.7",
67+
"@argos-ci/cypress": "^6.1.1",
6868
"@changesets/changelog-github": "^0.5.1",
6969
"@changesets/cli": "^2.27.12",
7070
"@cspell/eslint-plugin": "^8.19.4",

packages/examples/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "Mermaid examples package",
55
"author": "Sidharth Vinod",
6+
"license": "MIT",
67
"type": "module",
78
"module": "./dist/mermaid-examples.core.mjs",
89
"types": "./dist/mermaid.d.ts",

packages/mermaid/src/diagrams/gantt/ganttDb.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ const fixTaskDates = function (startTime, endTime, dateFormat, excludes, include
268268

269269
const getStartDate = function (prevTime, dateFormat, str) {
270270
str = str.trim();
271-
271+
if ((dateFormat.trim() === 'x' || dateFormat.trim() === 'X') && /^\d+$/.test(str)) {
272+
return new Date(Number(str));
273+
}
272274
// Test for after
273275
const afterRePattern = /^after\s+(?<ids>[\d\w- ]+)/;
274276
const afterStatement = afterRePattern.exec(str);

packages/mermaid/src/docs/syntax/userJourney.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ Each user journey is split into sections, these describe the part of the task
2020
the user is trying to complete.
2121

2222
Tasks syntax is `Task name: <score>: <comma separated list of actors>`
23+
24+
Score is a number between 1 and 5, inclusive.

0 commit comments

Comments
 (0)