Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mermaidAPI gantt Vue.js #621

Closed
mbertrandtrellisrx opened this issue Jan 31, 2018 · 2 comments
Closed

mermaidAPI gantt Vue.js #621

mbertrandtrellisrx opened this issue Jan 31, 2018 · 2 comments

Comments

@mbertrandtrellisrx
Copy link

I'm using the mermaid package in Vue.js. I can successfully generate flowcharts - but if I paste in the samples for sequence or gantt - it does not successfully generate them. Are other people using mermaidAPI successfuly with gantt charts?

import mermaidAPI from 'mermaid'

in mounted
var config = {
startOnLoad: false
};
mermaidAPI.initialize(config);
this.mermaidEle = this.$el.querySelector("#therapy123")

        var that = this
        this.insertSvg = function(svgCode, bindFunctions) {
              that.mermaidEle.innerHTML = svgCode;
        }

in render method
var graphCode = 'gantt\n' +
'dateFormat YYYY-MM-DD\n' +
'title Adding GANTT diagram to mermaid\n' +
'\n' +
'section A section\n' +
'Completed task :done, des1, 2014-01-06,2014-01-08\n' +
'Active task :active, des2, 2014-01-09, 3d\n' +
'Future task : des3, after des2, 5d\n' +
'Future task2 : des4, after des3, 5d',

        var graph = mermaidAPI.render("therapy123", graphCode, this.insertSvg);
@GMaxera
Copy link

GMaxera commented Feb 16, 2018

I'm using mermaid for flowchart, but I tested the graph you posted and it's working fine for me.
Although I use a different method for inject the SVG into the HTML.
I don't use .innerHTML function, but instead the v-html bind of Vue.js

Are you still having problem on visualise it ?

@tylerlong
Copy link
Collaborator

I have no experience with Vue. But here is a working project in React: https://github.com/mermaidjs/mermaid-live-editor

Invoke mermaid.init(undefined, this.container) to render the chart. Feel free to create a new issue if you still cannot get it work.

mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 12.2.2 to 12.3.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](lint-staged/lint-staged@v12.2.2...v12.3.2)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants