You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+53-44
Original file line number
Diff line number
Diff line change
@@ -41,68 +41,77 @@ There already exist various JavaScript tools for the visualization of graphs (se
41
41
42
42
The demo at [https://wolfib.github.io/sequenceTubeMap/](https://wolfib.github.io/sequenceTubeMap/) contains some example visualizations as well as a way to generate visalizations from custom data.
43
43
44
-
Another way to use this module is to include it in your own code. The whole visualization logic is contained in [`sequenceTubeMap.js`](https://github.com/wolfib/sequenceTubeMap/blob/master/sequenceTubeMap.js) and a handful of css rules are defined in [`sequenceTubeMapStyle.css`](https://github.com/wolfib/sequenceTubeMap/blob/master/sequenceTubeMapStyle.css). For the actual drawing the module uses [d3.js](https://d3js.org/), so this library has to be included as well. A minimal example would look like this:
44
+
Another way to use this module is to include it in your own code. The whole visualization logic is contained in [`tubemap.js`](https://github.com/wolfib/sequenceTubeMap/blob/master/app/scripts/tubemap.js) and a handful of css rules are defined in [`tubemap.css`](https://github.com/wolfib/sequenceTubeMap/blob/master/app/styles/tubemap.css). tubemap.js is an ES6 module and importing it requires ES6's import command, which is not supported by most browsers natively at this time. The code therefore needs to be transpiled before it can be executed in the browser.
45
45
46
+
In addition, the module uses [d3.js](https://d3js.org/), [jQuery](https://jquery.com/) and [Bootstrap](https://getbootstrap.com/).
(See the result [here](https://wolfib.github.io/sequenceTubeMap/miniExample.html).)
82
98
83
-
[`sequenceTubeMap.js`](https://github.com/wolfib/sequenceTubeMap/blob/master/sequenceTubeMap.js) uses very simple custom JSON data structures for its input data:
99
+
[`tubemap.js`](https://github.com/wolfib/sequenceTubeMap/blob/master/app/scripts/tubemap.js) uses very simple custom JSON data structures for its input data:
84
100
85
-
Nodes are defined by a `name` attribute (has to be unique) and either a `width` or a `sequenceLength`attribute. `width` determines the node's width directly whereas `sequenceLength` is used as input into a scaling function whose return value is the actual node `width` attribute to be used in the visualization.
101
+
Nodes are defined by a `name` attribute (has to be unique) and a `seq`attribute which contains the node's sequence of bases.
86
102
```javascript
87
-
var nodes = [
88
-
{name:"A", width:1},
89
-
{name:"B", width:2},
90
-
{name:"C", width:3}
91
-
];
92
-
93
-
var nodes = [
94
-
{name:"A", sequenceLength:1},
95
-
{name:"B", sequenceLength:2},
96
-
{name:"C", sequenceLength:3}
103
+
constnodes= [
104
+
{ name:'A', seq:'AAAA' },
105
+
{ name:'B', seq:'TTG' },
106
+
{ name:'C', seq:'CC' },
97
107
];
98
108
```
99
-
100
-
Paths each have a unique and consecutively numbered `id` attribute (starting with 0) and a `sequence` attribute which contains a array of node `name` attributes. If a node is traversed in reversed direction, the node `name` is prefixed by a `-`-symbol.
109
+
Paths each have a unique and consecutively numbered `id` attribute (starting with 0), a `name` attribute and a `sequence` attribute which contains a array of node `name` attributes. If a node is traversed in reversed direction, the node `name` is prefixed by a `-`-symbol.
JSON files generated in such a way can be parsed and displayed by the demo at [https://wolfib.github.io/sequenceTubeMap/](https://wolfib.github.io/sequenceTubeMap/).
114
123
115
124
## License
116
-
Copyright (c) 2016 Wolfgang Beyer, licensed under the MIT License.
125
+
Copyright (c) 2017 Wolfgang Beyer, licensed under the MIT License.
0 commit comments