├── gwt-d3-demo
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── github
│ │ │ │ └── gwtd3
│ │ │ │ └── demo
│ │ │ │ └── client
│ │ │ │ ├── .gitignore
│ │ │ │ ├── democases
│ │ │ │ ├── .gitignore
│ │ │ │ ├── svg
│ │ │ │ │ ├── SymbolDemo.css
│ │ │ │ │ ├── LineDemo.css
│ │ │ │ │ ├── brush
│ │ │ │ │ │ ├── BrushTransitionsDemo.css
│ │ │ │ │ │ ├── OrdinalBrushingDemo.css
│ │ │ │ │ │ ├── ScatterPlotMatrixDemo.css
│ │ │ │ │ │ └── BrushAsSliderDemo.css
│ │ │ │ │ └── ArcDemo.ui.xml
│ │ │ │ ├── ChordDiagramStyles.css
│ │ │ │ ├── GeneralUpdatePattern2Styles.css
│ │ │ │ ├── GeneralUpdatePattern1Styles.css
│ │ │ │ ├── test
│ │ │ │ │ ├── CaliforniaJson.java
│ │ │ │ │ └── Data.java
│ │ │ │ ├── geom
│ │ │ │ │ ├── ShapeTweeningDemo.css
│ │ │ │ │ ├── HullDemo.css
│ │ │ │ │ └── VoronoiTessellationDemo.css
│ │ │ │ ├── layout
│ │ │ │ │ ├── ClusterDendogram.css
│ │ │ │ │ └── RadialReingoldTilfordTree.css
│ │ │ │ ├── GeneralUpdatePattern3Styles.css
│ │ │ │ ├── BarChartStyles.css
│ │ │ │ ├── FocusAndContextStyles.css
│ │ │ │ ├── Margin.java
│ │ │ │ └── AxisComponentStyles.css
│ │ │ │ ├── test
│ │ │ │ ├── ui
│ │ │ │ │ ├── TestResultType.java
│ │ │ │ │ ├── TestPhase.java
│ │ │ │ │ ├── RunUiHandlers.java
│ │ │ │ │ └── TestExecution.java
│ │ │ │ ├── TestCase.java
│ │ │ │ └── AbstractBehaviourTest.java
│ │ │ │ ├── DemoCase.java
│ │ │ │ ├── Factory.java
│ │ │ │ └── testcases
│ │ │ │ ├── TestThatFails.java
│ │ │ │ ├── TestThatThrowsAnError.java
│ │ │ │ ├── scales
│ │ │ │ └── TestTimeScale.java
│ │ │ │ └── core
│ │ │ │ └── TestFormat.java
│ │ ├── webapp
│ │ │ ├── test-data
│ │ │ │ ├── test.csv
│ │ │ │ └── test.tsv
│ │ │ ├── favicon.ico
│ │ │ ├── .gitignore
│ │ │ ├── demo-data
│ │ │ │ ├── data.tsv
│ │ │ │ └── sp500.csv
│ │ │ ├── index.html
│ │ │ ├── D3Demo.css
│ │ │ └── WEB-INF
│ │ │ │ ├── appengine-web.xml
│ │ │ │ ├── web.xml
│ │ │ │ └── logging.properties
│ │ └── .gitignore
│ └── test
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── gwtd3
│ │ └── demo
│ │ └── client
│ │ ├── conditions
│ │ ├── WebElementsCondition.java
│ │ ├── ClassCondition.java
│ │ ├── CssPropertyCondition.java
│ │ ├── OrCondition.java
│ │ ├── AndCondition.java
│ │ └── CssColorPropertyEquals.java
│ │ ├── assertions
│ │ ├── ElementPageObjectAssert.java
│ │ ├── PageObjectAssert.java
│ │ └── ColorAssert.java
│ │ ├── pageobjects
│ │ ├── TestCaseButton.java
│ │ ├── DemoDragMultiple.java
│ │ ├── NavigationButton.java
│ │ └── AbstractDemoPage.java
│ │ └── testcases
│ │ └── ITTestCases.java
└── .gitignore
├── id_rsa.enc
├── gwt-d3-api
├── src
│ ├── test
│ │ └── java
│ │ │ └── META-INF
│ │ │ └── MANIFEST.MF
│ └── main
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── gwtd3
│ │ ├── api
│ │ ├── geo
│ │ │ ├── ConicProjection.java
│ │ │ └── Projection.java
│ │ ├── interpolators
│ │ │ ├── package-info.java
│ │ │ ├── CallableInterpolator.java
│ │ │ ├── AbstractInterpolatorFactory.java
│ │ │ ├── JavascriptFunctionInterpolatorDecorator.java
│ │ │ ├── JavascriptFunctionInterpolator.java
│ │ │ ├── InterpolatorFactory.java
│ │ │ └── JSNIInterpolatorFactory.java
│ │ ├── Sort.java
│ │ ├── functions
│ │ │ ├── NestFunction.java
│ │ │ ├── TimerFunction.java
│ │ │ ├── BooleanDatumFunction.java
│ │ │ └── DatumFunction.java
│ │ ├── utils
│ │ │ └── Utils.java
│ │ ├── IsFunction.java
│ │ ├── dsv
│ │ │ ├── DsvObjectAccessor.java
│ │ │ ├── DsvRows.java
│ │ │ ├── DsvRow.java
│ │ │ └── DsvCallback.java
│ │ ├── layout
│ │ │ └── SeparationFunction.java
│ │ ├── core
│ │ │ ├── ObjectAccessor.java
│ │ │ └── Prefix.java
│ │ ├── D3Event.java
│ │ ├── scales
│ │ │ └── QuantitativeScale.java
│ │ ├── ease
│ │ │ ├── JavascriptEasingFunction.java
│ │ │ ├── Mode.java
│ │ │ └── EasingFunction.java
│ │ ├── tweens
│ │ │ └── TweenFunction.java
│ │ ├── arrays
│ │ │ ├── ForEachCallback.java
│ │ │ ├── NumericForEachCallback.java
│ │ │ └── ArrayIterator.java
│ │ └── behaviour
│ │ │ └── Behavior.java
│ │ └── D3.gwt.xml
└── .gitignore
├── .gitignore
├── .gitattributes
├── id_rsa.pub
├── .travis.yml
├── [D3Demo] GWT Compile.launch
├── [D3] Compile.launch
├── [D3] License.launch
├── LICENSE
├── [D3Demo] Launch SuperDevMode.html.launch
└── .travis
├── deploy_on_maven_central.sh
└── settings.xml
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/id_rsa.enc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gwtd3/gwt-d3/HEAD/id_rsa.enc
--------------------------------------------------------------------------------
/gwt-d3-api/src/test/java/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/.gitignore:
--------------------------------------------------------------------------------
1 | /LineChartDemo.java
2 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/test-data/test.csv:
--------------------------------------------------------------------------------
1 | Name,Age
2 | Paul,25
3 | John,38
4 | Jane,15
5 | Bruce,48
6 | Emma,28
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/test-data/test.tsv:
--------------------------------------------------------------------------------
1 | Name Age
2 | Paul 25
3 | John 38
4 | Jane 15
5 | Bruce 48
6 | Emma 28
7 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gwtd3/gwt-d3/HEAD/gwt-d3-demo/src/main/webapp/favicon.ico
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/.gitignore:
--------------------------------------------------------------------------------
1 | /.project
2 | /.settings
3 | /pom.xml.releaseBackup
4 | /release.properties
5 | /target
6 | /pom.xml.next
7 | /pom.xml.tag
8 | d3demo/
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/.gitignore:
--------------------------------------------------------------------------------
1 | /.project
2 | /.settings
3 | /pom.xml.releaseBackup
4 | /release.properties
5 | /target
6 | /pom.xml.next
7 | /pom.xml.tag
8 | gwt-unitCache/
9 | d3demo/
--------------------------------------------------------------------------------
/gwt-d3-api/.gitignore:
--------------------------------------------------------------------------------
1 | /.gwt
2 | /.settings
3 | /target
4 | /pom.xml.releaseBackup
5 | /.classpath
6 | /.project
7 | /pom.xml.next
8 | /pom.xml.tag
9 | /release.properties
10 | /gwt-unitCache
11 | /war
12 |
--------------------------------------------------------------------------------
/gwt-d3-demo/.gitignore:
--------------------------------------------------------------------------------
1 | /.settings
2 | /target
3 | /.classpath
4 | /.project
5 | /pom.xml.releaseBackup
6 | /nbactions.xml
7 | /.gwt
8 | /.factorypath
9 | /pom.xml.next
10 | /pom.xml.tag
11 | /gwt-unitCache
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.project
2 | /.settings
3 | /pom.xml.releaseBackup
4 | /release.properties
5 | /target
6 | /pom.xml.next
7 | /pom.xml.tag
8 | gwt-unitCache/
9 | d3demo/
10 | /.DS_Store
11 | /id_rsa
12 | .idea/
13 | **/*.iml
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | *.java text diff=java
5 | *.html text diff=html
6 | *.xml text diff=xml
7 | *.css text
8 | *.js text
9 | *.sql text
10 |
11 | *.docx diff=astextplain
12 | *.DOCX diff=astextplain
--------------------------------------------------------------------------------
/id_rsa.pub:
--------------------------------------------------------------------------------
1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCRnGBeIMOqs/o8fQZr+fTZ3JSPCNiFdreUiScr9M9h7J8PuP99vyJCtlizxgrd9p1FU6UpQBH3fVfKNNLjE2eiiUX0iOwLfRmVCRKmC4M+fp29EPEJh1avvGdI0kUXZPY6Ke6HZI8K+AxydvHqf2UpdBC1bpYgfWdrhMt4Es1KF5MtvhTsm0Se6Pcf9qiYxqMM1I0xJRHz6fFSJmJahwshIVUTBNZkN5RS7oyRygsuc+N2XVpJ9l9NnuyMw/FdyiWJhljrV/slEvLT+yTWDHgmy0PohVac92rgCzRp1Cns5OQxBvlYAsN/K6TRFANCjEve20Oo1r0codHNBtOjP+8B build@travis-ci.org
2 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/demo-data/data.tsv:
--------------------------------------------------------------------------------
1 | letter frequency
2 | A .08167
3 | B .01492
4 | C .02780
5 | D .04253
6 | E .12702
7 | F .02288
8 | G .02022
9 | H .06094
10 | I .06973
11 | J .00153
12 | K .00747
13 | L .04025
14 | M .02517
15 | N .06749
16 | O .07507
17 | P .01929
18 | Q .00098
19 | R .05987
20 | S .06333
21 | T .09056
22 | U .02758
23 | V .01037
24 | W .02465
25 | X .00150
26 | Y .01971
27 | Z .00074
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - oraclejdk8
4 | install:
5 | - if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import; fi
6 | - if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
7 | - chmod +x .travis/*.sh
8 | - ls -al .travis
9 | deploy:
10 | -
11 | provider: script
12 | script:
13 | - .travis/deploy_on_maven_central.sh
14 | skip_cleanup: true
15 | on:
16 | repo: gwtd3/gwt-d3
17 | branch: master
18 | jdk: oraclejdk8
19 | -
20 | provider: script
21 | script:
22 | - .travis/deploy_on_maven_central.sh
23 | - .travis/deploy_demo_on_github.sh
24 | skip_cleanup: true
25 | on:
26 | repo: gwtd3/gwt-d3
27 | tags: true
28 | jdk: oraclejdk8
29 |
--------------------------------------------------------------------------------
/[D3Demo] GWT Compile.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/[D3] Compile.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/[D3] License.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013, Anthony Schiochet and Eric Citaire
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
15 | derived from this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/svg/SymbolDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | path.symboldemo {
30 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/index.html:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/svg/LineDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | path.linedemo{
30 | fill: none;
31 | stroke: red;
32 | }
33 |
34 | circle.linedemo{
35 | fill: black;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/conditions/WebElementsCondition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.conditions;
30 |
31 | public class WebElementsCondition {
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/ChordDiagramStyles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | body {
30 | font: 10px sans-serif;
31 | }
32 |
33 | .chord path {
34 | fill-opacity: .67;
35 | stroke: #000;
36 | stroke-width: .5px;
37 | }
38 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/geo/ConicProjection.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.geo;
30 |
31 | public class ConicProjection extends Projection {
32 |
33 | protected ConicProjection() {
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/interpolators/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | * TODO: interpolator factory API is a work in progress.
31 | *
32 | *
33 | * @since 1.0
34 | */
35 | package com.github.gwtd3.api.interpolators;
36 |
37 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/GeneralUpdatePattern2Styles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | .gup2 text {
30 | font: bold 48px monospace;
31 | }
32 |
33 | .gup2 .enter {
34 | fill: green;
35 | }
36 |
37 | .gup2 .update {
38 | fill: #333;
39 | }
40 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/Sort.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api;
30 |
31 | import com.google.gwt.core.client.JavaScriptObject;
32 |
33 | public class Sort extends JavaScriptObject {
34 | protected Sort() {
35 | super();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/GeneralUpdatePattern1Styles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | .gup1 text {
30 | font: bold 48px monospace;
31 | }
32 |
33 | .gup1 .enter {
34 | fill: green;
35 | }
36 |
37 | .gup1 .update {
38 | fill: #333;
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/test/CaliforniaJson.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.democases.test;
30 |
31 | import com.google.gwt.resources.client.TextResource;
32 |
33 | public interface CaliforniaJson extends TextResource {
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/[D3Demo] Launch SuperDevMode.html.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/geom/ShapeTweeningDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @CHARSET "UTF-8";
30 |
31 | .demo {
32 | fill: #ccc;
33 | stroke: #000;
34 | }
35 |
36 | .intersection{
37 | fill: none;
38 | stroke: #f00;
39 | stroke-width: 2px;
40 | stroke-dasharray: 9, 5;
41 | }
42 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/D3Demo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /** Add css rules here for your application. */
30 |
31 | /*
32 | Zoom Demo
33 | */
34 |
35 | .zoom svg {
36 | font: 10px
37 | }
38 |
39 | .zoom rect {
40 | fill : #ddd;
41 | }
42 |
43 | .zoom .axis path, .zoom .axis line {
44 | fill : none;
45 | stroke : #fff;
46 | }
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/functions/NestFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.functions;
30 |
31 | /**
32 | * A function invoked by D3
33 | *
34 | *
35 | * @author Anthony Schiochet
36 | *
37 | */
38 | public interface NestFunction {
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/layout/ClusterDendogram.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | .node circle {
30 | fill: #fff;
31 | stroke: steelblue;
32 | stroke-width: 1.5px;
33 | }
34 |
35 | .node {
36 | font: 10px sans-serif;
37 | }
38 |
39 | .link {
40 | fill: none;
41 | stroke: #ccc;
42 | stroke-width: 1.5px;
43 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/layout/RadialReingoldTilfordTree.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | .node circle {
30 | fill: #fff;
31 | stroke: steelblue;
32 | stroke-width: 1.5px;
33 | }
34 |
35 | .node {
36 | font: 10px sans-serif;
37 | }
38 |
39 | .link {
40 | fill: none;
41 | stroke: #ccc;
42 | stroke-width: 1.5px;
43 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/GeneralUpdatePattern3Styles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | .gup3 .enter {
30 | fill: green;
31 | font: bold 48px monospace;
32 | }
33 |
34 | .gup3 .update {
35 | fill: #333;
36 | font: bold 48px monospace;
37 | }
38 |
39 |
40 | .gup3 .exit {
41 | fill: brown;
42 | font: bold 48px monospace;
43 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/test/ui/TestResultType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.test.ui;
33 |
34 | /**
35 | * @author Anthony Schiochet
36 | *
37 | */
38 | public enum TestResultType {
39 | SUCCESS,
40 | FAILURE,
41 | ERROR;
42 | }
43 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/BarChartStyles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | body {
30 | font: 10px sans-serif;
31 | }
32 |
33 | .x {
34 | }
35 |
36 | .y {
37 | }
38 |
39 | .axis path,
40 | .axis line {
41 | fill: none;
42 | stroke: #000;
43 | shape-rendering: crispEdges;
44 | }
45 |
46 | .bar {
47 | fill: steelblue;
48 | }
49 |
50 | .x.axis path {
51 | display: none;
52 | }
53 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/test/ui/TestPhase.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.test.ui;
33 |
34 | /**
35 | * @author Anthony Schiochet
36 | *
37 | */
38 | public enum TestPhase {
39 | WAITING,
40 | STARTED,
41 | SETTING_UP,
42 | RUNNING,
43 | TEARING_DOWN,
44 | FINISHED;
45 | }
46 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/utils/Utils.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.utils;
30 |
31 | public class Utils {
32 |
33 | /**
34 | * @param b the Boolean wrapper
35 | * @return false if b is null of false, true otherwise
36 | */
37 | public static boolean toPrimitive(final Boolean b) {
38 | return b == null ? false : b.booleanValue();
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/DemoCase.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client;
33 |
34 | import com.google.gwt.user.client.ui.IsWidget;
35 |
36 | /**
37 | * @author Anthony Schiochet
38 | *
39 | */
40 | public interface DemoCase extends IsWidget {
41 |
42 | public void start();
43 |
44 | public void stop();
45 | }
46 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/geom/HullDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | rect.hulldemo {
30 | fill: none;
31 | pointer-events: all;
32 | stroke: black;
33 | stroke-width: 1px;
34 | }
35 |
36 | .hulldemo {
37 | fill: steelblue;
38 | stroke: steelblue;
39 | stroke-width: 32px;
40 | stroke-linejoin: round;
41 | }
42 |
43 | circle.hulldemo {
44 | fill: white;
45 | stroke: black;
46 | stroke-width: 1.5px;
47 | }
--------------------------------------------------------------------------------
/.travis/deploy_on_maven_central.sh:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | # All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are met:
7 | #
8 | # * Redistributions of source code must retain the above copyright notice, this
9 | # list of conditions and the following disclaimer.
10 | #
11 | # * Redistributions in binary form must reproduce the above copyright notice,
12 | # this list of conditions and the following disclaimer in the documentation
13 | # and/or other materials provided with the distribution.
14 | #
15 | # * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | # derived from this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | #
29 |
30 | if [ ! -z "$TRAVIS_TAG" ]
31 | then
32 | echo "on a tag -> set pom.xml to $TRAVIS_TAG"
33 | mvn --settings .travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion=$TRAVIS_TAG 1>/dev/null 2>/dev/null
34 | else
35 | echo "not on a tag -> keep snapshot version in pom.xml"
36 | fi
37 |
38 | mvn --settings .travis/settings.xml clean deploy -Dmaven.javadoc.failOnError=false -B -U -V -P selenium
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/test/ui/RunUiHandlers.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.test.ui;
33 |
34 | /**
35 | * @author Anthony Schiochet
36 | *
37 | */
38 | public interface RunUiHandlers {
39 |
40 | public void start();
41 |
42 | public void stop();
43 |
44 | public void onShowTestResults(String results);
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/IsFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.api;
33 |
34 | import com.google.gwt.core.client.JavaScriptObject;
35 |
36 | /**
37 | * A marker interface to identify {@link JavaScriptObject} representing functions.
38 | *
39 | *
40 | * @author Anthony Schiochet
41 | *
42 | */
43 | public interface IsFunction {
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/FocusAndContextStyles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @external .extent;
30 |
31 | svg.fac {
32 | font: 10px sans-serif;
33 | }
34 |
35 | .fac path {
36 | fill: steelblue;
37 | }
38 |
39 | .axis path,
40 | .axis line {
41 | fill: none;
42 | stroke: #000;
43 | shape-rendering: crispEdges;
44 | }
45 |
46 | .brush .extent {
47 | stroke: #fff;
48 | fill-opacity: .125;
49 | shape-rendering: crispEdges;
50 | }
51 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/dsv/DsvObjectAccessor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.dsv;
30 |
31 | import com.github.gwtd3.api.core.ObjectAccessor;
32 |
33 | /**
34 | * An accessor function which is passed to {@link Dsv#parse(String, DsvObjectAccessor)}.
35 | *
36 | * @author Eric Citaire
37 | *
38 | * @param
39 | */
40 | public interface DsvObjectAccessor extends ObjectAccessor {}
41 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/dsv/DsvRows.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.dsv;
30 |
31 | import com.github.gwtd3.api.arrays.Array;
32 |
33 | /**
34 | * A {@link DsvRows} represent the array of parsed rows in a DSV file.
35 | *
36 | * @author Eric Citaire
37 | *
38 | * @param
39 | */
40 | public class DsvRows extends Array {
41 | protected DsvRows() {
42 | super();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/WEB-INF/appengine-web.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 | gwt-d3
34 | hourly
35 | true
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/layout/SeparationFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.layout;
30 |
31 | /**
32 | * Separation function used in {@link #separation(Object, Object)} method.
33 | *
34 | * @param
35 | */
36 | public interface SeparationFunction {
37 | /**
38 | * Return the separation to be used between the 2 nodes
39 | *
40 | * @param a
41 | * @param b
42 | * @return
43 | */
44 | double separation(T a, T b);
45 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/Factory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client;
30 |
31 | public abstract class Factory {
32 |
33 | public abstract DemoCase newInstance();
34 |
35 | public String id() {
36 | String name = this.getClass().getName();
37 | name = name.substring(name.lastIndexOf('.') + 1);
38 | // inner class
39 | if (name.contains("$")) {
40 | name = name.substring(0, name.lastIndexOf("$"));
41 | }
42 | return name;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/Margin.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.democases;
30 |
31 | public class Margin {
32 | public final int top;
33 | public final int right;
34 | public final int bottom;
35 | public final int left;
36 |
37 | public Margin(final int top, final int right, final int bottom,
38 | final int left) {
39 | super();
40 | this.top = top;
41 | this.right = right;
42 | this.bottom = bottom;
43 | this.left = left;
44 | }
45 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/assertions/ElementPageObjectAssert.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.assertions;
30 |
31 | import com.github.gwtd3.demo.client.pageobjects.ElementPageObject;
32 |
33 | public class ElementPageObjectAssert, A extends ElementPageObject>>
34 | extends PageObjectAssert {
35 |
36 | protected ElementPageObjectAssert(A actual, Class> selfType) {
37 | super(actual, selfType);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/assertions/PageObjectAssert.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.assertions;
30 |
31 | import org.assertj.core.api.AbstractAssert;
32 | import com.github.gwtd3.demo.client.pageobjects.PageObject;
33 |
34 | public class PageObjectAssert, A extends PageObject>> extends AbstractAssert {
35 |
36 | protected PageObjectAssert(A actual, Class> selfType) {
37 | super(actual, selfType);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
37 |
38 | D3Demo.html
39 |
40 |
41 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/test/TestCase.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.test;
33 |
34 | import com.google.gwt.user.client.ui.ComplexPanel;
35 |
36 | /**
37 | * @author Anthony Schiochet
38 | *
39 | */
40 | public interface TestCase {
41 |
42 | public void setUp(ComplexPanel sandbox);
43 |
44 | public void doTest(ComplexPanel sandbox);
45 |
46 | public void tearDown(ComplexPanel sandbox);
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/WEB-INF/logging.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | # All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are met:
7 | #
8 | # * Redistributions of source code must retain the above copyright notice, this
9 | # list of conditions and the following disclaimer.
10 | #
11 | # * Redistributions in binary form must reproduce the above copyright notice,
12 | # this list of conditions and the following disclaimer in the documentation
13 | # and/or other materials provided with the distribution.
14 | #
15 | # * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | # derived from this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | #
29 |
30 | # A default java.util.logging configuration.
31 | # (All App Engine logging is through java.util.logging by default).
32 | #
33 | # To use this configuration, copy it into your application's WEB-INF
34 | # folder and add the following to your appengine-web.xml:
35 | #
36 | #
37 | #
38 | #
39 | #
40 |
41 | # Set the default logging level for all loggers to WARNING
42 | .level = CONFIG
43 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/core/ObjectAccessor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.core;
30 |
31 | import com.github.gwtd3.api.dsv.DsvRow;
32 |
33 | public interface ObjectAccessor {
34 | /**
35 | * The accessor function which transform a {@link DsvRow} in an other type
36 | * T.
37 | *
38 | * @param row
39 | * the current DSV row
40 | * @param index
41 | * index of the current DSV row
42 | * @return
43 | */
44 | T apply(D data, int index);
45 | }
46 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/pageobjects/TestCaseButton.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.pageobjects;
30 |
31 | import com.github.gwtd3.demo.client.D3Demo.TestButton;
32 |
33 | public class TestCaseButton extends NavigationButton {
34 |
35 | protected TestCaseButton(DemoApplication app) {
36 | super(app, TestButton.ID);
37 | }
38 |
39 | @Override
40 | protected TestSuiteScreen navigateToPageObject() {
41 | return new TestSuiteScreen(getParent());
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/svg/brush/BrushTransitionsDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @external .extent ;
30 |
31 | .bt {
32 | position: relative;
33 | width: 960px;
34 | }
35 |
36 | .point {
37 | fill: #999;
38 | stroke: #fff;
39 | }
40 |
41 | .point.selected {
42 | fill: red;
43 | fill-opacity: 1;
44 | stroke: brown;
45 | }
46 |
47 | .bt .brush .extent {
48 | stroke: #fff;
49 | fill-opacity: .125;
50 | shape-rendering: crispEdges;
51 | }
52 |
53 | .bt button {
54 | position: absolute;
55 | right: 30px;
56 | top: 30px;
57 | }
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/D3Event.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api;
30 |
31 | import com.google.gwt.user.client.Event;
32 |
33 | public class D3Event extends Event {
34 |
35 | protected D3Event() {
36 | super();
37 | }
38 |
39 | /**
40 | * Returns the source event that triggered this instance.
41 | *
42 | * This
43 | *
44 | * @return the source event
45 | */
46 | public native final T sourceEvent() /*-{
47 | return this.sourceEvent;
48 | }-*/;
49 | }
50 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/svg/ArcDemo.ui.xml:
--------------------------------------------------------------------------------
1 |
31 |
32 |
34 |
35 | /* Add CSS here. See the GWT docs on UI Binder for more details */
36 | .inline {
37 | display: inline-block;
38 | vertical-align: top;
39 | fill: #ff0000;
40 | }
41 |
42 |
43 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/functions/TimerFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.functions;
30 |
31 | import com.github.gwtd3.api.D3;
32 |
33 | /**
34 | * A function to be used with {@link D3#timer()}.
35 | *
36 | *
37 | * @author Anthony Schiochet
38 | *
39 | */
40 | public interface TimerFunction {
41 |
42 | /**
43 | * Return true to stop the timer, false to continue.
44 | *
45 | * @return true to stop the timer, false to continue.
46 | */
47 | boolean execute();
48 | }
49 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/testcases/TestThatFails.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.testcases;
33 |
34 | import com.github.gwtd3.demo.client.test.AbstractTestCase;
35 |
36 | import com.google.gwt.user.client.ui.ComplexPanel;
37 |
38 | /**
39 | * @author Anthony Schiochet
40 | *
41 | */
42 | public class TestThatFails extends AbstractTestCase {
43 |
44 | @Override
45 | public void doTest(final ComplexPanel sandbox) {
46 | throw new AssertionError("fake assertionerror to test");
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/testcases/TestThatThrowsAnError.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.testcases;
33 |
34 | import com.github.gwtd3.demo.client.test.AbstractTestCase;
35 |
36 | import com.google.gwt.user.client.ui.ComplexPanel;
37 |
38 | /**
39 | * @author Anthony Schiochet
40 | *
41 | */
42 | public class TestThatThrowsAnError extends AbstractTestCase {
43 |
44 | @Override
45 | public void doTest(final ComplexPanel sandbox) {
46 | throw new NullPointerException("fake NPE to test");
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/svg/brush/OrdinalBrushingDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @external .extent;
30 |
31 | .ob svg {
32 | font: 10px sans-serif;
33 | }
34 |
35 | .ob path {
36 | -webkit-transition: fill-opacity 250ms linear;
37 | }
38 |
39 | .selecting path {
40 | fill-opacity: .2;
41 | }
42 |
43 | .selecting path.selected {
44 | stroke: #f00;
45 | stroke-width: 2px;
46 | }
47 |
48 | .axis path, .axis line {
49 | fill: none;
50 | stroke: #000;
51 | shape-rendering: crispEdges;
52 | }
53 |
54 | .brush .extent {
55 | stroke: #fff;
56 | fill-opacity: .125;
57 | shape-rendering: crispEdges;
58 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/svg/brush/ScatterPlotMatrixDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @external .extent;
30 |
31 | .spm svg {
32 | font: 10px sans-serif;
33 | padding: 10px;
34 | }
35 |
36 | .axis,
37 | .frame {
38 | shape-rendering: crispEdges;
39 | }
40 |
41 | .axis line {
42 | stroke: #ddd;
43 | }
44 |
45 | .axis path {
46 | display: none;
47 | }
48 |
49 | .frame {
50 | fill: none;
51 | stroke: #aaa;
52 | }
53 |
54 | .spm circle {
55 | fill-opacity: .7;
56 | }
57 |
58 | .spm circle.hidden {
59 | fill: #ccc !important;
60 | }
61 |
62 | .extent {
63 | fill: #000;
64 | fill-opacity: .125;
65 | stroke: #fff;
66 | }
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/scales/QuantitativeScale.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.api.scales;
33 |
34 | /**
35 | * Quantitative scales have a continuous domain:
36 | *
37 | *
{@link ContinuousQuantitativeScale} have a continuous output range
38 | *
{@link DiscreteQuantitativeScale} have a discrete output range
39 | *
40 | *
41 | *
42 | * @author Anthony Schiochet
43 | *
44 | */
45 | public abstract class QuantitativeScale> extends
46 | Scale {
47 |
48 | protected QuantitativeScale() {
49 |
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/svg/brush/BrushAsSliderDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @external .domain;
30 |
31 | .axis {
32 | font: 10px sans-serif;
33 | -webkit-user-select: none;
34 | -moz-user-select: none;
35 | user-select: none;
36 | }
37 |
38 | .axis .domain {
39 | fill: none;
40 | stroke: #000;
41 | stroke-opacity: .3;
42 | stroke-width: 10px;
43 | stroke-linecap: round;
44 | }
45 |
46 | .axis .halo {
47 | fill: none;
48 | stroke: #ddd;
49 | stroke-width: 8px;
50 | stroke-linecap: round;
51 | }
52 |
53 | .slider .handle {
54 | fill: #fff;
55 | stroke: #000;
56 | stroke-opacity: .5;
57 | stroke-width: 1.25px;
58 | cursor: crosshair;
59 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/AxisComponentStyles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @external .tick,.major,.minor;
30 |
31 | text{
32 | font: 10px sans-serif;
33 | }
34 |
35 | .svg {
36 |
37 | margin: 0;
38 | }
39 |
40 |
41 |
42 | path.line {
43 | fill: none;
44 | stroke: #666;
45 | stroke-width: 1.5px;
46 | }
47 |
48 | path.area {
49 | fill: #e7e7e7;
50 | }
51 |
52 | .axis {
53 | shape-rendering: crispEdges;
54 | }
55 |
56 | .x.axis line {
57 | stroke: #fff;
58 | }
59 |
60 | .x.axis .minor {
61 | stroke-opacity: .5;
62 | }
63 |
64 | .x.axis path {
65 | display: none;
66 | }
67 |
68 | .y.axis line, .y.axis path {
69 | fill: none;
70 | stroke: #000;
71 | }
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/ease/JavascriptEasingFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.ease;
30 |
31 | import com.google.gwt.core.client.JavaScriptObject;
32 |
33 |
34 | /**
35 | * JSNI easing functions.
36 | *
37 | * @author Anthony Schiochet
38 | *
39 | */
40 | public class JavascriptEasingFunction extends JavaScriptObject implements EasingFunction{
41 |
42 | protected JavascriptEasingFunction() {
43 | }
44 |
45 | /* (non-Javadoc)
46 | * @see com.github.gwtd3.api.ease.EasingFunction#ease(double)
47 | */
48 | @Override
49 | public native final double ease(double t)/*-{
50 | return this(t);
51 | }-*/;
52 | }
53 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/geom/VoronoiTessellationDemo.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | @external .q0-9,.q1-9,.q2-9,.q3-9,.q4-9,.q5-9,.q6-9,.q7-9,.q8-9;
30 |
31 | .vt path {
32 | stroke: #fff;
33 | }
34 |
35 | .vt path:first-child {
36 | fill: yellow !important;
37 | }
38 |
39 | .vt circle {
40 | fill: #000;
41 | pointer-events: none;
42 | }
43 |
44 | .q0-9 { fill: rgb(197,27,125); }
45 | .q1-9 { fill: rgb(222,119,174); }
46 | .q2-9 { fill: rgb(241,182,218); }
47 | .q3-9 { fill: rgb(253,224,239); }
48 | .q4-9 { fill: rgb(247,247,247); }
49 | .q5-9 { fill: rgb(230,245,208); }
50 | .q6-9 { fill: rgb(184,225,134); }
51 | .q7-9 { fill: rgb(127,188,65); }
52 | .q8-9 { fill: rgb(77,146,33); }
53 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/ease/Mode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.ease;
30 |
31 | public enum Mode {
32 |
33 | /**
34 | * The identity function
35 | */
36 | IN("in"),
37 |
38 | /**
39 | * reverses the easing direction [1,0]
40 | */
41 | OUT("out"),
42 |
43 | /**
44 | * copies and mirrors the easing function from [0,.5] and [.5,1].
45 | */
46 | IN_OUT("in-out"),
47 |
48 | /**
49 | * copies and mirrors the easing function from [1,.5] and [.5,0].
50 | */
51 | OUT_IN("out-in");
52 |
53 | private String value;
54 |
55 | private Mode(final String value) {
56 | this.value = value;
57 | }
58 |
59 | public String getValue() {
60 | return value;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/assertions/ColorAssert.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.assertions;
30 |
31 | import org.assertj.core.api.AbstractAssert;
32 | import org.openqa.selenium.support.Color;
33 |
34 | /**
35 | * Convenient assertions for a {@link Color}
36 | *
37 | * @author Anthony Schiochet
38 | *
39 | */
40 | public class ColorAssert extends AbstractAssert {
41 |
42 | public ColorAssert(Color actual, Class> selfType) {
43 | super(actual, selfType);
44 | }
45 |
46 | public ColorAssert isEqualTo(String expected) {
47 | return super.isEqualTo(Color.fromString(expected));
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/dsv/DsvRow.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.dsv;
30 |
31 | import com.github.gwtd3.api.core.Value;
32 |
33 | import com.google.gwt.core.client.JavaScriptObject;
34 |
35 | /**
36 | * Each row of a DSV file is represented by a {@link DsvRow}.
37 | *
38 | * @author Eric Citaire
39 | *
40 | */
41 | public class DsvRow extends JavaScriptObject {
42 | protected DsvRow() {
43 | super();
44 | }
45 |
46 | /**
47 | * Generic method to get the value of a named field.
48 | *
49 | * @param field
50 | * @return
51 | */
52 | public final native Value get(String field) /*-{
53 | return {
54 | datum : this[field]
55 | };
56 | }-*/;
57 | }
58 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/testcases/scales/TestTimeScale.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.testcases.scales;
30 |
31 | import com.github.gwtd3.api.D3;
32 | import com.github.gwtd3.api.arrays.Array;
33 | import com.github.gwtd3.demo.client.test.AbstractTestCase;
34 | import com.google.gwt.user.client.ui.ComplexPanel;
35 |
36 | public class TestTimeScale extends AbstractTestCase {
37 |
38 | @Override
39 | public void doTest(final ComplexPanel sandbox) {
40 | Array> domain = D3.time().scale().domain();
41 | assertEquals(2, domain.length());
42 | System.out.println(domain.getValue(0).asJsDate());
43 | System.out.println(domain.getValue(1).asJsDate());
44 | Array> range = D3.time().scale().range(Array.fromInts(0, 5)).range();
45 |
46 | // nice and count
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/D3.gwt.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
34 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/testcases/core/TestFormat.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.testcases.core;
30 |
31 | import com.github.gwtd3.api.D3;
32 | import com.github.gwtd3.api.core.Prefix;
33 | import com.github.gwtd3.demo.client.test.AbstractTestCase;
34 | import com.google.gwt.user.client.ui.ComplexPanel;
35 |
36 | public class TestFormat extends AbstractTestCase {
37 |
38 | @Override
39 | public void doTest(final ComplexPanel sandbox) {
40 | D3.format("%s").format(456.34);
41 | assertEquals(123.12,D3.round(123.1234,2));
42 | assertEquals("This is a 'quoted' string, yes \\? And the dots, like \\. are counted as \\{literals\\}",D3.requote("This is a 'quoted' string, yes ? And the dots, like . are counted as {literals}"));
43 | Prefix prefix = D3.formatPrefix(123456.12345, 1);
44 | assertEquals("k",prefix.symbol());
45 | assertEquals(1000.0,prefix.scale(1000000));
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/tweens/TweenFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.tweens;
30 |
31 | import com.github.gwtd3.api.core.Transition;
32 | import com.github.gwtd3.api.core.Value;
33 | import com.github.gwtd3.api.interpolators.Interpolator;
34 | import com.google.gwt.dom.client.Element;
35 |
36 | /**
37 | * A function returning an {@link Interpolator} used to tween elements attribute or styles within {@link Transition}s.
38 | *
39 | * @see Official attrTween function
40 | * @author Anthony Schiochet
41 | *
42 | */
43 | public interface TweenFunction {
44 |
45 | /**
46 | * @param context
47 | * @param datum
48 | * @param index
49 | * @param attributeValue
50 | * @return
51 | */
52 | Interpolator apply(Element context, Value datum, int index, Value value);
53 | }
54 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/geo/Projection.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.geo;
30 |
31 | import com.google.gwt.core.client.JavaScriptObject;
32 |
33 | //TODO: conic projection subclass with parallels() accessors
34 | public class Projection
> extends JavaScriptObject {
35 |
36 | protected Projection() {
37 |
38 | }
39 |
40 | public final native P rotate(double longitude, double latitude)/*-{
41 | return this.rotate([ longitude, latitude ]);
42 | }-*/;
43 |
44 | public final native P center(double longitude, double latitude)/*-{
45 | return this.center([ longitude, latitude ]);
46 | }-*/;
47 |
48 | /**
49 | * Sets the projection’s scale factor to the specified value and returns the
50 | * projection.
51 | *
52 | * @param factor
53 | * the scale
54 | * @return the projection
55 | */
56 | public final native P scale(double factor)/*-{
57 | return this.scale(factor);
58 | }-*/;
59 | }
60 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/interpolators/CallableInterpolator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.interpolators;
30 |
31 | import com.google.gwt.core.client.JavaScriptObject;
32 |
33 | /**
34 | * An interpolator that can be passed to JSNI.
35 | *
36 | * This is useful when you want to create an implementation of {@link Interpolator} in Java that must be used in JSNI side.
37 | *
38 | *
39 | * @author Anthony Schiochet (schiochetanthoni@gmail.com)
40 | *
41 | * @param
42 | * the type to be interpolated
43 | */
44 | public abstract class CallableInterpolator implements Interpolator {
45 |
46 | @Override
47 | public abstract T interpolate(double t);
48 |
49 | @Override
50 | public native final JavaScriptObject asJSOFunction() /*-{
51 | var self = this;
52 | return function(t) {
53 | return self.@com.github.gwtd3.api.interpolators.CallableInterpolator::interpolate(D)(t);
54 | }
55 | }-*/;
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/testcases/ITTestCases.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.testcases;
30 |
31 | import org.assertj.core.api.Assertions;
32 | import org.junit.Test;
33 |
34 | import com.github.gwtd3.demo.client.pageobjects.DemoApplication;
35 | import com.github.gwtd3.demo.client.pageobjects.TestSuiteScreen;
36 |
37 | public class ITTestCases extends AbstractSeleniumTest {
38 |
39 | @Test
40 | public void basic() throws Exception {
41 | DemoApplication application = DemoApplication.getInstance(driver);
42 | Assertions.assertThat(driver.getTitle()).isEqualTo("GWT-D3 Demo");
43 | }
44 |
45 | @Test
46 | public void testCasesPass() {
47 | DemoApplication application = DemoApplication.getInstance(driver);
48 |
49 | TestSuiteScreen testSuite = application.testCaseButton().click();
50 | testSuite.clickRun().waitTestsAreAllDone();
51 | Assertions.assertThat(testSuite.unitTestsAreSuccess()).isTrue();
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/conditions/ClassCondition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.conditions;
33 |
34 | import org.openqa.selenium.WebDriver;
35 | import org.openqa.selenium.WebElement;
36 |
37 | /**
38 | * Check condition
39 | *
40 | * @author Anthony Schiochet
41 | *
42 | */
43 | public class ClassCondition extends WebElementCondition {
44 |
45 | private final String className;
46 |
47 | public ClassCondition(final WebElement element, final String className) {
48 | super(element);
49 | this.className = className;
50 | }
51 |
52 | public ClassCondition(final String className) {
53 | super();
54 | this.className = className;
55 | }
56 |
57 | @Override
58 | public WebElement apply(final WebDriver input) {
59 | String actualValue = element.getAttribute("class");
60 | return actualValue.contains(className.trim()) ? element : null;
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/arrays/ForEachCallback.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.arrays;
30 |
31 | import com.github.gwtd3.api.core.Value;
32 |
33 | public interface ForEachCallback {
34 | /**
35 | * Executed for each element of the array with an assigned value.
36 | *
37 | * If a thisArg parameter is provided to {@link Array#forEach(ForEachCallback, Object)}, it will be used as the thisArg parameter for
38 | * each callback invocation.
39 | *
40 | * If thisArg is undefined or null, the this value within the function depends on whether the function is in strict mode or not (passed
41 | * value if in strict mode, global object if in non-strict mode).
42 | *
43 | * @see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach
44 | *
45 | * @param thisArg
46 | * @param element
47 | * @param index
48 | * @param array
49 | */
50 | T forEach(Object thisArg, Value element, int index, Array> array);
51 | }
52 |
--------------------------------------------------------------------------------
/.travis/settings.xml:
--------------------------------------------------------------------------------
1 |
31 |
35 |
36 |
37 |
38 | ossrh
39 | ${env.SONATYPE_USERNAME}
40 | ${env.SONATYPE_PASSWORD}
41 |
42 |
43 |
44 |
45 | ossrh
46 |
47 | true
48 |
49 |
50 | ${env.GPG_EXECUTABLE}
51 | ${env.GPG_PASSPHRASE}
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/behaviour/Behavior.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.api.behaviour;
33 |
34 | import com.github.gwtd3.api.core.Selection;
35 | import com.google.gwt.core.client.JavaScriptObject;
36 |
37 | /**
38 | * The behaviour module.
39 | *
40 | * @author Anthony Schiochet
41 | *
42 | */
43 | public class Behavior extends JavaScriptObject {
44 |
45 | protected Behavior() {
46 | }
47 |
48 | /**
49 | * Create a new {@link Drag} behavior, that you will configure and apply to
50 | * a {@link Selection}.
51 | *
52 | * @return the drag behaviour
53 | */
54 | public final native Drag drag()/*-{
55 | return this.drag();
56 | }-*/;
57 |
58 | /**
59 | * Create a new {@link Zoom} behavior, that you will configure and apply to
60 | * a {@link Selection}.
61 | *
62 | * @return the zoom behaviour
63 | */
64 | public final native Zoom zoom()/*-{
65 | return this.zoom();
66 | }-*/;
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/interpolators/AbstractInterpolatorFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.api.interpolators;
33 |
34 | import com.github.gwtd3.api.D3;
35 | import com.google.gwt.core.client.JavaScriptObject;
36 |
37 | /**
38 | * Use this class as a base class to create {@link InterpolatorFactory} implementations that can be passed to {@link D3#interpolators()
39 | * D3.interpolators().push()}.
40 | *
41 | *
42 | *
43 | * @author Anthony Schiochet
44 | *
45 | */
46 | public abstract class AbstractInterpolatorFactory implements InterpolatorFactory {
47 |
48 | @Override
49 | public abstract Interpolator create(final I a, final I b);
50 |
51 | @Override
52 | public final native JavaScriptObject asJSOFunction()/*-{
53 | return function(a, b) {
54 | return this.@com.github.gwtd3.api.interpolators.AbstractInterpolatorFactory::create(Ljava/lang/Object;Ljava/lang/Object;)();
55 | }
56 | }-*/;
57 | }
58 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/ease/EasingFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.ease;
30 |
31 | import com.github.gwtd3.api.core.Transition;
32 |
33 | /**
34 | * An easing function takes the current parameterized time value t in the domain [0,1],
35 | * and maps it to another value in a similar range; it is typically used to set {@link Transition#ease()}.
36 | *
37 | * Built-in {@link EasingFunction}s may be created using {@link Easing} factory.
38 | *
39 | * @author Anthony Schiochet
40 | *
41 | */
42 | public interface EasingFunction {
43 | /**
44 | * Given a parametric time t in the range [0,1], returns the eased time.
45 | *
46 | * The returned value is typically in the range [0,1] as well, but may
47 | * extend slightly beyond this range for certain easing functions, such as
48 | * "elastic".
49 | *
50 | *
51 | * @param t
52 | * the parametric time
53 | * @return the eased time
54 | */
55 | double ease(double t);
56 | }
57 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/interpolators/JavascriptFunctionInterpolatorDecorator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.interpolators;
30 |
31 | import com.github.gwtd3.api.core.Value;
32 |
33 | import com.google.gwt.core.client.JavaScriptObject;
34 |
35 | public class JavascriptFunctionInterpolatorDecorator implements Interpolator {
36 |
37 | protected JavascriptFunctionInterpolator delegate;
38 |
39 | public JavascriptFunctionInterpolatorDecorator(final JavascriptFunctionInterpolator delegate) {
40 | super();
41 | this.delegate = delegate;
42 | }
43 |
44 | @Override
45 | public JavaScriptObject asJSOFunction() {
46 | return delegate.asJSOFunction();
47 | }
48 |
49 | @Override
50 | public T interpolate(final double t) {
51 | return cast(delegate.interpolate(t));
52 | }
53 |
54 | /**
55 | * Cast the given value to the correct type.
56 | * @param v
57 | * @return
58 | */
59 | public T cast(final Value v) {
60 | return v.as();
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/dsv/DsvCallback.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.dsv;
30 |
31 | import com.google.gwt.core.client.JavaScriptObject;
32 |
33 | /**
34 | * When the CSV data is available, the specified callback will be invoked with
35 | * the parsed rows as the argument. If an error occurs, the callback function
36 | * will instead be invoked with null.
37 | *
38 | * @author Eric Citaire
39 | *
40 | * @param
41 | * the type of the parsed DSV line (if no accessor is provided, the
42 | * type will be {@link DsvRow})
43 | */
44 | public interface DsvCallback {
45 | /**
46 | * When the CSV data is available, the specified callback will be invoked
47 | * with the parsed rows as the argument. If an error occurs, the callback
48 | * function will instead be invoked with null.
49 | *
50 | * @param error the error, if any occurs.
51 | * @param rows the rows values, or null if an error occurs.
52 | */
53 | void get(JavaScriptObject error, DsvRows data);
54 | }
55 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/interpolators/JavascriptFunctionInterpolator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.interpolators;
30 |
31 | import com.github.gwtd3.api.D3;
32 | import com.github.gwtd3.api.core.Value;
33 | import com.google.gwt.core.client.JavaScriptObject;
34 |
35 | /**
36 | * An interpolator used when the interpolation function is provided by JSNI.
37 | *
38 | * This class is used by {@link D3} to allow java code to invoke built-in
39 | * interpolators. You should not instanciate this object unless you know what
40 | * you are doing.
41 | *
42 | *
43 | * @author Anthony Schiochet
44 | *
45 | */
46 | public class JavascriptFunctionInterpolator extends JavaScriptObject implements Interpolator {
47 |
48 | protected JavascriptFunctionInterpolator() {
49 | super();
50 | }
51 |
52 | @Override
53 | public final native Value interpolate(final double t)/*-{
54 | return {
55 | datum : this(t)
56 | };
57 | }-*/;
58 |
59 | @Override
60 | public final JavaScriptObject asJSOFunction() {
61 | return this;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/democases/test/Data.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.democases.test;
30 |
31 | import com.google.gwt.core.client.JsDate;
32 |
33 | /**
34 | * An exemple data parsed from the file test-data/readme.csv
35 | *
36 | */
37 | public class Data {
38 | private final String symbol;
39 |
40 | private final JsDate date;
41 |
42 | private final double price;
43 |
44 | /*
45 | * (non-Javadoc)
46 | *
47 | * @see java.lang.Object#toString()
48 | */
49 | @Override
50 | public String toString() {
51 | return "Data [date=" + date.getTime() + ", price=" + price + "]";
52 | }
53 |
54 | public Data(final String symbol, final JsDate date, final double price) {
55 | super();
56 | this.symbol = symbol;
57 | this.date = date;
58 | this.price = price;
59 | }
60 |
61 | public String getSymbol() {
62 | return symbol;
63 | }
64 |
65 | public JsDate getDate() {
66 | return date;
67 | }
68 |
69 | public double getPrice() {
70 | return price;
71 | }
72 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/webapp/demo-data/sp500.csv:
--------------------------------------------------------------------------------
1 | date,price
2 | Jan 2000,1394.46
3 | Feb 2000,1366.42
4 | Mar 2000,1498.58
5 | Apr 2000,1452.43
6 | May 2000,1420.6
7 | Jun 2000,1454.6
8 | Jul 2000,1430.83
9 | Aug 2000,1517.68
10 | Sep 2000,1436.51
11 | Oct 2000,1429.4
12 | Nov 2000,1314.95
13 | Dec 2000,1320.28
14 | Jan 2001,1366.01
15 | Feb 2001,1239.94
16 | Mar 2001,1160.33
17 | Apr 2001,1249.46
18 | May 2001,1255.82
19 | Jun 2001,1224.38
20 | Jul 2001,1211.23
21 | Aug 2001,1133.58
22 | Sep 2001,1040.94
23 | Oct 2001,1059.78
24 | Nov 2001,1139.45
25 | Dec 2001,1148.08
26 | Jan 2002,1130.2
27 | Feb 2002,1106.73
28 | Mar 2002,1147.39
29 | Apr 2002,1076.92
30 | May 2002,1067.14
31 | Jun 2002,989.82
32 | Jul 2002,911.62
33 | Aug 2002,916.07
34 | Sep 2002,815.28
35 | Oct 2002,885.76
36 | Nov 2002,936.31
37 | Dec 2002,879.82
38 | Jan 2003,855.7
39 | Feb 2003,841.15
40 | Mar 2003,848.18
41 | Apr 2003,916.92
42 | May 2003,963.59
43 | Jun 2003,974.5
44 | Jul 2003,990.31
45 | Aug 2003,1008.01
46 | Sep 2003,995.97
47 | Oct 2003,1050.71
48 | Nov 2003,1058.2
49 | Dec 2003,1111.92
50 | Jan 2004,1131.13
51 | Feb 2004,1144.94
52 | Mar 2004,1126.21
53 | Apr 2004,1107.3
54 | May 2004,1120.68
55 | Jun 2004,1140.84
56 | Jul 2004,1101.72
57 | Aug 2004,1104.24
58 | Sep 2004,1114.58
59 | Oct 2004,1130.2
60 | Nov 2004,1173.82
61 | Dec 2004,1211.92
62 | Jan 2005,1181.27
63 | Feb 2005,1203.6
64 | Mar 2005,1180.59
65 | Apr 2005,1156.85
66 | May 2005,1191.5
67 | Jun 2005,1191.33
68 | Jul 2005,1234.18
69 | Aug 2005,1220.33
70 | Sep 2005,1228.81
71 | Oct 2005,1207.01
72 | Nov 2005,1249.48
73 | Dec 2005,1248.29
74 | Jan 2006,1280.08
75 | Feb 2006,1280.66
76 | Mar 2006,1294.87
77 | Apr 2006,1310.61
78 | May 2006,1270.09
79 | Jun 2006,1270.2
80 | Jul 2006,1276.66
81 | Aug 2006,1303.82
82 | Sep 2006,1335.85
83 | Oct 2006,1377.94
84 | Nov 2006,1400.63
85 | Dec 2006,1418.3
86 | Jan 2007,1438.24
87 | Feb 2007,1406.82
88 | Mar 2007,1420.86
89 | Apr 2007,1482.37
90 | May 2007,1530.62
91 | Jun 2007,1503.35
92 | Jul 2007,1455.27
93 | Aug 2007,1473.99
94 | Sep 2007,1526.75
95 | Oct 2007,1549.38
96 | Nov 2007,1481.14
97 | Dec 2007,1468.36
98 | Jan 2008,1378.55
99 | Feb 2008,1330.63
100 | Mar 2008,1322.7
101 | Apr 2008,1385.59
102 | May 2008,1400.38
103 | Jun 2008,1280
104 | Jul 2008,1267.38
105 | Aug 2008,1282.83
106 | Sep 2008,1166.36
107 | Oct 2008,968.75
108 | Nov 2008,896.24
109 | Dec 2008,903.25
110 | Jan 2009,825.88
111 | Feb 2009,735.09
112 | Mar 2009,797.87
113 | Apr 2009,872.81
114 | May 2009,919.14
115 | Jun 2009,919.32
116 | Jul 2009,987.48
117 | Aug 2009,1020.62
118 | Sep 2009,1057.08
119 | Oct 2009,1036.19
120 | Nov 2009,1095.63
121 | Dec 2009,1115.1
122 | Jan 2010,1073.87
123 | Feb 2010,1104.49
124 | Mar 2010,1140.45
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/conditions/CssPropertyCondition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.conditions;
30 |
31 | import org.openqa.selenium.WebDriver;
32 | import org.openqa.selenium.WebElement;
33 |
34 | /**
35 | * A {@link WebElementCondition} on any css property.
36 | *
37 | * @author Anthony Schiochet
38 | *
39 | */
40 | public abstract class CssPropertyCondition extends WebElementCondition {
41 | protected String cssProperty;
42 |
43 | public CssPropertyCondition(final String cssProperty) {
44 | super();
45 | this.cssProperty = cssProperty;
46 | }
47 |
48 | public CssPropertyCondition(final WebElement element, final String cssProperty) {
49 | super(element);
50 | this.cssProperty = cssProperty;
51 | }
52 |
53 | @Override
54 | public WebElement apply(final WebDriver input) {
55 | String actualValue = element.getCssValue(cssProperty);
56 | return match(actualValue) ? element : null;
57 | }
58 |
59 | public abstract boolean match(final String actualValue);
60 | }
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/test/AbstractBehaviourTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.test;
33 |
34 | import com.google.gwt.dom.client.Element;
35 | import com.google.gwt.user.client.ui.ComplexPanel;
36 | import com.google.gwt.user.client.ui.Widget;
37 |
38 | /**
39 | * @author Anthony Schiochet
40 | *
41 | */
42 | public abstract class AbstractBehaviourTest extends AbstractTestCase {
43 |
44 |
45 | /*
46 | * (non-Javadoc)
47 | *
48 | * @see
49 | * com.github.gwtd3.demo.client.test.TestCase#doTest(com.google.gwt.user.client
50 | * .ui.ComplexPanel)
51 | */
52 | @Override
53 | public void doTest(final ComplexPanel sandbox) {
54 | given(sandbox);
55 | when(sandbox);
56 | then(sandbox);
57 | }
58 |
59 | /**
60 | * @param sandbox
61 | */
62 | protected abstract void then(ComplexPanel sandbox);
63 |
64 | /**
65 | * @param sandbox
66 | */
67 | protected abstract void when(ComplexPanel sandbox);
68 |
69 | /**
70 | * @param sandbox
71 | */
72 | protected abstract void given(ComplexPanel sandbox);
73 | }
74 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/conditions/OrCondition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.conditions;
30 |
31 | import org.openqa.selenium.WebDriver;
32 | import org.openqa.selenium.WebElement;
33 |
34 | public class OrCondition extends WebElementCondition {
35 |
36 | private WebElementCondition op1;
37 | private WebElementCondition op2;
38 |
39 | public OrCondition(final WebElementCondition op1, final WebElementCondition op2) {
40 | super();
41 | this.op1 = op1;
42 | this.op2 = op2;
43 | }
44 |
45 | public OrCondition(final WebElement element, final WebElementCondition op1, final WebElementCondition op2) {
46 | super(element);
47 | this.op1 = op1;
48 | this.op2 = op2;
49 | }
50 |
51 | @Override
52 | public WebElement apply(final WebDriver input) {
53 | WebElement el1 = op1.apply(input);
54 | return el1 != null ? el1 : op2.apply(input);
55 | }
56 |
57 | @Override
58 | public void setElement(final WebElement element) {
59 | super.setElement(element);
60 | op1.setElement(element);
61 | op2.setElement(element);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/conditions/AndCondition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.conditions;
30 |
31 | import org.openqa.selenium.WebDriver;
32 | import org.openqa.selenium.WebElement;
33 |
34 | public class AndCondition extends WebElementCondition {
35 |
36 | private WebElementCondition op1;
37 | private WebElementCondition op2;
38 |
39 | public AndCondition(final WebElementCondition op1, final WebElementCondition op2) {
40 | super();
41 | this.op1 = op1;
42 | this.op2 = op2;
43 | }
44 |
45 | public AndCondition(final WebElement element, final WebElementCondition op1, final WebElementCondition op2) {
46 | super(element);
47 | this.op1 = op1;
48 | this.op2 = op2;
49 | }
50 |
51 | @Override
52 | public WebElement apply(final WebDriver input) {
53 | WebElement el1 = op1.apply(input);
54 | return el1 == null ? null : op2.apply(input);
55 | }
56 |
57 | @Override
58 | public void setElement(final WebElement element) {
59 | super.setElement(element);
60 | op1.setElement(element);
61 | op2.setElement(element);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/conditions/CssColorPropertyEquals.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.conditions;
30 |
31 | import org.openqa.selenium.WebElement;
32 | import org.openqa.selenium.support.Color;
33 |
34 | /**
35 | * A css color
36 | * @author Anthony Schiochet
37 | *
38 | */
39 | public class CssColorPropertyEquals extends CssPropertyCondition {
40 |
41 | private String expectedColor;
42 |
43 | public CssColorPropertyEquals(final String cssColorProperty, final String expectedColor) {
44 | super(cssColorProperty);
45 | this.expectedColor = expectedColor;
46 | }
47 |
48 | public CssColorPropertyEquals(final WebElement element, final String cssColorProperty, final String expectedColor) {
49 | super(element, cssColorProperty);
50 | this.expectedColor = expectedColor;
51 | }
52 |
53 | @Override
54 | public boolean match(final String actualValue) {
55 | Color actualColor = Color.fromString(actualValue);
56 | Color expectedColor = Color.fromString(this.expectedColor);
57 | return actualColor.equals(expectedColor);
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/main/java/com/github/gwtd3/demo/client/test/ui/TestExecution.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.demo.client.test.ui;
33 |
34 | /**
35 | * @author Anthony Schiochet
36 | *
37 | */
38 | public class TestExecution {
39 | private final TestPhase phase;
40 | private final TestResult result;
41 | private final long timeForLastPhase;
42 | private final long totalTimeSinceStart;
43 |
44 | public TestExecution(final TestPhase phase, final TestResult result, final long timeForLastPhase, final long totalTimeSinceStart) {
45 | super();
46 | this.phase = phase;
47 | this.result = result;
48 | this.timeForLastPhase = timeForLastPhase;
49 | this.totalTimeSinceStart = totalTimeSinceStart;
50 | }
51 |
52 | public TestPhase getPhase() {
53 | return phase;
54 | }
55 |
56 | public TestResult getResult() {
57 | return result;
58 | }
59 |
60 | /**
61 | * @return the timeForLastPhase
62 | */
63 | public String getTimeForLastPhase() {
64 | return timeForLastPhase + "ms";
65 | }
66 |
67 | /**
68 | * @return the totalTimeSinceStart
69 | */
70 | public String getTotalTimeSinceStart() {
71 | return totalTimeSinceStart + "ms";
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/arrays/NumericForEachCallback.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.arrays;
30 |
31 | import com.github.gwtd3.api.core.Value;
32 |
33 | /**
34 | * Same as {@link ForEachCallback} but ensure the result is treated as a numeric double.
35 | *
36 | * @author Anthony Schiochet
37 | *
38 | */
39 | public interface NumericForEachCallback {
40 | /**
41 | * Executed for each element of the array with an assigned value.
42 | *
43 | * If a thisArg parameter is provided to {@link Array#forEach(NumericForEachCallback, Object)}, it will be used as
44 | * the thisArg parameter for each callback invocation.
45 | *
46 | * If thisArg is undefined or null, the this value within the function depends on whether the function is in strict
47 | * mode or not (passed value if in strict mode, global object if in non-strict mode).
48 | *
49 | * @see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach
50 | *
51 | * @param thisArg
52 | * @param element
53 | * @param index
54 | * @param array
55 | */
56 | double forEach(Object thisArg, Value element, int index, Array> array);
57 | }
58 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/core/Prefix.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.core;
30 |
31 | import com.github.gwtd3.api.D3;
32 | import com.google.gwt.core.client.JavaScriptObject;
33 |
34 | /**
35 | * A SI Prefix, as
36 | * returned by {@link D3#formatPrefix()}
37 | *
48 | *
49 | * @author Anthony Schiochet
50 | *
51 | */
52 | public class Prefix extends JavaScriptObject {
53 |
54 | protected Prefix() {
55 | }
56 |
57 | /**
58 | * Returns the prefix symbol, such as "M" for millions.
59 | *
60 | *
61 | * @return the prefix symbol
62 | */
63 | public native final String symbol()/*-{
64 | return this.symbol;
65 | }-*/;
66 |
67 | /**
68 | * Convert the number to the appropriate prefixed scale.
69 | *
70 | *
71 | * @param input
72 | * the number to convert
73 | * @return the converted number
74 | */
75 | public native final double scale(double input)/*-{
76 | return this.scale(input)
77 | }-*/;
78 | }
79 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/pageobjects/DemoDragMultiple.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.pageobjects;
30 |
31 | import org.openqa.selenium.By;
32 | import org.openqa.selenium.WebDriver;
33 | import org.openqa.selenium.WebElement;
34 | import org.openqa.selenium.support.Color;
35 |
36 | public class DemoDragMultiple extends AbstractDemoPage {
37 |
38 | protected DemoDragMultiple(final WebDriver driver, final DemoApplication parent) {
39 | super(parent);
40 | }
41 |
42 | public static class Circle extends ElementPageObject {
43 |
44 | public Circle(final DemoDragMultiple parent, final WebElement element) {
45 | super(parent, element);
46 | }
47 |
48 | /**
49 | * @return the cx element of any
50 | */
51 | public double cx() {
52 | return Double.parseDouble(element.getAttribute("cx"));
53 | }
54 |
55 | public double cy() {
56 | return Double.parseDouble(element.getAttribute("cy"));
57 | }
58 |
59 | public Color fillColor() {
60 | return getAttributeAsColor("fill");
61 | }
62 | }
63 |
64 | public Circle getCircle(final int i) {
65 | // generate something like circle:first-child + circle + circle
66 | return new Circle(this, findAll(By.tagName("circle")).get(i));
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/arrays/ArrayIterator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.arrays;
30 |
31 | import java.util.Iterator;
32 |
33 | /**
34 | * Internal iterator from a JsArray.
35 | *
36 | * The access method is abstract to allow casting
37 | * the returned type.
38 | *
39 | *
40 | * @author SCHIOCA
41 | *
42 | * @param
43 | */
44 | public abstract class ArrayIterator implements Iterator {
45 | /**
46 | *
47 | */
48 | private final Array array;
49 |
50 | /**
51 | * @param array
52 | */
53 | public ArrayIterator(final Array array) {
54 | this.array = array;
55 | }
56 |
57 | private int index = 0;
58 | private int lastReturnedIndex;
59 |
60 | @Override
61 | public boolean hasNext() {
62 | return index < this.array.length();
63 | }
64 |
65 | @Override
66 | public T next() {
67 | lastReturnedIndex = index;
68 | return accessObject(array, index++);
69 | }
70 |
71 | @Override
72 | public void remove() {
73 | if ((lastReturnedIndex >= 0) && (lastReturnedIndex < this.array.length())) {
74 | this.array.splice(lastReturnedIndex, 1);
75 | }
76 | }
77 |
78 | public abstract T accessObject(Array array, int index);
79 | }
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/interpolators/InterpolatorFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.api.interpolators;
33 |
34 | import com.google.gwt.core.client.JavaScriptObject;
35 |
36 | /**
37 | * Represents an object that can create an {@link Interpolator}.
38 | *
39 | * A factory should return null when no interpolators support the input arguments.
40 | *
41 | * @author Anthony Schiochet
42 | *
43 | */
44 | public interface InterpolatorFactory {
45 |
46 | /**
47 | * Create an interpolator appropriate for interpolating the input value, or return null if the factory does not support the two
48 | * specified input values.
49 | *
50 | *
51 | * @param a
52 | * the start input param
53 | * @param b
54 | * the end input param
55 | *
56 | * @return an appropriate interpolator or null if the factory does not support the input values.
57 | */
58 | Interpolator create(I a, I b);
59 |
60 | /**
61 | * Return a one-arg JS function wrapping the interpolation.
62 | *
63 | * Consider using {@link CallableInterpolator} for your own interpolation.
64 | *
65 | *
66 | * @return the JS function
67 | */
68 | public JavaScriptObject asJSOFunction();
69 | }
70 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/pageobjects/NavigationButton.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.pageobjects;
30 |
31 | /**
32 | * A clickable element that when clicked, reveal a part of the application.
33 | *
34 | * @author Anthony Schiochet
35 | *
36 | * @param
37 | * the part this button reveals.
38 | * @param
39 | * the parent of this {@link PageObject}
40 | */
41 | public abstract class NavigationButton> extends ElementPageObject
{
42 | /**
43 | * Create the button using the given parent and the button id of the element
44 | * in the parent.
45 | *
46 | * @param parent
47 | * @param buttonId
48 | */
49 | public NavigationButton(final P parent, final String buttonId) {
50 | super(parent, parent.findClickableById(buttonId, 18));
51 | }
52 |
53 | /**
54 | * Click the element and reveal it.
55 | *
56 | * @return
57 | */
58 | public S click() {
59 | clickOnElement();
60 | return navigateToPageObject();
61 | }
62 |
63 | /**
64 | * Create the part of the application that is revealed when the button is
65 | * clicked.
66 | *
67 | * @return the part of the application
68 | */
69 | protected abstract S navigateToPageObject();
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/functions/BooleanDatumFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.functions;
30 |
31 | import com.github.gwtd3.api.core.Selection;
32 | import com.github.gwtd3.api.core.Value;
33 | import com.google.gwt.dom.client.Element;
34 |
35 | /**
36 | * A function taking an element and the index of the element in the selection,
37 | * returning a boolean primitive value.
38 | *
39 | * Instances of this function are mainly used with mutator functions of {@link Selection}.
40 | *
41 | * @author Anthony Schiochet
42 | *
43 | */
44 | public interface BooleanDatumFunction {
45 |
46 | /**
47 | * Apply the function for the given {@link Element} at the specified index
48 | * of the {@link Selection} mapped to the given {@link Datum}.
49 | *
50 | * Note that if no datum is mapped to the element, {@link Datum#isUndefined()} will return true.
51 | *
52 | * @param context
53 | * the current element, may be irrelevant or null in some context.
54 | * @param d
55 | * the datum
56 | * @param index
57 | * the index of the element in the selection
58 | * @return a boolean value
59 | */
60 | boolean apply(Element context, Value d, int index);
61 | }
62 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/functions/DatumFunction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | /**
30 | *
31 | */
32 | package com.github.gwtd3.api.functions;
33 |
34 | import com.github.gwtd3.api.core.Selection;
35 | import com.github.gwtd3.api.core.Value;
36 | import com.google.gwt.dom.client.Element;
37 |
38 | /**
39 | * A function taking an element and the index of the element in the selection,
40 | * returning a value of type T.
41 | *
42 | * This function must be passed to mutator functions of {@link Selection} when you knows that nodes are not bound to any data.
43 | *
44 | * @author Anthony Schiochet
45 | *
46 | */
47 | public interface DatumFunction {
48 |
49 | /**
50 | * Apply the function for the given {@link Element} at the specified index
51 | * of the {@link Selection} mapped to the given {@link Datum}.
52 | *
53 | * Note that if no datum is mapped to the element, {@link Datum#isUndefined()} will return true.
54 | *
55 | * @param context
56 | * the current element, may be irrelevant or null in some context.
57 | * @param d
58 | * the datum
59 | * @param index
60 | * the index of the element in the selection
61 | * @return a result to be applied
62 | */
63 | public T apply(Element context, Value d, int index);
64 | }
65 |
--------------------------------------------------------------------------------
/gwt-d3-demo/src/test/java/com/github/gwtd3/demo/client/pageobjects/AbstractDemoPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.demo.client.pageobjects;
30 |
31 | import com.github.gwtd3.demo.client.D3Demo;
32 | import com.github.gwtd3.demo.client.democases.behaviors.DragMultiples;
33 | import org.openqa.selenium.By;
34 |
35 | /**
36 | * Represents the base class for any demo in gwt-d3 demo.
37 | *
38 | * @author Anthony Schiochet
39 | *
40 | */
41 | public class AbstractDemoPage> extends ElementPageObject {
42 | private final NavigationButton button;
43 |
44 | protected AbstractDemoPage(DemoApplication parent) {
45 | super(parent, By.id(D3Demo.DEMO_CONTAINER_ID));
46 | // the demo button has the id of the demo that it is pointing to
47 | this.button = new DemoButton(parent, DragMultiples.class.getSimpleName());
48 | }
49 |
50 | class DemoButton extends NavigationButton {
51 | public DemoButton(DemoApplication parent, String buttonId) {
52 | super(parent, buttonId);
53 | }
54 |
55 | @SuppressWarnings("unchecked")
56 | @Override
57 | protected D navigateToPageObject() {
58 | return (D) AbstractDemoPage.this;
59 | }
60 |
61 | }
62 |
63 | protected D reveal() {
64 | return button.click();
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/gwt-d3-api/src/main/java/com/github/gwtd3/api/interpolators/JSNIInterpolatorFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2013, Anthony Schiochet and Eric Citaire
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | *
11 | * * Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * * The names Anthony Schiochet and Eric Citaire may not be used to endorse or promote products
16 | * derived from this software without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | package com.github.gwtd3.api.interpolators;
30 |
31 | import com.github.gwtd3.api.D3;
32 | import com.github.gwtd3.api.core.Value;
33 | import com.google.gwt.core.client.JavaScriptObject;
34 |
35 | /**
36 | * An interpolator factory returned by JSNI.
37 | *
38 | * This class is used by {@link D3} to allow java code to invoke built-in interpolator factories. You should not instanciate this object
39 | * unless you know what you are doing.
40 | *
41 | *
42 | * @author Anthony Schiochet
43 | *
44 | */
45 | public class JSNIInterpolatorFactory extends JavaScriptObject implements InterpolatorFactory {
46 |
47 | protected JSNIInterpolatorFactory() {
48 | super();
49 | }
50 |
51 | @Override
52 | public final JavaScriptObject asJSOFunction() {
53 | return this;
54 | }
55 |
56 | @Override
57 | public final Interpolator create(final I a, final I b) {
58 | return new JavascriptFunctionInterpolatorDecorator(createInterpolator(a, b)) {
59 | @Override
60 | public O cast(final Value v) {
61 | return v.as();
62 | }
63 | };
64 | }
65 |
66 | public final native JavascriptFunctionInterpolator createInterpolator(final I a, final I b)/*-{
67 | return this(a, b);
68 | }-*/;
69 |
70 | }
71 |
--------------------------------------------------------------------------------