@abi-software/flatmap-viewer 2.3.0-a.1 → 2.3.0-a.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.rst +1 -1
- package/package.json +5 -3
- package/src/annotation.js +487 -0
- package/src/controls.js +503 -11
- package/src/editor.js +198 -0
- package/src/flatmap-viewer.js +176 -64
- package/src/info.js +5 -1
- package/src/interactions.js +299 -232
- package/src/layers.js +242 -151
- package/src/main.js +22 -17
- package/src/newcontrols.js +617 -0
- package/src/pathways.js +47 -21
- package/src/search.js +4 -1
- package/src/styling.js +275 -95
- package/src/systems.js +76 -0
- package/src/utils.js +1 -1
- package/static/{flatmap-viewer.css → css/flatmap-viewer.css} +153 -30
- package/static/css/font-awesome.css +2337 -0
- package/static/css/font-awesome.min.css +4 -0
- package/static/fonts/FontAwesome.otf +0 -0
- package/static/fonts/fontawesome-webfont.eot +0 -0
- package/static/fonts/fontawesome-webfont.svg +2671 -0
- package/static/fonts/fontawesome-webfont.ttf +0 -0
- package/static/fonts/fontawesome-webfont.woff +0 -0
- package/static/fonts/fontawesome-webfont.woff2 +0 -0
- /package/static/{favicon.ico → icons/favicon.ico} +0 -0
package/src/pathways.js
CHANGED
|
@@ -26,18 +26,25 @@ export const PATHWAYS_LAYER = 'pathways';
|
|
|
26
26
|
|
|
27
27
|
//==============================================================================
|
|
28
28
|
|
|
29
|
-
const PATH_TYPES =
|
|
30
|
-
"cns"
|
|
31
|
-
"
|
|
32
|
-
"para-pre"
|
|
33
|
-
"para-post"
|
|
34
|
-
"sensory"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"symp-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
}
|
|
29
|
+
const PATH_TYPES = [
|
|
30
|
+
{ type: "cns", label: "CNS", colour: "#9B1FC1"},
|
|
31
|
+
{ type: "intracardiac", label: "Local circuit neuron", colour: "#F19E38"},
|
|
32
|
+
{ type: "para-pre", label: "Parasympathetic pre-ganglionic", colour: "#3F8F4A"},
|
|
33
|
+
{ type: "para-post", label: "Parasympathetic post-ganglionic", colour: "#3F8F4A", dashed: true},
|
|
34
|
+
{ type: "sensory", label: "Sensory (afferent) neuron", colour: "#2A62F6"},
|
|
35
|
+
{ type: "motor", label: "Somatic lower motor", colour: "#98561D"},
|
|
36
|
+
{ type: "somatic", label: "Somatic lower motor", colour: "#98561D"},
|
|
37
|
+
{ type: "symp-pre", label: "Sympathetic pre-ganglionic", colour: "#EA3423"},
|
|
38
|
+
{ type: "symp-post", label: "Sympathetic post-ganglionic", colour: "#EA3423", dashed: true},
|
|
39
|
+
{ type: "other", label: "Other neuron type", colour: "#888"},
|
|
40
|
+
{ type: "arterial", label: "Arterial blood vessel", colour: "#F00"},
|
|
41
|
+
{ type: "venous", label: "Venous blood vessel", colour: "#2F6EBA"},
|
|
42
|
+
{ type: "centreline", label: "Nerve centrelines", colour: "#CCC", enabled: false},
|
|
43
|
+
{ type: "error", label: "Paths with errors or warnings", colour: "#FF0"}
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
export const PATH_STYLE_RULES =
|
|
47
|
+
PATH_TYPES.flatMap(pathType => [['==', ['get', 'kind'], pathType.type], pathType.colour]);
|
|
41
48
|
|
|
42
49
|
//==============================================================================
|
|
43
50
|
|
|
@@ -122,27 +129,46 @@ export class Pathways
|
|
|
122
129
|
}
|
|
123
130
|
this._allFeatureIds = featureIds;
|
|
124
131
|
|
|
132
|
+
// Construct a list of path types we know about
|
|
133
|
+
const pathTypes = [];
|
|
134
|
+
for (const pathType of PATH_TYPES) {
|
|
135
|
+
pathTypes.push(pathType.type);
|
|
136
|
+
}
|
|
125
137
|
// Map unknown path types to ``other``
|
|
126
138
|
this.__typePaths = {};
|
|
127
139
|
this.__typePaths['other'] = [];
|
|
128
|
-
this.__knownPathTypes = [];
|
|
129
140
|
for (const [pathType, paths] of Object.entries(flatmap.pathways['type-paths'])) {
|
|
130
|
-
if (pathType
|
|
141
|
+
if (pathTypes.indexOf(pathType) >= 0) {
|
|
131
142
|
this.__typePaths[pathType] = paths;
|
|
132
|
-
this.__knownPathTypes.push({'type': pathType, ...PATH_TYPES[pathType]});
|
|
133
143
|
} else {
|
|
134
144
|
this.__typePaths['other'].push(...paths);
|
|
135
145
|
}
|
|
136
146
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
147
|
+
// Nerve centrelines are a special case with their own controls
|
|
148
|
+
this.__haveCentrelines = false;
|
|
140
149
|
}
|
|
141
150
|
|
|
142
|
-
get
|
|
143
|
-
|
|
151
|
+
get haveCentrelines()
|
|
152
|
+
//===================
|
|
153
|
+
{
|
|
154
|
+
return this.__haveCentrelines;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
pathTypes()
|
|
158
|
+
//=========
|
|
144
159
|
{
|
|
145
|
-
|
|
160
|
+
const pathTypes = [];
|
|
161
|
+
for (const pathType of PATH_TYPES) {
|
|
162
|
+
if (pathType.type in this.__typePaths
|
|
163
|
+
&& this.__typePaths[pathType.type].length > 0) {
|
|
164
|
+
if (pathType.type === 'centreline') {
|
|
165
|
+
this.__haveCentrelines = true;
|
|
166
|
+
} else {
|
|
167
|
+
pathTypes.push(pathType);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return pathTypes;
|
|
146
172
|
}
|
|
147
173
|
|
|
148
174
|
addPathsToFeatureSet_(paths, featureSet)
|
package/src/search.js
CHANGED
|
@@ -158,7 +158,10 @@ export class SearchIndex
|
|
|
158
158
|
|
|
159
159
|
addTerm_(featureId, text)
|
|
160
160
|
//=======================
|
|
161
|
-
{
|
|
161
|
+
{
|
|
162
|
+
text = text.replace(new RegExp('<br/>', 'g'), ' ')
|
|
163
|
+
.replace('\n', ' ');
|
|
164
|
+
if (text) {
|
|
162
165
|
this._searchEngine.add({
|
|
163
166
|
id: this._featureIds.length,
|
|
164
167
|
text: text
|