How to drawSVG in a dom
- Vorherrschende Sprache
- JavaScript
- Sterne
- 8.7k
- Forks
- 1.2k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
This plugin is awesome, thanks to contributors.
I want to write a `markdown-it` plugin support for flowchart,
and i need to drawSVG in a dom like this:
`javascript`:
```javascript
var FlowChart = require('flowchart.js');
var diagram = FlowChart.parse(
"st=>start: Start:>http://www.google.com[blank]\n"+
"e=>end:>http://www.google.com\n"+
"op1=>operation: My Operation\n" +
"sub1=>subroutine: My Subroutine\n" +
"cond=>condition: Yes\n" +
"or No?:>http://www.google.com\n" +
"io=>inputoutput: catch something...\n" +
"\n" +
"st->op1->cond\n" +
"cond(yes)->io->e\n" +
"cond(no)->sub1(right)->op1\n"
);
var dom = document.createElement('div');
diagram.drawSVG(dom);
// document.appendChild(dom);
var _dia = document.getElementById('diagram');
_dia.appendChild(dom);
```
`html`:
```html
```
but it cause some problem
1. The size of box not correct:

2. The console show me that:

I have no idea how to fix it, help please.
Thanks for your time.
I am a chinease, sorry about for my english.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start by reproducing the provided browser example using FlowChart.parse and diagram.drawSVG(dom), then inspect the two reported symptoms: incorrect box sizing and the console message. Compare the result with the expected diagram in the attached images; done means the SVG renders with correct box dimensions and without the reported console problem.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100