Closed valtih1978 closed 9 years ago
I have the same problem (using 0.4.1). Debugging in Chrome, I can see the following error in alchemy.js, line 1015, function deselectAll():
a = Alchemy.prototype.getInst(this);
Examining variable a shows that it is undefined.
I have solved it by switching into Almende network.
The problem is that a.vis
creates an svg
element with an attribute alchInst
in the method startGraph
, which uses Alchemy.prototype.instances.length - 1
. This array doesn't get pushed to until the end of the method Alchemy.prototype.begin
, with startGraph
being called before, meaning the Alchemy.prototype.instances.length
is 0 instead of 1.
A quick fix is to move Alchemy.prototype.instances.push(this);
above the switch statement in Alchemy.prototype.begin
:
Alchemy.prototype.begin = function(userConf) {
var conf;
conf = this.setConf(userConf);
Alchemy.prototype.instances.push(this);
switch (typeof this.conf.dataSource) {
case 'string':
d3.json(this.a.conf.dataSource, this.a.startGraph);
break;
case 'object':
this.a.startGraph(this.a.conf.dataSource);
}
this.plugins.init();
return this;
};
I'll add a pull request for this later.
When I click the canvas,
Uncaught TypeError: Cannot read property 'vis' of undefined
appears in the browser log.It is
when I load this from local web server
Sorry, but your project is a piece of crap. Might be it is good library but trying your examples/docs exposes it this way. Many docs are missing. For instance, clicking docs->styling->nodeStyling sends me to and empty page.
PS. I have determined that if configuration is specified via url, like
dataSource:charlize-demo.json
then no errors occurs. But why should I specify my configuration in external file?I have noticed that you use corrupt javascript dictionary constant. They do not permit unquoted keys, like key:"value". You demand "key": "value". You demand the quoting the keys. But verbosity does not save anything.
I have discovered nodeStyle example in the doc
but you do not separate colors in the subnodes with commas as JSON requires and function must return the radius. Javascript is not that functional language sot that you can omit the return.
I started conf.editorEnabled and got 'editor unknown' error.