mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Merge branch 'develop' into update-browserslist
This commit is contained in:
commit
1699a23ff0
16
.github/workflows/e2e.yml
vendored
16
.github/workflows/e2e.yml
vendored
@ -17,9 +17,19 @@ permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# For PRs and MergeQueues, the target commit is used, and for push events, github.event.previous is used.
|
||||
targetHash: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || (github.event.before == '0000000000000000000000000000000000000000' && 'develop' || github.event.before) }}
|
||||
|
||||
# For PRs and MergeQueues, the target commit is used, and for push events to non-develop branches, github.event.previous is used if available. Otherwise, 'develop' is used.
|
||||
targetHash: >-
|
||||
${{
|
||||
github.event.pull_request.base.sha ||
|
||||
github.event.merge_group.base_sha ||
|
||||
(
|
||||
(
|
||||
(github.event_name == 'push' && github.ref == 'refs/heads/develop') ||
|
||||
github.event.before == '0000000000000000000000000000000000000000'
|
||||
) && 'develop'
|
||||
) ||
|
||||
github.event.before
|
||||
}}
|
||||
jobs:
|
||||
cache:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -101,12 +101,12 @@ describe('Gantt diagram', () => {
|
||||
title Adding GANTT diagram to mermaid
|
||||
excludes weekdays 2014-01-10
|
||||
todayMarker off
|
||||
|
||||
|
||||
section team's critical event
|
||||
deadline A :milestone, crit, deadlineA, 2024-02-01, 0
|
||||
deadline B :milestone, crit, deadlineB, 2024-02-15, 0
|
||||
boss on leave :bossaway, 2024-01-28, 2024-02-11
|
||||
|
||||
|
||||
section new intern
|
||||
onboarding :onboarding, 2024-01-02, 1w
|
||||
literature review :litreview, 2024-01-02, 10d
|
||||
@ -573,7 +573,28 @@ describe('Gantt diagram', () => {
|
||||
`
|
||||
);
|
||||
});
|
||||
|
||||
it('should render a gantt diagram exculding friday and saturday', () => {
|
||||
imgSnapshotTest(
|
||||
`gantt
|
||||
title A Gantt Diagram
|
||||
dateFormat YYYY-MM-DD
|
||||
excludes weekends
|
||||
weekend friday
|
||||
section Section1
|
||||
A task :a1, 2024-02-28, 10d`
|
||||
);
|
||||
});
|
||||
it('should render a gantt diagram exculding saturday and sunday', () => {
|
||||
imgSnapshotTest(
|
||||
`gantt
|
||||
title A Gantt Diagram
|
||||
dateFormat YYYY-MM-DD
|
||||
excludes weekends
|
||||
weekend saturday
|
||||
section Section1
|
||||
A task :a1, 2024-02-28, 10d`
|
||||
);
|
||||
});
|
||||
it('should render when compact is true', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
|
@ -6,7 +6,29 @@
|
||||
|
||||
# Announcements
|
||||
|
||||
## 🚀 Mermaid Chart's Visual Editor for Flowcharts
|
||||
## 🚀 Exciting News from Mermaid Chart! 🚀
|
||||
|
||||
We're thrilled to announce that Mermaid Chart has successfully raised $7.5 million in Seed funding! 🌟 This achievement marks the beginning of a new era for Mermaid and Mermaid Chart.
|
||||
|
||||
**Why It Matters for Mermaid Chart:**
|
||||
|
||||
- **Empowering Collaboration**: Our tools are designed to enable faster, more efficient team collaboration across any distance, leveraging the best of text, voice, and automation.
|
||||
- **Opening New Doors**: Mermaid AI and our Visual Editor are breaking down barriers, making sophisticated diagramming accessible to everyone, not just software engineers.
|
||||
- **Looking Forward**: We're not stopping here! Expect groundbreaking features like automated documentation tools, advanced AI diagramming, and high-security on-premise solutions.
|
||||
|
||||
**Why It Matters for Mermaid JS:**
|
||||
|
||||
- **Continued support from Mermaid Chart**: At Mermaid Chart, we value our still-growing Mermaid JS roots. As such, we have funneled back development and support to the project. Thanks to the successful seed round, we can continue to ramp up these efforts.
|
||||
|
||||
We are incredibly excited about the future and are grateful to the community, our team, and our investors for being part of this journey. Together, we're not just creating diagrams; we're designing the future of collaboration.
|
||||
|
||||
🌐 Learn more about our groundbreaking tools and what's next for Mermaid Chart by visiting [our website](https://www.mermaidchart.com/blog/posts/mermaid-chart-raises-7.5m-to-reinvent-visual-collaoration-for-enterprises).
|
||||
|
||||
Thank you for being part of our story. Here's to creating, innovating, and collaborating on a global scale!
|
||||
|
||||
Knut Sveidqvist 🧜♂️✨
|
||||
|
||||
## Mermaid Chart's Visual Editor for Flowcharts
|
||||
|
||||
The Mermaid Chart team is excited to introduce a new Visual Editor for flowcharts, enabling users of all skill levels to create diagrams easily and efficiently, with both GUI and code-based editing options.
|
||||
|
||||
|
@ -6,6 +6,12 @@
|
||||
|
||||
# Blog
|
||||
|
||||
## [Mermaid Chart Raises $7.5M to Reinvent Visual Collaboration for Enterprises](https://www.mermaidchart.com/blog/posts/mermaid-chart-raises-7.5m-to-reinvent-visual-collaoration-for-enterprises/)
|
||||
|
||||
20 March 2024 · 4 mins
|
||||
|
||||
Mermaid Chart, the company offering text-based diagramming and workflow management tools, today announced it has raised $7.5 million in Seed funding.
|
||||
|
||||
## [Mermaid Chart GPT Is Now Available In the GPT Store!](https://www.mermaidchart.com/blog/posts/mermaid-chart-gpt-is-now-available-in-the-gpt-store/)
|
||||
|
||||
7 March 2024 · 3 mins
|
||||
|
@ -167,6 +167,38 @@ gantt
|
||||
|
||||
The `title` is an _optional_ string to be displayed at the top of the Gantt chart to describe the chart as a whole.
|
||||
|
||||
### Excludes
|
||||
|
||||
The `excludes` is an _optional_ attribute that accepts specific dates in YYYY-MM-DD format, days of the week ("sunday") or "weekends", but not the word "weekdays".
|
||||
These date will be marked on the graph, and be excluded from the duration calculation of tasks. Meaning that if there are excluded dates during a task interval, the number of 'skipped' days will be added to the end of the task to ensure the duration is as specified in the code.
|
||||
|
||||
#### Weekend (v\<MERMAID_RELEASE_VERSION>+)
|
||||
|
||||
When excluding weekends, it is possible to configure the weekends to be either Friday and Saturday or Saturday and Sunday. By default weekends are Saturday and Sunday.
|
||||
To define the weekend start day, there is an _optional_ attribute `weekend` that can be added in a new line followed by either `friday` or `saturday`.
|
||||
|
||||
```mermaid-example
|
||||
gantt
|
||||
title A Gantt Diagram Excluding Fri - Sat weekends
|
||||
dateFormat YYYY-MM-DD
|
||||
excludes weekends
|
||||
weekend friday
|
||||
section Section
|
||||
A task :a1, 2024-01-01, 30d
|
||||
Another task :after a1, 20d
|
||||
```
|
||||
|
||||
```mermaid
|
||||
gantt
|
||||
title A Gantt Diagram Excluding Fri - Sat weekends
|
||||
dateFormat YYYY-MM-DD
|
||||
excludes weekends
|
||||
weekend friday
|
||||
section Section
|
||||
A task :a1, 2024-01-01, 30d
|
||||
Another task :after a1, 20d
|
||||
```
|
||||
|
||||
### Section statements
|
||||
|
||||
You can divide the chart into various sections, for example to separate different parts of a project like development and documentation.
|
||||
|
@ -21,6 +21,7 @@ dayjs.extend(dayjsIsoWeek);
|
||||
dayjs.extend(dayjsCustomParseFormat);
|
||||
dayjs.extend(dayjsAdvancedFormat);
|
||||
|
||||
const WEEKEND_START_DAY = { friday: 5, saturday: 6 };
|
||||
let dateFormat = '';
|
||||
let axisFormat = '';
|
||||
let tickInterval = undefined;
|
||||
@ -37,6 +38,7 @@ let funs = [];
|
||||
let inclusiveEndDates = false;
|
||||
let topAxis = false;
|
||||
let weekday = 'sunday';
|
||||
let weekend = 'saturday';
|
||||
|
||||
// The serial order of the task in the script
|
||||
let lastOrder = 0;
|
||||
@ -63,6 +65,7 @@ export const clear = function () {
|
||||
links = {};
|
||||
commonClear();
|
||||
weekday = 'sunday';
|
||||
weekend = 'saturday';
|
||||
};
|
||||
|
||||
export const setAxisFormat = function (txt) {
|
||||
@ -167,7 +170,11 @@ export const isInvalidDate = function (date, dateFormat, excludes, includes) {
|
||||
if (includes.includes(date.format(dateFormat.trim()))) {
|
||||
return false;
|
||||
}
|
||||
if (date.isoWeekday() >= 6 && excludes.includes('weekends')) {
|
||||
if (
|
||||
excludes.includes('weekends') &&
|
||||
(date.isoWeekday() === WEEKEND_START_DAY[weekend] ||
|
||||
date.isoWeekday() === WEEKEND_START_DAY[weekend] + 1)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (excludes.includes(date.format('dddd').toLowerCase())) {
|
||||
@ -184,6 +191,10 @@ export const getWeekday = function () {
|
||||
return weekday;
|
||||
};
|
||||
|
||||
export const setWeekend = function (startDay) {
|
||||
weekend = startDay;
|
||||
};
|
||||
|
||||
/**
|
||||
* TODO: fully document what this function does and what types it accepts
|
||||
*
|
||||
@ -781,6 +792,7 @@ export default {
|
||||
isInvalidDate,
|
||||
setWeekday,
|
||||
getWeekday,
|
||||
setWeekend,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -267,6 +267,21 @@ describe('when using the ganttDb', function () {
|
||||
expect(tasks[6].task).toEqual('test7');
|
||||
});
|
||||
|
||||
it('should ignore weekends starting on friday', function () {
|
||||
ganttDb.setDateFormat('YYYY-MM-DD');
|
||||
ganttDb.setExcludes('weekends');
|
||||
ganttDb.setWeekend('friday');
|
||||
ganttDb.addSection('friday-saturday weekends skip test');
|
||||
ganttDb.addTask('test1', 'id1,2024-02-28, 3d');
|
||||
|
||||
const tasks = ganttDb.getTasks();
|
||||
|
||||
expect(tasks[0].startTime).toEqual(dayjs('2024-02-28', 'YYYY-MM-DD').toDate());
|
||||
expect(tasks[0].endTime).toEqual(dayjs('2024-03-04', 'YYYY-MM-DD').toDate());
|
||||
expect(tasks[0].id).toEqual('id1');
|
||||
expect(tasks[0].task).toEqual('test1');
|
||||
});
|
||||
|
||||
it('should maintain the order in which tasks are created', function () {
|
||||
ganttDb.setAccTitle('Project Execution');
|
||||
ganttDb.setDateFormat('YYYY-MM-DD');
|
||||
|
@ -84,6 +84,8 @@ weekday\s+thursday return 'weekday_thursday'
|
||||
weekday\s+friday return 'weekday_friday'
|
||||
weekday\s+saturday return 'weekday_saturday'
|
||||
weekday\s+sunday return 'weekday_sunday'
|
||||
weekend\s+friday return 'weekend_friday'
|
||||
weekend\s+saturday return 'weekend_saturday'
|
||||
\d\d\d\d"-"\d\d"-"\d\d return 'date';
|
||||
"title"\s[^\n]+ return 'title';
|
||||
"accDescription"\s[^#\n;]+ return 'accDescription'
|
||||
@ -128,6 +130,11 @@ weekday
|
||||
| weekday_sunday { yy.setWeekday("sunday");}
|
||||
;
|
||||
|
||||
weekend
|
||||
: weekend_friday { yy.setWeekend("friday");}
|
||||
| weekend_saturday { yy.setWeekend("saturday");}
|
||||
;
|
||||
|
||||
statement
|
||||
: dateFormat {yy.setDateFormat($1.substr(11));$$=$1.substr(11);}
|
||||
| inclusiveEndDates {yy.enableInclusiveEndDates();$$=$1.substr(18);}
|
||||
@ -138,6 +145,7 @@ statement
|
||||
| includes {yy.setIncludes($1.substr(9));$$=$1.substr(9);}
|
||||
| todayMarker {yy.setTodayMarker($1.substr(12));$$=$1.substr(12);}
|
||||
| weekday
|
||||
| weekend
|
||||
| title {yy.setDiagramTitle($1.substr(6));$$=$1.substr(6);}
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
|
@ -736,7 +736,7 @@ export const insertArrowHead = function (elem) {
|
||||
.attr('markerHeight', 12)
|
||||
.attr('orient', 'auto')
|
||||
.append('path')
|
||||
.attr('d', 'M 0 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead
|
||||
.attr('d', 'M -1 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
>
|
||||
<p class="flex-grow text-center tracking-wide text-text">
|
||||
<a
|
||||
href="https://www.mermaidchart.com/app/landing"
|
||||
href="https://www.mermaidchart.com/landing"
|
||||
target="_blank"
|
||||
class="unstyled flex-grow tracking-wide plausible-event-name=bannerClick"
|
||||
>
|
||||
|
@ -4,7 +4,29 @@ outline: 'deep' # shows all h3 headings in outline in Vitepress
|
||||
|
||||
# Announcements
|
||||
|
||||
## 🚀 Mermaid Chart's Visual Editor for Flowcharts
|
||||
## 🚀 Exciting News from Mermaid Chart! 🚀
|
||||
|
||||
We're thrilled to announce that Mermaid Chart has successfully raised $7.5 million in Seed funding! 🌟 This achievement marks the beginning of a new era for Mermaid and Mermaid Chart.
|
||||
|
||||
**Why It Matters for Mermaid Chart:**
|
||||
|
||||
- **Empowering Collaboration**: Our tools are designed to enable faster, more efficient team collaboration across any distance, leveraging the best of text, voice, and automation.
|
||||
- **Opening New Doors**: Mermaid AI and our Visual Editor are breaking down barriers, making sophisticated diagramming accessible to everyone, not just software engineers.
|
||||
- **Looking Forward**: We're not stopping here! Expect groundbreaking features like automated documentation tools, advanced AI diagramming, and high-security on-premise solutions.
|
||||
|
||||
**Why It Matters for Mermaid JS:**
|
||||
|
||||
- **Continued support from Mermaid Chart**: At Mermaid Chart, we value our still-growing Mermaid JS roots. As such, we have funneled back development and support to the project. Thanks to the successful seed round, we can continue to ramp up these efforts.
|
||||
|
||||
We are incredibly excited about the future and are grateful to the community, our team, and our investors for being part of this journey. Together, we're not just creating diagrams; we're designing the future of collaboration.
|
||||
|
||||
🌐 Learn more about our groundbreaking tools and what's next for Mermaid Chart by visiting [our website](https://www.mermaidchart.com/blog/posts/mermaid-chart-raises-7.5m-to-reinvent-visual-collaoration-for-enterprises).
|
||||
|
||||
Thank you for being part of our story. Here's to creating, innovating, and collaborating on a global scale!
|
||||
|
||||
Knut Sveidqvist 🧜♂️✨
|
||||
|
||||
## Mermaid Chart's Visual Editor for Flowcharts
|
||||
|
||||
The Mermaid Chart team is excited to introduce a new Visual Editor for flowcharts, enabling users of all skill levels to create diagrams easily and efficiently, with both GUI and code-based editing options.
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
# Blog
|
||||
|
||||
## [Mermaid Chart Raises $7.5M to Reinvent Visual Collaboration for Enterprises](https://www.mermaidchart.com/blog/posts/mermaid-chart-raises-7.5m-to-reinvent-visual-collaoration-for-enterprises/)
|
||||
|
||||
20 March 2024 · 4 mins
|
||||
|
||||
Mermaid Chart, the company offering text-based diagramming and workflow management tools, today announced it has raised $7.5 million in Seed funding.
|
||||
|
||||
## [Mermaid Chart GPT Is Now Available In the GPT Store!](https://www.mermaidchart.com/blog/posts/mermaid-chart-gpt-is-now-available-in-the-gpt-store/)
|
||||
|
||||
7 March 2024 · 3 mins
|
||||
|
@ -109,6 +109,27 @@ gantt
|
||||
|
||||
The `title` is an _optional_ string to be displayed at the top of the Gantt chart to describe the chart as a whole.
|
||||
|
||||
### Excludes
|
||||
|
||||
The `excludes` is an _optional_ attribute that accepts specific dates in YYYY-MM-DD format, days of the week ("sunday") or "weekends", but not the word "weekdays".
|
||||
These date will be marked on the graph, and be excluded from the duration calculation of tasks. Meaning that if there are excluded dates during a task interval, the number of 'skipped' days will be added to the end of the task to ensure the duration is as specified in the code.
|
||||
|
||||
#### Weekend (v\<MERMAID_RELEASE_VERSION>+)
|
||||
|
||||
When excluding weekends, it is possible to configure the weekends to be either Friday and Saturday or Saturday and Sunday. By default weekends are Saturday and Sunday.
|
||||
To define the weekend start day, there is an _optional_ attribute `weekend` that can be added in a new line followed by either `friday` or `saturday`.
|
||||
|
||||
```mermaid-example
|
||||
gantt
|
||||
title A Gantt Diagram Excluding Fri - Sat weekends
|
||||
dateFormat YYYY-MM-DD
|
||||
excludes weekends
|
||||
weekend friday
|
||||
section Section
|
||||
A task :a1, 2024-01-01, 30d
|
||||
Another task :after a1, 20d
|
||||
```
|
||||
|
||||
### Section statements
|
||||
|
||||
You can divide the chart into various sections, for example to separate different parts of a project like development and documentation.
|
||||
|
@ -15,21 +15,24 @@
|
||||
"automerge": true
|
||||
},
|
||||
{
|
||||
"groupName": "all patch dependencies",
|
||||
"groupSlug": "all-patch",
|
||||
"groupName": "all major dependencies",
|
||||
"groupSlug": "all-major",
|
||||
"matchPackagePatterns": ["*"],
|
||||
"matchUpdateTypes": ["patch"]
|
||||
"matchUpdateTypes": ["major"]
|
||||
},
|
||||
{
|
||||
"groupName": "all minor dependencies",
|
||||
"groupSlug": "all-minor",
|
||||
"matchPackagePatterns": ["*"],
|
||||
"matchUpdateTypes": ["minor"]
|
||||
},
|
||||
{
|
||||
"groupName": "all patch dependencies",
|
||||
"groupSlug": "all-patch",
|
||||
"matchPackagePatterns": ["*"],
|
||||
"matchUpdateTypes": ["patch"]
|
||||
}
|
||||
],
|
||||
"dependencyDashboard": true,
|
||||
"major": {
|
||||
"dependencyDashboardApproval": true
|
||||
},
|
||||
"dependencyDashboard": false,
|
||||
"dependencyDashboardAutoclose": true
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ yarn install
|
||||
yarn link mermaid
|
||||
|
||||
# Force Build the site
|
||||
yarn run build -- --force
|
||||
yarn run build
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user