Skip to content

Commit 7127792

Browse files
committed
Merge branch 'refactor'
* refactor: Major refactor. Switched to new JsInterop. Simplified code
2 parents bd4e16c + 772ab4b commit 7127792

File tree

81 files changed

+1623
-2747
lines changed

Some content is hidden

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

81 files changed

+1623
-2747
lines changed

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
target/
2+
3+
*.class
4+
5+
# Package Files #
6+
*.jar
7+
*.war
8+
9+
# gwt caches and compiled units #
10+
war/gwt_bree/
11+
gwt-unitCache/
12+
13+
# boilerplate generated classes #
14+
.apt_generated/
15+
16+
# more caches and things from deploy #
17+
war/WEB-INF/deploy/
18+
war/WEB-INF/classes/

CHANGELOG

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
August 31, 2015 - Release 1.0.0
2+
* Major refactor. Moved to GWT 2.8.0 and new JsInterop
3+
* Upgraded to ProcessingJS library 1.0.0
4+
* Added unit tests
5+
16
March 26, 2014 - Release 0.4.9
27
* pom.xml: GWT version updated to 2.5.1 and dependencies updated to latest version
38

README

-54
This file was deleted.

README.md

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
## What is GeneViewer?
2+
3+
4+
GeneViewer is a Google Web Toolkit (GWT) widget containing a [processingjs][0] sketch for visualizing gene models.
5+
6+
![GeneViewer](https://raw.githubusercontent.com/timeu/GeneViewer/master/geneviewer.png "GeneViewer")
7+
8+
9+
## How do I use it?
10+
11+
Following steps are required:
12+
13+
```JAVA
14+
GeneViewer geneviewer = new GeneViewer();
15+
geneviewer.load(new Runnable() {
16+
@Override
17+
public void run() {
18+
GWT.log("GeneViewer loaded");
19+
// Interact with sketch
20+
JsArrayMixed data = getData();
21+
geneviewer.setGeneData(data);
22+
}
23+
});
24+
```
25+
To display the gene models the user has to call the `setGEneData(JsArrayMixed data)` function.
26+
The `JsArrayMixed` data consists of a list of genes in JSON format. There are 2 visualization modes:
27+
1. Simple gene models without any features (See [sample data][1]).
28+
2. Gene Models with features (see [sample data][2] and screenshot).
29+
30+
Example of data with features:
31+
32+
```JSON
33+
[
34+
[10421840,10424113,1,"AT2G24530.1",
35+
[
36+
[10422416,10422596,1,"five_prime_UTR"],
37+
[10422272,10422312,1,"five_prime_UTR"],
38+
[10421840,10421930,1,"five_prime_UTR"],
39+
[10422416,10424113,1,"exon"],
40+
[10423820,10424113,1,"three_prime_UTR"],
41+
[10422272,10422312,1,"exon"],
42+
[10421840,10421930,1,"exon"],
43+
[10422596,10423820,1,"CDS"]
44+
]
45+
]
46+
]
47+
```
48+
49+
The data can be loaded this way:
50+
51+
```JAVA
52+
final String jsonData = GET_FROM_CLIENTBUNDLE OR AJAX CALL
53+
JsArrayMixed data = JsonUtils.safeEval(jsonData);
54+
```
55+
56+
## How do I install it?
57+
58+
If you're using Maven, you can add the following to your `<dependencies>`
59+
section:
60+
61+
```xml
62+
<dependency>
63+
<groupId>com.github.timeu.gwtlibs.geneviewer</groupId>
64+
<artifactId>geneviewer</artifactId>
65+
<version>1.0.0</version>
66+
</dependency>
67+
```
68+
69+
GeneViewer uses [GWT 2.7's][3] new [JSInterop feature][4] and thus it has to be enabled in the GWT compiler args.
70+
For maven:
71+
```xml
72+
<compilerArgs>
73+
<compilerArg>-XjsInteropMode</compilerArg>
74+
<compilerArg>JS</compilerArg>
75+
</compilerArgs>
76+
```
77+
or passing it to the compiler via `-XjsInteropMode`
78+
79+
You can also download the [jar][5] directly or check out the source using git
80+
from <https://github.com/timeu/geneviewer.git> and build it yourself. Once
81+
you've installed LDViewer, be sure to inherit the module in your .gwt.xml
82+
file like this:
83+
84+
```xml
85+
<inherits name='com.github.timeu.gwtlibs.geneviewer.GeneViewer'/>
86+
```
87+
88+
## Where can I learn more?
89+
90+
* Check out the [sample app][6] ([Source Code][7]) for a full example of using GeneViewer.
91+
92+
[0]: http://processingjs.org
93+
[1]: https://github.com/timeu/GeneViewer/blob/master/geneviewer-sample/src/main/resources/sample/client/data/genes.json
94+
[2]: https://github.com/timeu/GeneViewer/blob/master/geneviewer-sample/src/main/resources/sample/client/data/genes_with_features.json
95+
[3]: http://www.gwtproject.org/release-notes.html#Release_Notes_2_7_0_RC1
96+
[4]: https://docs.google.com/document/d/1tir74SB-ZWrs-gQ8w-lOEV3oMY6u6lF2MmNivDEihZ4/edit#
97+
[5]:
98+
[6]: http://timeu.github.io/GeneViewer
99+
[7]: https://github.com/timeu/GeneViewer/tree/master/geneviewer-sample

geneviewer-sample/pom.xml

+59
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.geneviewer</groupId>
5+
<artifactId>geneviewer-parent</artifactId>
6+
<version>1.0.0-SNAPSHOT</version>
7+
</parent>
8+
9+
<artifactId>geneviewer-sample</artifactId>
10+
<packaging>gwt-app</packaging>
11+
12+
<name>GeneViewer 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.geneviewer</groupId>
55+
<artifactId>geneviewer</artifactId>
56+
<type>gwt-lib</type>
57+
</dependency>
58+
</dependencies>
59+
</project>

0 commit comments

Comments
 (0)