├── .github
└── workflows
│ └── docker-build.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── css
├── bootstrap.css
├── graphStyle.css
└── styles.css
├── graphexp.html
├── images
├── bootstrapthemec.png
├── concrete_seamless.png
├── curved_links.png
├── graphexp2.png
├── graphexp2018.png
├── graphexptol1.png
├── graphexptol2.png
├── graphexptol3.png
├── graphexpzoom.png
├── qbkls.png
└── ticks.png
├── index.html
└── scripts
├── bootstrap.min.js
├── d3.v4.min.js
├── editGraph.js
├── graphConf.js
├── graphShapes.js
├── graph_viz.js
├── graphioGremlin.js
├── infobox.js
├── jquery-3.2.1.min.js
└── utils.js
/.github/workflows/docker-build.yml:
--------------------------------------------------------------------------------
1 | name: docker-build-push
2 |
3 | on:
4 | push:
5 | branches:
6 | - 'master'
7 | tags:
8 | - '*'
9 |
10 | pull_request:
11 | branches:
12 | - 'master'
13 |
14 | workflow_dispatch:
15 |
16 | env:
17 | IMAGE_NAME: "graphexp"
18 |
19 | jobs:
20 | docker:
21 | runs-on: ubuntu-latest
22 | steps:
23 |
24 | - name: Checkout
25 | uses: actions/checkout@v2
26 |
27 | - name: Prepare
28 | id: prep
29 | run: |
30 | BASE_DIR=.
31 | IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
32 |
33 | # Change all uppercase to lowercase
34 | IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
35 |
36 | # Strip git ref prefix from version
37 | VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
38 |
39 | # Strip "v" prefix from tag name
40 | [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
41 |
42 | # Use Docker `latest` tag convention
43 | [ "$VERSION" == "master" ] && VERSION=latest
44 |
45 | VERSION=$VERSION
46 | IMAGE_ID=$IMAGE_ID
47 | echo ::set-output name=version::${VERSION}
48 | echo ::set-output name=image_id::${IMAGE_ID}
49 | echo ::set-output name=base_dir::${BASE_DIR}
50 |
51 | - name: Set up QEMU
52 | uses: docker/setup-qemu-action@v1
53 | with:
54 | platforms: all
55 |
56 | - name: Set up Docker Buildx
57 | id: buildx
58 | uses: docker/setup-buildx-action@v1
59 | with:
60 | install: true
61 | version: latest
62 |
63 | - name: Log into registry
64 | run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
65 |
66 | - name: Build and Push
67 | uses: docker/build-push-action@v2
68 | with:
69 | build-args: VERSION=${{ steps.prep.outputs.version }}
70 | context: ${{ steps.prep.outputs.base_dir }}/
71 | file: ${{ steps.prep.outputs.base_dir }}/Dockerfile
72 | platforms: linux/amd64,linux/arm64
73 | push: true
74 | tags: |
75 | ${{ steps.prep.outputs.image_id }}:${{ steps.prep.outputs.version }}
76 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | d3/
2 | font-awesome-4.7.0/
3 | jquery*
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nginx:stable
2 |
3 | LABEL maintainer="armand.leopold@outlook.com"
4 |
5 | WORKDIR /usr/share/nginx/html
6 | COPY . /usr/share/nginx/html
7 |
8 | RUN sed -i 's/const HOST = "localhost"/const HOST = self.location.hostname/' scripts/graphConf.js
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2017 Benjamin RICAUD
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Graphexp: graph explorer with D3.js
2 |
3 | Graphexp is a lightweight web interface to explore and display a graph stored in a Gremlin graph database, via the Gremlin server (version 3.2.x, 3.3.x or 3.4.x).
4 |
5 | Graphexp is under the Apache 2.0 license.
6 |
7 | # Bootstrap Version :
8 |
9 | Versions of Graphexp with the same backend but a nicer UI (using bootstrap) are available here [github.com/erandal/graphexp](https://github.com/erandal/graphexp) and here [github.com/ddmx/graphexp](https://github.com/ddmx/graphexp).
10 | 
11 |
12 | ## Installation :
13 |
14 | ```bash
15 | docker pull ghcr.io/armandleopold/graphexp:0.8.3
16 | ```
17 |
18 | ## Configuration
19 |
20 | To use Graph Explorer, you need a [Gremlin server](http://tinkerpop.apache.org/) running with REST or websocket protocol and a *recent* web browser to display the visualization.
21 | On your web browser, just access the file `graphexp.html`.
22 |
23 | Next step, configure the server settings on the bottom of the page. The default Gremlin server address is `localhost:8182`. You will have to specify the communication protocol `websocket` or `REST` and the gremlin server version. Graphexp is not able to handle secure connections yet and a contribution on this topic would be welcome.
24 |
25 | Graphexp works with [Amazon Neptune](https://aws.amazon.com/neptune) thanks to a pull request of [jwalton922](https://github.com/jwalton922). With this database, set `SINGLE_COMMANDS_AND_NO_VARS = true` in the file `graphConf.js`.
26 |
27 | Make sure you choose the correct version of Gremlin on the bottom right corner. Setting a wrong version may lead to unexpected problems such as not displaying the edges.
28 |
29 | Additional parameters can be configured inside the file `graphConf.js`.
30 |
31 | 
32 | 
33 |
34 | ## Getting started
35 |
36 | ### Installing a Gremlin server
37 |
38 | If you have not yet installed a gremlin server, download the last release of the [Gremlin server](http://tinkerpop.apache.org/) and follow the [documentation](http://tinkerpop.apache.org/docs/current/reference/#gremlin-server). In the server folder just run
39 | ```
40 | bin/gremlin-server.sh conf/gremlin-server-rest-modern.yaml
41 | ```
42 | or on windows
43 | ```
44 | bin/gremlin-server.bat conf/gremlin-server-rest-modern.yaml
45 | ```
46 | This default server comes with a small graph database of 6 nodes.
47 | The server should start on port `8182`. Replace `gremlin-server-rest-modern.yaml` by `gremlin-server-modern.yaml` if you want to use websocket.
48 |
49 |
50 | Alternatively, if you have Docker installed on your machine, you may run a Docker container with an already configured Gremlin server. You can find one on [this page](https://hub.docker.com/r/bricaud/gremlin-server-with-demo-graph/). This server has a graph database containing a demo graph: the tree of life, with 35960 nodes and 35959 edges. You can download it and run it using
51 | ```
52 | docker pull bricaud/gremlin-server-with-demo-graph
53 | docker run -p 8182:8182 -it --name gremlin-server-rest bricaud/gremlin-server-with-demo-graph
54 | ```
55 | or for the websocket version:
56 | ```
57 | docker pull bricaud/gremlin-server-with-demo-graph:websocket
58 | docker run -p 8182:8182 -it --name gremlin-server-websocket bricaud/gremlin-server-with-demo-graph:websocket
59 | ```
60 | ### Running a graphexp Demo with Docker
61 |
62 | You may also try out a Graphexp demo on [joov's Github repository](https://github.com/joov/gremlin-demo). It uses Docker compose and can work on Windows.
63 |
64 | ### Graphexp guidelines
65 | To get some first visualization of your graph, you may click on the `Search` button, without filling any box. Graphexp will then send a query to the graph DB, asking for the first 50 nodes and their edges.
66 |
67 | The node and edge properties can be automatically retrieved using the `get graph info` button. Pushing this button will also display some graph properties on the left side of the page. If it is not the case, check your configuration, it means Graphexp can not query the graphDB. To get the properties, Graphexp should consider all the nodes and edges. This may be overwhelming for the server if the graph is very large. A limit to the 10000 first nodes and edges is set to avoid that. You may change it in `graphConf.js` with the parameter `limit_graphinfo_request`.
68 |
69 | When a node of the visualization is clicked, it will become 'active' with a circle surrounding it and its information will be displayed on the right side of the page. Moreover, this action will trigger the display of its neighbors.
70 | Clicking on an edge will show its properties (without highlighting the edge).
71 |
72 | When appearing for the first time the nodes will be positioned following a force layout. Drag and drop can be used to pin them in a particular position. Once dragged the nodes will stay at their position. Drag and drop is allowed only for the nodes on the active layer (most recent layer) with no connection with nodes in other layers. See "Visualization concepts" section for more information on the layers.
73 |
74 | ### Querying the graphDB
75 | In the top bar, you can search the graphDB to display a particular node or group of nodes.
76 |
77 | * The box `Node label` allows to filter nodes with a particular label during the search.
78 | * The box `Node property`, in combination with the `Property value` box, allows to find nodes with a particular keyword or value in their properties. The `Type of search` allows for a perfect (equals) or partial match (Contains). *Note that the 'contains' option will only work with Janusgraph*.
79 | * The box `Traverse by edge` acts directly in the interactive visualization. If an edge label is entered in the box, clicking on a node will only display its neighbors connected with that type of edge label.
80 | * The `Results limit` is here to avoid overwhelming the visualization. It fixes the maximal le number of nodes to display per query.
81 | * If `Freeze exploration` is ticked, the graph displayed will stay the same even if nodes are clicked on. It is useful when you just need to display the node properties.
82 | * `Number of layers` is explained below in the "Visualization concept" section.
83 |
84 | Note that the input is case-sensitive.
85 |
86 | ### URL query string parameters
87 |
88 | * `ts` specifies [TraversalSource](http://tinkerpop.apache.org/docs/current/reference/#the-graph-process) in case of multiple different graphs stored in the same database. If unspecified, the default is just `g`. For Example `http://localhost:8183/graphexp.html?ts=gTreeOfLife` replaces `g` by `gTreeOfLife` in all the gremlin queries (for example `g.V()` becomes `gTreeOfLife.V()`).
89 |
90 | ### Editing the graph
91 |
92 | There is now the possibility to add/edit the vertices and edges of the graph. A small button was added by [sandecho](https://github.com/sandecho) at the bottom `Edit Graph`. You can modify your graph using Graphexp but you have to update the view to see the result. You can check if the modification has been taken into account by the server in the message window on the top right of the interface.
93 |
94 | ## Visualization concept
95 |
96 | The visualization is based on a concept of layers of visualization. The idea is to progress in the graph as in a jungle. The clicked node immediately shows its neighbors, opening new paths for the exploration. If not clicked, a node vanishes little by little as we progress in the exploration. Coming back during the exploration is allowed. Before it completely disappears, a node can be clicked and will become active again.
97 | This visualization concept is aimed at providing a precise, local view rather than a global one.
98 |
99 | During your exploration, you can set up milestones by clicking on the small circle on the upper right side of a node. This will pin the node in time, preventing it from disappearing.
100 |
101 | You may also freeze the exploration, by ticking the appropriate checkbox. The evolution of the exploration will stop, allowing to gather information on the nodes displayed, without displaying their neighbors.
102 |
103 | ## Node and edge information
104 |
105 | The Id and label of each node can be displayed by hovering the cursor over the node. The full information on the properties is displayed on the right of the page when clicking on the node or edges. Once the `get graph info` button has been clicked, a choice of properties to display appears on the left side.
106 |
107 | ## Node color
108 |
109 | If a node property called 'color' exists in the node properties with a hexadecimal color code (string), it will be displayed automatically on the graph. Otherwise, the default node color can be set in the `graphConf.js` file. The node color can be set interactively after the `get graph info` button has been pressed. A select tab appears on the left sidebar allowing to set the color according to one of the property values present in the graph.
110 |
111 | ## Predefined node positions
112 |
113 | Graphexp can display nodes at specific positions if they are stored in the DB. For that, modify `node_position_x` and `node_position_y` in `graphConf.js` (by default `graphexpx` and `graphexpy`), to whatever keys are refering to the node positions in the graphDB. Values must be numbers. According to [Sim Bamford](https://github.com/bricaud/graphexp/pull/24), reasonable values should be below 500 to stay within the page limits. Node with predefined positions are not subject to the force layout and will stay at the same position, while the others may move. It may be useful for plotting a hierarchical graph for example.
114 |
115 | ## Curved edges
116 |
117 | GraphExp has now curved links and can display multiple edges between 2 nodes, thanks to a contribution from [agussman](https://github.com/agussman). This is the default, you can still come back to straight edges by setting `use_curved_edges = false` in `graphConf.js`.
118 |
119 | ## Program description
120 |
121 | The program uses:
122 | * the D3.js library to visualize a graph in an interactive manner, [API Reference](https://github.com/d3/d3/blob/master/API.md),
123 | * an ajax request (with Jquery) that query the graph database (Gremlin Tinkerpop via REST).
124 |
125 |
126 | ## Contributing
127 | Contribution as pull requests are very welcome.
128 | If you want to contribute, you may have a look at the [issues](https://github.com/bricaud/graphexp/issues). You can also submit a pull request with a new feature. When contributing, keep in mind that graphexp must stays simple. The idea is to have a simple tool for a quick (and efficient) graph exploration.
129 |
130 |
131 | ## Tutorial with the tree of life
132 | Once your gremlin server is up and running (from the [Docker repository](https://hub.docker.com/r/bricaud/gremlin-server-with-demo-graph/)), click on the `get graph info` button. Information should appear on the left side of the page, like on the following image.
133 | 
134 |
135 | This graph has a single type of nodes (label 'vertex') and a single type of edges (label 'edge'). Each node is a species (taxon) living on earth or extinct, and directed edges represent the link ancestor-descendant.
136 | The different node properties are displayed on the left.
137 | * `CHILDCOUNT` the number of descendent nodes
138 | * `name` the name of the species
139 | * `HASPAGE` whether there is a page of information on the [Tree Of Life Project website](http://tolweb.org/tree/home.pages/downloadtree.html)
140 | * `ID` Tree of Life Project unique id
141 | * `CONFIDENCE` confidence in classification, from confident (0) to less confident (1) and (2)
142 | * `EXTINCT` whether the node is extinct (2) or not (0)
143 | * `LEAF` the node is a leaf of the tree (1) or the node does not represent a leaf (it has or will have descendent nodes on the Tree of Life) (0)
144 | * `PHYLESIS` (0) monophyletic, (1) uncertain, (2) not monophyletic
145 |
146 | On the top navigation bar, choose the field `name`, enter 'Dinosauria' as value in the input and click on the `Search` button. Do not forget the capital letter, as the search is case-sensitive. A single node, corresponding to the Dinosaurs clade, should appear in the middle of the page. Click on the node to display node details on the right as well as its ancestors and descendants on the graph.
147 | Check the box `name` on the left bar to display the node names.
148 | You should see appearing the two subgroups of dinosaurs `Saurischia` and `Ornithischia`, as in the [Wikipedia dinosaur page](https://en.wikipedia.org/wiki/Dinosaur_classification) and an additional `none` node which is the ancestor. This latter node is a taxon that has ancestors and descendants but does not have a name. Note that there are different versions of the tree of life and it is always evolving as researchers find new species.
149 | 
150 | You may now enjoy the exploration of the dinosaur order by clicking on nodes and following ascendant and descendant lines. The oldest nodes will vanish as you explore the data and if you want more nodes to be displayed, just increase the number of layers on the top navigation bar.
151 |
152 | You may also color the nodes according to the values of some of their properties by clicking on the color tab on the left side. The color scale is computed using the range of values of the nodes already displayed and a palette of 20 colors. You should refresh the color after a few steps of exploration.
153 |
154 | 
155 |
156 | During the exploration of the `Dinosauria` clade you may find the [bird](https://en.wikipedia.org/wiki/Bird) class `Aves`. They are the only survivors of the Dinosaur group and descendant of dinosaurs with feathers. To see it, enter `Aves` in the value field, press search and climb up the tree.
157 |
158 | If you want to explore the world of insects, you may start with the taxon `Insecta` and follow the links. Did you know that spiders are not insects but have they own group `Arachnida`? Can you tell what is the common ancestor between spiders and insects?
159 |
160 | You may also be interested in the `Homo` group.
161 |
162 | Have a try on the live demo of Graphexp on the [project Github page](https://bricaud.github.io/graphexp/).
163 |
--------------------------------------------------------------------------------
/css/graphStyle.css:
--------------------------------------------------------------------------------
1 | .edge {
2 | stroke: #999;
3 | stroke-opacity: 0.8;
4 | }
5 |
6 | .old_edge0 {
7 | stroke: #999;
8 | stroke-opacity: 0.6;
9 | }
10 |
11 | .node circle {
12 | stroke: #000;
13 | stroke-width: 1.5px;
14 | }
15 |
16 | .node text {
17 | font: 10px sans-serif;
18 | }
19 |
20 | .node:hover circle {
21 | stroke-opacity: 0.6;
22 | }
23 |
24 | .pinned circle {
25 | stroke: #000;
26 | stroke-width: 1.5px;
27 | }
28 |
29 | .pinned text {
30 | font: 10px sans-serif;
31 | }
32 |
33 | .pinned:hover circle {
34 | stroke-opacity: 0.6;
35 | }
36 |
37 | .old_node0 circle {
38 | stroke-opacity: 0.9;
39 | }
40 |
41 | .old_node0 text {
42 | font: 10px sans-serif;
43 | opacity: 0.9;
44 | color: #000;/* Fallback for older browsers */
45 | color: rgba(0,0,0,0.5);
46 | }
47 |
48 | .cell {
49 | fill: none;
50 | pointer-events: all;
51 | }
52 |
53 | .links line {
54 | stroke: #999;
55 | stroke-opacity: 0.6;
56 | }
57 |
58 | path {
59 | fill: none;
60 | }
61 |
62 | /*
63 |
64 | .nodes circle {
65 | stroke: #fff;
66 | stroke-width: 1.5px;
67 | }
68 |
69 | .text1 text{
70 | font: 10px sans-serif;
71 | }
72 | */
73 | /*.table { border:0px solid black; padding:10px; width:1400px; overflow:hidden;border-spacing:0;border-collapse:collapse;}
74 | .left { float:left; width:960px; }
75 | .right { float:right; width:400px; }
76 |
77 | td, th {
78 | padding: 1px 4px;
79 | }
80 | */
--------------------------------------------------------------------------------
/css/styles.css:
--------------------------------------------------------------------------------
1 | /* -----------------------
2 | Base styles
3 | ------------------------*/
4 | body
5 | {
6 | margin: 0;
7 | padding: 0;
8 | color: #333;
9 | background-color: #eee;
10 | font: 1em/1.2 "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
11 | height: 100%;
12 | }
13 |
14 | h1,h2,h3,h4,h5,h6
15 | {
16 | margin: 0 0 .5em;
17 | font-weight: 500;
18 | line-height: 1.1;
19 | }
20 |
21 | h1 { font-size: 2.25em; } /* 36px */
22 | h2 { font-size: 1.75em; } /* 28px */
23 | h3 { font-size: 1.375em; } /* 22px */
24 | h4 { font-size: 1.125em; } /* 18px */
25 | h5 { font-size: 1em; } /* 16px */
26 | h6 { font-size: .875em; } /* 14px */
27 |
28 | p
29 | {
30 | margin: 0 0 1.5em;
31 | line-height: 1.5;
32 | }
33 |
34 | blockquote
35 | {
36 | padding: 1em 2em;
37 | margin: 0 0 2em;
38 | border-left: 5px solid #eee;
39 | }
40 |
41 | hr
42 | {
43 | height: 0;
44 | margin-top: 1em;
45 | margin-bottom: 2em;
46 | border: 0;
47 | border-top: 1px solid #ddd;
48 | }
49 |
50 | table
51 | {
52 | background-color: transparent;
53 | border-spacing: 0;
54 | border-collapse: collapse;
55 | border-top: 1px solid #ddd;
56 | }
57 |
58 | th, td
59 | {
60 | padding: .5em 1em;
61 | vertical-align: top;
62 | text-align: left;
63 | border-bottom: 1px solid #ddd;
64 | }
65 |
66 | a:link { color: royalblue; }
67 | a:visited { color: purple; }
68 | a:focus { color: black; }
69 | a:hover { color: green; }
70 | a:active { color: red; }
71 |
72 | input[type="number"] {
73 | width:50px;
74 | }
75 |
76 | /* -----------------------
77 | Layout styles
78 | ------------------------*/
79 |
80 | .header
81 | {
82 | color: #000;
83 | background: #ddd;
84 | padding: 0.2em 1.25em;
85 | }
86 |
87 | .header-heading { margin: 0; }
88 |
89 | .nav-bar
90 | {
91 | color: #ddd;
92 | background: #17649a;
93 | padding: 0;
94 | }
95 |
96 | .container
97 | {
98 | padding: 1em 1.25em;
99 | margin: 0 auto;
100 | }
101 |
102 | .nav.container {
103 | display: grid;
104 | grid-template-rows: auto 15%;
105 | }
106 |
107 | .nav.inputs_container_top {
108 | grid-row: 1 / 2;
109 | display: grid;
110 | grid-template-columns: auto auto auto auto auto;
111 | grid-auto-flow: row;
112 | }
113 |
114 | .nav.inputs_container_bottom {
115 | grid-row: 1 / 2;
116 | display: grid;
117 | grid-template-columns: auto auto auto auto;
118 | grid-auto-flow: row;
119 | }
120 | .nav.input_unit_container {
121 | padding: 5px;
122 | align-self: center;
123 | }
124 |
125 | .nav.input_label {
126 | white-space:nowrap;
127 | }
128 |
129 | .nav.controls {
130 | grid-row: 1 / span 3;
131 | justify-self: center;
132 | align-self: center;
133 | }
134 |
135 | .content
136 | {
137 | padding: 0em 0em;
138 | height: 100%;
139 | }
140 |
141 | .main, .aside
142 | {
143 | margin-bottom: 1em;
144 | padding: 0em;
145 | font: 12px sans-serif;
146 | position: absolute;
147 | top: 0;
148 | }
149 |
150 | .main
151 | {
152 | position: absolute;
153 | top:0;
154 | left: 0;
155 | width: 100%;
156 | height: 100%;
157 | }
158 |
159 | .left_bar {
160 | margin: 0;
161 | position: absolute;
162 | left: 0;
163 | max-width: 275px;
164 | background-color: #fff;
165 | padding: 20px;
166 | padding-top: 7px;
167 | border-bottom-right-radius: 15px;
168 | overflow: auto;
169 | max-height: 100%;
170 | top: 0px;
171 | display: block;
172 | z-index: 1;
173 | padding-top: 61px;
174 | }
175 |
176 | .right_bar {
177 | position: absolute;
178 | right: 0;
179 | top: 56px;
180 | max-width: 275px;
181 | background-color: #fff;
182 | padding: 10px;
183 | border-bottom-left-radius: 15px;
184 | padding-left: 15px;
185 | }
186 |
187 | .left_bar_edit {
188 | position: relative;
189 | background-color: white;
190 | border-bottom-right-radius: 15px;
191 | z-index: 2;
192 | box-shadow: 1px 1px 15px #888;
193 | }
194 |
195 | /* -----------------------
196 | Nav
197 | ------------------------*/
198 |
199 | .nav
200 | {
201 | margin: 0;
202 | padding: 0;
203 | list-style: none;
204 | }
205 |
206 | .nav li
207 | {
208 | display: inline;
209 | margin: 0;
210 | }
211 |
212 | .nav a
213 | {
214 | display: block;
215 | padding: .7em 1.25em;
216 | color: #fff;
217 | text-decoration: none;
218 | border-bottom: 1px solid gray;
219 | }
220 |
221 | .nav a:link { color: white; }
222 | .nav a:visited { color: white; }
223 |
224 | .nav a:focus
225 | {
226 | color: black;
227 | background-color: white;
228 | }
229 |
230 | .nav a:hover
231 | {
232 | color: white;
233 | background-color: green;
234 | }
235 |
236 | .nav a:active
237 | {
238 | color: white;
239 | background-color: red;
240 | }
241 |
242 | /* -----------------------
243 | Side styles
244 | ------------------------*/
245 | .aside li
246 | {
247 | padding-left: 0;
248 | margin-left: -5px;
249 | list-style: none;
250 | }
251 | .aside div
252 | {
253 | margin: 1em 0 1em 0;
254 | }
255 | /* -----------------------
256 | Single styles
257 | ------------------------*/
258 |
259 | .img-responsive { max-width: 100%; }
260 |
261 | .btn
262 | {
263 | color: #fff !important;
264 | background-color: royalblue;
265 | border-color: #222;
266 | display: inline-block;
267 | padding: .5em 1em;
268 | margin-bottom: 0;
269 | font-weight: 400;
270 | line-height: 1.2;
271 | text-align: center;
272 | white-space: nowrap;
273 | vertical-align: middle;
274 | cursor: pointer;
275 | border: 1px solid transparent;
276 | border-radius: .2em;
277 | text-decoration: none;
278 | }
279 |
280 | .btn:hover
281 | {
282 | color: #fff !important;
283 | background-color: green;
284 | }
285 |
286 | .btn:focus
287 | {
288 | color: #fff !important;
289 | background-color: black;
290 | }
291 |
292 | .btn:active
293 | {
294 | color: #fff !important;
295 | background-color: red;
296 | }
297 |
298 | .table
299 | {
300 | width: 100%;
301 | max-width: 100%;
302 | margin-bottom: 20px;
303 | }
304 |
305 | .list-unstyled
306 | {
307 | padding-left: 0;
308 | list-style: none;
309 | }
310 |
311 | .list-inline
312 | {
313 | padding-left: 0;
314 | margin-left: -5px;
315 | list-style: none;
316 | }
317 |
318 | .list-inline > li
319 | {
320 | display: inline-block;
321 | padding-right: 5px;
322 | padding-left: 5px;
323 | }
324 |
325 | /* -----------------------
326 | Wide styles
327 | ------------------------*/
328 |
329 | @media (max-width: 1024px)
330 | {
331 | .left_bar {
332 | padding-top: 90px;
333 | }
334 | .right_bar {
335 | top: 86px;
336 | }
337 | }
338 |
339 | @media (min-width: 55em)
340 | {
341 | .header { padding: 0.2em 3em; }
342 | .nav-bar { padding: 0.5em 3em; }
343 | .content { padding: 0em 0em; }
344 |
345 | .main
346 | {
347 | margin-right: 0%;
348 | margin-bottom: 1em;
349 | }
350 |
351 | .aside
352 | {
353 | float: left;
354 | margin-bottom: 1em;
355 | }
356 |
357 | .nav li
358 | {
359 | display: inline;
360 | margin: 0 1em 0 0;
361 | }
362 |
363 | .nav a
364 | {
365 | display: inline;
366 | padding: 0;
367 | border-bottom: 0;
368 | }
369 | }
370 |
371 |
372 |
373 | .nav label {
374 | margin-right: 15px;
375 | }
376 |
377 | /* width */
378 | ::-webkit-scrollbar {
379 | width: 10px;
380 | }
381 |
382 | /* Track */
383 | ::-webkit-scrollbar-track {
384 | background: #f1f1f1;
385 | }
386 |
387 | /* Handle */
388 | ::-webkit-scrollbar-thumb {
389 | background: #888;
390 | }
391 |
392 | /* Handle on hover */
393 | ::-webkit-scrollbar-thumb:hover {
394 | background: #555;
395 | }
396 |
397 | .middle {
398 | z-index: 999;
399 | color: white;
400 | font-size: large;
401 | display: block;
402 | position: relative;
403 | text-align: center;
404 | margin: 0 !important;
405 | padding: 0 !important;
406 | opacity: 0.9;
407 | }
408 |
409 | #addVertexForm , #editVertexForm, #addEditEdgeForm{
410 | padding: 15px;
411 | padding-bottom: 6px;
412 | }
413 |
414 | #messageArea {
415 | background-color: #31795e;
416 | }
417 | #messageArea p {
418 | margin:0;
419 | }
420 |
421 | #outputArea p {
422 | margin: 0;
423 | padding: 10px;
424 | padding-left: 15px;
425 | }
426 |
427 | #outputArea {
428 | display: block;
429 | position: relative;
430 | float: right;
431 | background-color: darkslategrey;
432 | border-bottom-left-radius: 15px;
433 | }
434 |
435 |
--------------------------------------------------------------------------------
/graphexp.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |