Dygraphs-GWT is a wrapper for the dygraphs chart library. The wrapper makes it easy to use dygraphs in any GWT application by providing a type-safe abstraction of the dygraphs API.
Following steps are required:
GeneViewer geneviewer = new GeneViewer();
geneviewer.load(new Runnable() {
@Override
public void run() {
GWT.log("GeneViewer loaded");
// Interact with sketch
JsArrayMixed data = getData();
geneviewer.setGeneData(data);
}
});
If you're using Maven, you can add the following to your <dependencies>
section:
<dependency>
<groupId>com.github.timeu.dygraphs-gwt</groupId>
<artifactId>dygraphs-gwt</artifactId>
<version>1.0.0</version>
</dependency>
GeneViewer uses GWT 2.8's new JSInterop feature and thus it has to be enabled in the GWT compiler args. For maven:
<compilerArgs>
<compilerArg>-generateJsInteropExports</compilerArg>
</compilerArgs>
or passing it to the compiler via -generateJsInteropExports
You can also download the jar directly or check out the source using git from https://github.com/timeu/dygraphs-gwt.git and build it yourself. Once you've installed Dygraphs-GWT, be sure to inherit the module in your .gwt.xml file like this:
<inherits name='com.github.timeu.Dygraphs'/>
- Check out the sample app (Source Code) for a full example of using GeneViewer.