Including d3.js using JsniBundle

52 views
Skip to first unread message

Lee Torrence

unread,
Oct 18, 2014, 3:26:14 PM10/18/14
to gwtq...@googlegroups.com
Has anyone successfully used JsniBundle to include d3.js?

public interface D3Bundle extends JsniBundle {
@LibrarySource("d3.js")
public void initD3();
}



I get the following exception:

15:23:06.029 [ERROR] [showcase] Line 1199: illegal character
>   var Ï€ = Math.PI, Ï„ = 2 * Ï€, halfÏ€ = Ï€ / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = Ï€ / 180, d3_degrees = 180 / Ï€;

Which is due to an encoding issue. But I'm not sure how to resolve it.

The JsniBundle looks like a great tool, wish there was a little more documentation around it. I'm not completely sure how to call methods on the D3 library once I get it loaded - is the only way to use JsUtils.runJavascriptFunction ?.

Lee Torrence

unread,
Oct 18, 2014, 3:37:28 PM10/18/14
to gwtq...@googlegroups.com
Was able to get it loaded by passing -Dfile.encoding=UTF-8 to my launch configuration. Still would be interested in any docs/advice on using JsniBundle though.

Lee
Reply all
Reply to author
Forward
0 new messages