adrai / adrai/flowchart.js

Method outlined in README failing due to TypeError

Offen
#82 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
8.7k
Forks
1.2k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

I have been trying to try out flowchart.js using this HTML file:

``` html





var diagram = flowchart.parse("the code definition");
diagram.drawSVG('diagram');

// you can also try to pass options:

diagram.drawSVG('diagram', {
'x': 0,
'y': 0,
'line-width': 3,
'line-length': 50,
'text-margin': 10,
'font-size': 14,
'font-color': 'black',
'line-color': 'black',
'element-color': 'black',
'fill': 'white',
'yes-text': 'yes',
'no-text': 'no',
'arrow-end': 'block',
'scale': 1,
// style symbol types
'symbols': {
'start': {
'font-color': 'red',
'element-color': 'green',
'fill': 'yellow'
},
'end':{
'class': 'end-element'
}
},
// even flowstate support ;-)
'flowstate' : {
'past' : { 'fill' : '#CCCCCC', 'font-size' : 12},
'current' : {'fill' : 'yellow', 'font-color' : 'red', 'font-weight' : 'bold'},
'future' : { 'fill' : '#FFFF99'},
'request' : { 'fill' : 'blue'},
'invalid': {'fill' : '#444444'},
'approved' : { 'fill' : '#58C4A3', 'font-size' : 12, 'yes-text' : 'APPROVED', 'no-text' : 'n/a' },
'rejected' : { 'fill' : '#C45879', 'font-size' : 12, 'yes-text' : 'n/a', 'no-text' : 'REJECTED' }
}
})




```

(which is copied from http://flowchart.js.org/) but whenever I open this HTML file in my browser I get the following error in my console:

``` js
raphael.min.js:11Uncaught TypeError: Cannot read property 'x' of undefinedr._engine.create @ raphael.min.js:11r @ raphael.min.js:9FlowChart @ flowchart-latest.js:725chart.drawSVG @ flowchart-latest.js:561(anonymous function) @ layout.html:7
```

the raphael.min.js file I used is the exact same one used by the example page (http://flowchart.js.org/raphael-min.js) and the flowchart-latest.js I used was also that used on the example page (i.e., http://flowchart.js.org/flowchart-latest.js). My knowledge of JS is fairly limited, I am merely using flowchart.js to draw diagrams on [my website](https://fusion809.github.io).

Thanks for your time,
Brenton

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.