Uncaught SyntaxError: Unexpected token < sigma.parseGexf.js:3
Uncaught TypeError: Object #<m> has no method 'parseGexf'
tap5-sigma.js:24
Are you sure sigma.parseGexf.js is correct? What's in line 24 of
tap5-sigma.js? Anyway, it seems that now this error is completely about
Sigma and JavaScript and not about Tapestry itself. What Tapestry version
are you using? JavaScript minification is enabled?
On Thu, 04 Jul 2013 01:36:04 -0300, George Ludwig <[email protected]>
wrote:
I'm at a point where it seems to me that it really should be working,
yet I
get this error in the javascript console:
The method it can't find, parseGexf, is in the file sigma.parseGexf.js,
and
I've included it in the component's java file:
@Import(library={"classpath:com/intuit/tapestry5/sigmajs/asset/sigma.min.js",
"classpath:com/intuit/tapestry5/sigmajs/asset/sigma.parseGexf.js",
"classpath:com/intuit/tapestry5/sigmajs/asset/tap5-sigma.js"})
Here is the complete javascript file that is being executed in order to
do
the initialization:
var sigmajs = Class.create();
sigmajs.prototype = {
initialize : function(id, gexfFile) {
// Instantiate sigma.js and customize rendering
var sigInst = sigma.init(document.getElementById(id)).drawingProperties({
<<--- no error is thrown here
defaultLabelColor : '#fff',
defaultLabelSize : 14,
defaultLabelBGColor : '#fff',
defaultLabelHoverColor : '#000',
labelThreshold : 6,
defaultEdgeType : 'curve'
}).graphProperties({
minNodeSize : 0.5,
maxNodeSize : 5,
minEdgeSize : 1,
maxEdgeSize : 1
}).mouseProperties({
maxRatio : 32
});
// Parse a GEXF encoded file to fill the graph
sigInst.parseGexf(gexfFile); <<--- error is thrown
here
// Draw the graph :
sigInst.draw();
}
}
This seems to be a load order issue, yet I tried swapping the order of
declaration of sigma.parseGexf.js and sigma.min.js, with the same result.
Any thoughts?
-George
On Tue, Jul 2, 2013 at 5:43 PM, George Ludwig
<[email protected]>wrote:
Cool, thanks a lot!
On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
[email protected]> wrote:
On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig
<[email protected]>
wrote:
I think I got it...so to initialize my graph I need to pas it a file
name...is it most appropriate to use JavaScriptSupport.**
addInitializerCall()
so that the name of the file can be pulled from the @parameter of the
component?
For the parameter, it will make no difference. Regardless of using
addScript() or addInitializerCall() you'll need to pass the file name
in
the parameters of these methods. As you've never did this before, use
addScript(), which is easier.
--
Thiago H. de Paula Figueiredo
------------------------------**------------------------------**---------
To unsubscribe, e-mail:
users-unsubscribe@tapestry.**apache.org<[email protected]>
For additional commands, e-mail: [email protected]
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]