Skip to content

Commit 1ab5b4d

Browse files
committed
Major refactoring
1 parent 095a0bd commit 1ab5b4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1425
-852
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
target/
2+
pom.xml.tag
3+
pom.xml.releaseBackup
4+
pom.xml.versionsBackup
5+
pom.xml.next
6+
release.properties
7+
dependency-reduced-pom.xml
8+
buildNumber.properties
9+
.mvn/timing.properties

README

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
## What is LDViewer?
2+
3+
4+
LDViewer is a Google Web Toolkit (GWT) widget containing a [processingjs][0] sketch for visualizing [LD triangle plots][1].
5+
6+
7+
## How do I use it?
8+
9+
Following steps are required:
10+
11+
12+
Either create new interface that extends or create a class that implements the base interface `ProcessingInstance` and annotate it with `@JsType`. To interact with methods on the processing sketch define methods on that interface (i.e. `testMethod`):
13+
14+
```JAVA
15+
LDViewer ldviewer = new LDViewer();
16+
ldviewer.load(new Runnable() {
17+
@Override
18+
public void run() {
19+
GWT.log("LDViewer loaded");
20+
// Interact with sketch
21+
ldviewer.showLDValues();
22+
}
23+
});
24+
```
25+
To display data following information users have to call the `showLDValues()` function with following parameter:
26+
- position: Array of integer
27+
- r2Values: multi-dimensional array of floats in a [triangular matrix][7] form.
28+
- start: start position (should be the first position of the position array)
29+
- end: end position (should be the last position of the position array)
30+
31+
An [example of this data][8] can be found in the sample application and one could load it this way:
32+
33+
```JAVA
34+
final String jsonData = GET_FROM_CLIENTBUNDLE OR AJAX CALL
35+
LDData data = JsonUtils.safeEval(jsonData);
36+
```
37+
38+
## How do I install it?
39+
40+
If you're using Maven, you can add the following to your `<dependencies>`
41+
section:
42+
43+
```xml
44+
<dependency>
45+
<groupId>com.github.timeu.gwt-libs.ldviewer</groupId>
46+
<artifactId>ldviewer</artifactId>
47+
<version>1.0.0</version>
48+
</dependency>
49+
```
50+
51+
LDViewer uses [GWT 2.7's][4] new [JSInterop feature][5] and thus it has to be enabled in the GWT compiler args.
52+
For maven:
53+
```xml
54+
<compilerArgs>
55+
<compilerArg>-XjsInteropMode</compilerArg>
56+
<compilerArg>JS</compilerArg>
57+
</compilerArgs>
58+
```
59+
or passing it to the compiler via `-XjsInteropMode`
60+
61+
You can also download the [jar][1] directly or check out the source using git
62+
from <https://github.com/timeu/ldviewer.git> and build it yourself. Once
63+
you've installed LDViewer, be sure to inherit the module in your .gwt.xml
64+
file like this:
65+
66+
```xml
67+
<inherits name='com.github.timeu.gwtlibs.ldviewer.LDViewer'/>
68+
```
69+
70+
## Where can I learn more?
71+
72+
* Check out the [sample app][2] ([Source Code][3]) for a full example of using LDViewer.
73+
74+
[0]: http://processingjs.org
75+
[1]: http://www.nature.com/nrg/journal/v4/n8/fig_tab/nrg1123_F1.html
76+
[2]: http://search.maven.org/remotecontent?filepath=com/github/timeu/dygraphs-gwt/dygraphs-gwt/1.0.0/dygraphs-gwt-1.0.0.jar
77+
[2]: https://timeu.github.io/processing-js-gwt
78+
[3]: https://github.com/timeu/processing-js-gwt/tree/master/processingjs-gwt-sample
79+
[4]: http://www.gwtproject.org/release-notes.html#Release_Notes_2_7_0_RC1
80+
[5]: https://docs.google.com/document/d/1tir74SB-ZWrs-gQ8w-lOEV3oMY6u6lF2MmNivDEihZ4/edit#
81+
[6]: https://github.com/timeu/LDViewer
82+
[7]: https://en.wikipedia.org/wiki/Triangular_matrix
83+
[8]: https://github.com/timeu/ldviewer/ldviewer-sample/src/main/resources/sample/client/data/ld_sample_data.json

ldviewer-sample/pom.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>com.github.timeu.gwt-libs.ldviewer</groupId>
5+
<artifactId>ldviewer-parent</artifactId>
6+
<version>1.0.0-SNAPSHOT</version>
7+
</parent>
8+
9+
<artifactId>ldviewer-sample</artifactId>
10+
<packaging>gwt-app</packaging>
11+
12+
<name>LDViewer Sample Application</name>
13+
14+
<build>
15+
<plugins>
16+
<plugin>
17+
<groupId>net.ltgt.gwt.maven</groupId>
18+
<artifactId>gwt-maven-plugin</artifactId>
19+
<configuration>
20+
<moduleName>${gwt.module}</moduleName>
21+
<moduleShortName>${gwt.shortName}</moduleShortName>
22+
</configuration>
23+
</plugin>
24+
<plugin>
25+
<groupId>com.github.github</groupId>
26+
<artifactId>site-maven-plugin</artifactId>
27+
<version>0.12</version>
28+
<configuration>
29+
<message>Creating site for ${project.version}</message>
30+
<outputDirectory>${project.build.directory}/${artifactId}-${version}/${gwt.shortName}</outputDirectory>
31+
</configuration>
32+
<executions>
33+
<execution>
34+
<goals>
35+
<goal>site</goal>
36+
</goals>
37+
<phase>site</phase>
38+
</execution>
39+
</executions>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
<dependencies>
44+
<dependency>
45+
<groupId>com.google.gwt</groupId>
46+
<artifactId>gwt-user</artifactId>
47+
</dependency>
48+
<dependency>
49+
<groupId>com.google.gwt</groupId>
50+
<artifactId>gwt-dev</artifactId>
51+
<scope>provided</scope>
52+
</dependency>
53+
<dependency>
54+
<groupId>com.github.timeu.gwt-libs.ldviewer</groupId>
55+
<artifactId>ldviewer</artifactId>
56+
<type>gwt-lib</type>
57+
</dependency>
58+
</dependencies>
59+
</project>

0 commit comments

Comments
 (0)