Skip to content

Commit c4bdfb5

Browse files
committed
We now longer need the full SPARC anatomical hierarchy, so don't fetch it.
1 parent afab5e4 commit c4bdfb5

File tree

4 files changed

+2
-46
lines changed

4 files changed

+2
-46
lines changed

src/flatmap.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import type {MinimapOptions} from './flatmap-types'
5858
import {FLATMAP_LEGEND} from './legend'
5959
import type {FlatmapLegendEntry} from './legend'
6060
import {UserInteractions} from './interactions'
61-
import {MapTermGraph, SparcTermGraph} from './knowledge'
61+
import {MapTermGraph} from './knowledge'
6262
import {KNOWLEDGE_SOURCE_SCHEMA, FlatMapServer} from './mapserver'
6363
import {loadMarkerIcons} from './markers'
6464
import {APINATOMY_PATH_PREFIX, PathType} from './pathways'
@@ -188,7 +188,6 @@ export type MapDescription = {
188188
style: FlatMapStyleSpecification
189189
options: MapDescriptionOptions
190190
layers: FlatMapLayer[]
191-
sparcTermGraph: SparcTermGraph
192191
annotations: FlatMapAnnotations
193192
callback: FlatMapCallback
194193
pathways: FlatMapPathways
@@ -260,7 +259,7 @@ export class FlatMap
260259
this.#layers = mapDescription.layers
261260
this.#options = mapDescription.options
262261
this.#pathways = mapDescription.pathways
263-
this.#mapTermGraph = new MapTermGraph(mapDescription.sparcTermGraph)
262+
this.#mapTermGraph = new MapTermGraph()
264263

265264
const sckanProvenance = mapDescription.details.connectivity
266265
if (!sckanProvenance) {

src/knowledge/index.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,8 @@ export const ANATOMICAL_ROOT = BODY_PROPER
3232

3333
export class MapTermGraph
3434
{
35-
#sparcTermGraph: SparcTermGraph
3635
#hierarchy: DiGraph = new DiGraph()
3736

38-
constructor(sparcTermGraph: SparcTermGraph)
39-
{
40-
this.#sparcTermGraph = sparcTermGraph
41-
}
42-
43-
get sparcTermGraph(): SparcTermGraph
44-
//==================================
45-
{
46-
return this.#sparcTermGraph
47-
}
48-
4937
get maxDepth(): number
5038
//====================
5139
{
@@ -87,25 +75,4 @@ export class MapTermGraph
8775
}
8876

8977
//==============================================================================
90-
91-
export class SparcTermGraph
92-
{
93-
#graph: DiGraph = new DiGraph()
94-
95-
async load(mapServer: FlatMapServer)
96-
//==================================
97-
{
98-
const sparcGraph = await mapServer.sparcTermGraph()
99-
if (sparcGraph) {
100-
this.#graph.load(sparcGraph)
101-
}
102-
}
103-
104-
parents(term: string): string[]
105-
//=============================
106-
{
107-
return this.#graph.parents(term)
108-
}
109-
}
110-
11178
//==============================================================================

src/mapserver.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,6 @@ export class FlatMapServer
216216
return data.values
217217
}
218218

219-
async sparcTermGraph(): Promise<NodeLinkGraph|null>
220-
//=================================================
221-
{
222-
return this.#loadJSON<NodeLinkGraph>('knowledge/sparcterms')
223-
}
224-
225219
url(relativePath: string=''): string
226220
//==================================
227221
{

src/viewer.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
FlatMapCallback, FlatMapIndex, FlatMapLayer,
2727
FlatMapMetadata, FlatMapOptions, FlatMapServerIndex
2828
} from './flatmap-types'
29-
import {SparcTermGraph} from './knowledge'
3029
import {FlatMapServer} from './mapserver'
3130
import {noFlatMapPathways} from './pathways'
3231
import * as utils from './utils'
@@ -98,7 +97,6 @@ export class MapViewer
9897
#mapList: MapListEntry[] = []
9998
#mapServer: FlatMapServer
10099
#images: PreloadedImage[]
101-
#sparcTermGraph = new SparcTermGraph()
102100

103101
readonly mapServerUrl: string
104102

@@ -142,7 +140,6 @@ export class MapViewer
142140
map.separateLayers = ('version' in map && map.version >= MAP_MAKER_SEPARATE_LAYERS_VERSION)
143141
this.#mapList.push(map)
144142
}
145-
await this.#sparcTermGraph.load(this.#mapServer)
146143
this.#initialised = true
147144
}
148145
})
@@ -372,7 +369,6 @@ export class MapViewer
372369
style: mapStyle,
373370
options: mapOptions,
374371
layers: mapLayers,
375-
sparcTermGraph: this.#sparcTermGraph,
376372
annotations,
377373
callback,
378374
pathways,

0 commit comments

Comments
 (0)