Making timeline diagram lazy-loaded internal, removing separate package

This commit is contained in:
ashishj
2023-01-26 10:29:35 +01:00
25 changed files with 114 additions and 156 deletions

View File

@@ -10,7 +10,8 @@
timeline
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook : Google
2004 : Facebook
: Google
2005 : Youtube
2006 : Twitter
```
@@ -290,16 +291,4 @@ Let's put them to use, and see how our sample diagram looks in different themes:
2010 : Pinterest
```
## Integrating with your library/website.
Timeline uses the experimental lazy loading & async rendering features which could change in the future.
```html
<script type="module">
import mermaid from '<CDN_URL>/mermaid@<MERMAID_VERSION>/dist/mermaid.esm.min.mjs';
import timeline from '<CDN_URL>/@mermaid-js/mermaid-timeline@<MERMAID_VERSION>/dist/mermaid-timeline.esm.min.mjs';
await mermaid.registerExternalDiagrams([timeline]);
</script>
```
You can also refer the implementation in the live editor [here](https://github.com/mermaid-js/mermaid-live-editor/blob/fcf53c98c25604c90a218104268c339be53035a6/src/lib/util/mermaid.ts) to see how the async loading is done.