Skip to content

timeu/LDViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is LDViewer?

LDViewer is a Google Web Toolkit (GWT) widget containing a processingjs sketch for visualizing LD triangle plots.

LDViewer

How do I use it?

Following steps are required:

LDViewer ldviewer = new LDViewer();
ldviewer.load(new Runnable() {
   @Override
   public void run() {
       GWT.log("LDViewer loaded");
       // Interact with sketch
       ldviewer.showLDValues();
   }
});

To display data users have to call the showLDValues(int[] positions,float[][] r2Values, int start, int end) function with following parameters:

  • positions: Array of integer
  • r2Values: multi-dimensional array of floats in a triangular matrix form.
  • start: start position (should be the first position of the position array)
  • end: end position (should be the last position of the position array)

An example of this data can be found in the sample application and one could load it this way:

final String jsonData = GET_FROM_CLIENTBUNDLE OR AJAX CALL
LDData data = JsonUtils.safeEval(jsonData);

How do I install it?

If you're using Maven, you can add the following to your <dependencies> section:

    <dependency>
      <groupId>com.github.timeu.gwtlibs.ldviewer</groupId>
      <artifactId>ldviewer</artifactId>
      <version>1.0.0</version>
    </dependency>

LDViewer 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/ldviewer.git and build it yourself. Once you've installed LDViewer, be sure to inherit the module in your .gwt.xml file like this:

    <inherits name='com.github.timeu.gwtlibs.ldviewer.LDViewer'/>

Where can I learn more?

About

GWT visualization widget for display ld plots

Resources

License

Stars

Watchers

Forks

Packages

No packages published