Commit Graph

6568 Commits

Author SHA1 Message Date
Sidharth Vinod f687abb165
chore: Use `graphlib` from `dagre-d3-es` 2022-11-21 08:16:08 +05:30
Sidharth Vinod 931661ed67
fix: Add types to memoized functions 2022-11-21 08:13:44 +05:30
Sidharth Vinod 7d3a0577d2
chore: Replace lodash with lodash-es 2022-11-21 08:13:44 +05:30
Sidharth Vinod 4411aa9905
Cleanup 2022-11-21 08:13:44 +05:30
Sidharth Vinod 4890999206
Merge branch 'sidv/viz' into sidv/dagre-es-viz
* sidv/viz:
  Fix Lodash import
  fix: Viz build
  feat: Add package visualization
  Ignore stats.html
  feat: Add bundle visualization
  style(docs): use `github-dark` hightlight theme
  refactor(docs): use default vitepress highlighter
  fix: Move redirection to router
  chore: Add docs to redirect.ts
  feat: Redirect old documentation links.
  comments in states are skipped now
  Remove extra arrow and adjust cross position
2022-11-21 08:13:43 +05:30
Ashley Engelund (weedySeaDragon @ github) a9c337302a export D3Element from mermaidAPI; use in accessibility 2022-11-20 12:27:29 -08:00
Ashley Engelund 2a98791ec9
use optional chaining check for get acc title and get acc description
Co-authored-by: Alois Klink <alois@aloisklink.com>
2022-11-20 12:17:21 -08:00
Sidharth Vinod 8a2d3a400c
Fix Lodash import 2022-11-20 19:12:52 +05:30
Sidharth Vinod 29342ea726
fix: Viz build 2022-11-20 17:16:09 +05:30
Sidharth Vinod 4ad99a25d0
feat: Add package visualization 2022-11-20 14:16:22 +05:30
Sidharth Vinod fc859528e4
Ignore stats.html 2022-11-20 12:13:03 +05:30
Sidharth Vinod 49a931f712
feat: Add bundle visualization 2022-11-20 12:13:00 +05:30
Mason Malone bdf8b01185 Fix example for Git diagrams 2022-11-19 13:20:12 -08:00
Mason Malone 1b201bf462 Fix TS errors 2022-11-19 13:01:21 -08:00
Mason Malone 3316aa5f4f Add interface for DiagramDb and other minor changes 2022-11-19 12:52:49 -08:00
Mason Malone a11ab3d5ea Disallow leading whitespace before delimiter 2022-11-19 12:52:49 -08:00
Doug Finke 2a0f6d4cc9
Integrations added - Visual Studio Code [Polyglot Interactive Notebooks] 2022-11-19 11:20:13 -05:00
endolith e3b9dbdf13 Fix typos 2022-11-19 09:33:01 -05:00
Mason Malone 70f024735b Add title support using YAML frontmatter 2022-11-18 20:42:54 -08:00
Alois Klink fd76e0e270 chore: replace dagre/dagre-d3 with dagre-d3-es
Replace the dagre and dagre-d3 libraries with dagre-d3-es.

Both dagre and dagre-d3 are deprecated and unmaintained,
and haven't been updated for more than 3 years.

Since dagre-d3 still requires an old version of d3, this causes
a bunch of security warnings,
e.g. https://github.com/advisories/GHSA-36jr-mh4h-2g58

The [dagre-d3-es](https://github.com/tbo47/dagre-es) package is a fork
that contains support for `"d3": "^7.6.1"`. Also, it's ESM, so we will
hopefully get smaller bundle sizes too. The only issue is that this
fork isn't very well used (only has 3000 weekly downloads),
compared to `dagre-d3`'s 250,000 weekly downloads.

(although to be fair, a large proportion of dagre-d3's downloads
 probably come from mermaid)

Since it's is a less popular package,
**I've pinned `dagre-d3-es` to `"7.0.2"` instead of `"^7.0.2"`**.
This does mean if there is a bug in `dagre-d3-es`, we will have to
manually bump it ourselves, but it also means we won't accidentally
be sending a buggy version of `dagre-d3-es` out to users in cases
something changes (it might be worth disabling renovate for this
if we're feeling paranoid!)
2022-11-18 18:33:05 +00:00
Alois Klink 537a627b75 test(e2e): test for mindmap before snapshot
Sometimes, the mindmap e2e tests take a snapshot when the mindmap
SVG has been created, but hasn't yet been fully rendered.

This adds a quick check for a mindmap section root, so that the
snapshot is only taken after the mindmap diagram has started
rendering.

I was also running into JSDoc ESLint warnings, so I moved the file
into a TypeScript file to fix those warnings.
2022-11-18 18:31:14 +00:00
Alois Klink 57edcfe87d test(e2e): remove unused mermaid.spec.js file
All tests have been moved to `mindmap.spec.js` in a previous commit.
2022-11-18 18:07:40 +00:00
Alois Klink b9dcdb00a5 test(e2e): move mindmap tests to mindmap.spec.js
Currently, we have mindmap tests in the
cypress/integration/rendering/mermaid.spec.js which is a bit
odd. They should probably all be in the mindmap.spec.js file.
2022-11-18 17:58:17 +00:00
Sidharth Vinod 09ed41b7d2
Merge pull request #3807 from aloisklink/docs/update-code-highlighting-theme
Use `github-dark` to highlight fence blocks in vitepress docs
2022-11-18 23:09:59 +05:30
Alois Klink 6e234f135d docs: create some basic mermaid mindmap demos 2022-11-18 17:32:23 +00:00
pbrolin47 e2a0c434cc
Merge pull request #3810 from mermaid-js/sidv/doc/mindmap
Mindmap integration docs
2022-11-18 11:01:38 +01:00
pbrolin47 804a23595d
Merge pull request #3797 from mermaid-js/sidv/redirectOldDocs
feat: Redirect old documentation links.
2022-11-18 10:46:34 +01:00
Knut Sveidqvist 8655db371e
Merge pull request #3762 from avijit1258/bug/3728_comments_not_ignored_composite_states
comments in states are skipped now
2022-11-18 10:45:01 +01:00
Knut Sveidqvist 9b8d5c1b3b
Merge pull request #3641 from ishuen/bug/3637_extra_arrow
Remove extra arrow and adjust cross position
2022-11-18 10:38:57 +01:00
Sidharth Vinod e9f8ba6915
doc: Add mindmap integration docs 2022-11-18 11:28:29 +05:30
Ashley Engelund (weedySeaDragon @ github) 67a015c71d re-re-fixed the contributing doc 2022-11-17 16:58:18 -08:00
Ashley Engelund (weedySeaDragon @ github) 69526402e2 format .md files 2022-11-17 16:51:23 -08:00
Ashley Engelund (weedySeaDragon @ github) b51759d36e set describeby to accessible description element id 2022-11-17 15:50:52 -08:00
Ashley Engelund (weedySeaDragon @ github) 68b1805c40 (minor) fix typo, whitespace formatting 2022-11-17 15:49:37 -08:00
Ashley Engelund (weedySeaDragon @ github) 9cc862b951 doc: adding diagrams: revise a11y section 2022-11-17 15:48:17 -08:00
Ashley Engelund (weedySeaDragon @ github) 4fb4aa417c doc: revise A11y: fix multi-line ex, +describedby, alpha sort examples 2022-11-17 15:47:22 -08:00
Ashley Engelund (weedySeaDragon @ github) 0adc6a6112 remove a11y from individual diagrams; now happens in mermaidAPI render 2022-11-17 12:28:11 -08:00
Ashley Engelund (weedySeaDragon @ github) 29efc116f3 put a11y into mermaidAPI render; add render spec (mock diagram renderers etc) 2022-11-17 12:27:17 -08:00
Ashley Engelund (weedySeaDragon @ github) f62c5d9698 add diagram renderer mocks 2022-11-17 12:25:14 -08:00
Ashley Engelund (weedySeaDragon @ github) 1ad537bc4d d3 mock: use MockedD3; remove sequence specific mock code 2022-11-17 12:24:58 -08:00
Ashley Engelund (weedySeaDragon @ github) 1fc02940ae move mocks specific to only seq spec files out of global d3 mock 2022-11-17 12:24:16 -08:00
Ashley Engelund (weedySeaDragon @ github) 8a3c4f64b2 MockedD3: node() return Element; add selectAll() 2022-11-17 12:23:01 -08:00
Ashley Engelund (weedySeaDragon @ github) 4d7496b8dd add error checking (empty diagramType, title, desc) to a11y methods 2022-11-17 12:21:45 -08:00
Ashley Engelund (weedySeaDragon @ github) 03a11e103e (minor) fix typo 2022-11-17 12:19:31 -08:00
Ashley Engelund (weedySeaDragon @ github) c3313050ce Merge remote-tracking branch 'MERMAID/develop' into feat/3626-aria-roledescription-for-svg 2022-11-17 11:17:18 -08:00
Alois Klink c30aa6f9cf
style(docs): use `github-dark` hightlight theme
Use the `github-dark` highlight theme for fence blocks in vitepress,
instead of the default `material-palenight` theme.

This increases the contrast ratio of `#comments` from 2.75:1 to 4.43:1,
which is a lot more visible.

It still doesn't reach WCAG 2.0 level AA contrast standards,
which requires 4.5:1 as a minimum constrast ratio, but 4.43:1 is
pretty close, and we don't need to manually modify the theme's colours.
2022-11-17 19:05:41 +00:00
Alois Klink 6da6edfc01
refactor(docs): use default vitepress highlighter
Use the default vitepress highlighter instead of making our own
highlighter using shiki.

The benefits are:
  - We don't need to directly depend on shiki
  - `mermaid-example` code-blocks will use the same highlighting
    as other languages (e.g. `html`/`js`).
  - We can control the theme from the global `vitepress` config.
  - Darkmode/lightmode themes are supported
  - Escaping is already handled by the default highlight function
2022-11-17 19:05:38 +00:00
Sidharth Vinod 461236030c
Merge pull request #3798 from weedySeaDragon/bug/1952-stateDiagram--classDef-fix-classes-type
bug: State diagram  fix classes type
2022-11-17 22:01:09 +05:30
Sidharth Vinod 8cc291162f
Merge pull request #3735 from aloisklink/ci/disable-pinning-dependencies
CI: disable pinning dependencies
2022-11-17 21:59:06 +05:30
Sidharth Vinod b83ba4d293
fix: Move redirection to router 2022-11-17 11:14:15 +05:30