@abi-software/flatmap-viewer 2.7.1-a.2 → 2.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmap-viewer",
3
- "version": "2.7.1-a.2",
3
+ "version": "2.7.1",
4
4
  "description": "Flatmap viewer using Maplibre GL",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1020,10 +1020,6 @@ export class UserInteractions
1020
1020
  // Simulate `mouseenter` events on features
1021
1021
 
1022
1022
  const feature = features[0];
1023
-
1024
- //is feature a marker??
1025
- console.log('mm', event.type, feature)
1026
-
1027
1023
  const featureModels = ('properties' in feature && 'models' in feature.properties)
1028
1024
  ? feature.properties.models
1029
1025
  : null;
@@ -1448,7 +1444,6 @@ console.log('mm', event.type, feature)
1448
1444
  markerMouseEvent_(marker, anatomicalId, event)
1449
1445
  //============================================
1450
1446
  {
1451
- console.log('mk', event.type)
1452
1447
  // No tooltip when context menu is open
1453
1448
  if (this._modal
1454
1449
  || (this.__activeMarker !== null && event.type === 'mouseleave')) {
@@ -1469,7 +1464,6 @@ console.log('mk', event.type)
1469
1464
 
1470
1465
  this.markerEvent_(event, markerId, marker.getLngLat(),
1471
1466
  anatomicalId, annotation)
1472
- console.log('mk handled...')
1473
1467
  event.stopPropagation()
1474
1468
  }
1475
1469
  }
@@ -113,7 +113,6 @@ export class ClusteredMarkerLayer
113
113
  const features = this.#map.queryRenderedFeatures(e.point, {
114
114
  layers: ['clustered-markers']
115
115
  })
116
- console.log('Cluster marker', features)
117
116
  const clusterId = features[0].properties.cluster_id
118
117
  const zoom = await this.#map.getSource('markers').getClusterExpansionZoom(clusterId)
119
118
  this.#map.easeTo({
@@ -122,10 +121,10 @@ export class ClusteredMarkerLayer
122
121
  })
123
122
  })
124
123
 
124
+ console.log('Unclustered click', e, features)
125
125
  this.#map.on('click', 'single-points', this.singleMarkerEvent.bind(this))
126
126
  this.#map.on('mouseenter', 'single-points', this.singleMarkerEvent.bind(this))
127
127
  this.#map.on('mousemove', 'single-points', this.singleMarkerEvent.bind(this))
128
- // this.#map.on('mouseleave', 'single-points', this.singleMarkerEvent.bind(this))
129
128
 
130
129
  this.#map.on('mouseenter', 'clustered-markers', () => {
131
130
  this.#map.getCanvas().style.cursor = 'pointer'
@@ -139,7 +138,6 @@ export class ClusteredMarkerLayer
139
138
  singleMarkerEvent(event)
140
139
  //======================
141
140
  {
142
- console.log('cl', event.type)
143
141
  const features = this.#map.queryRenderedFeatures(event.point, {
144
142
  layers: ['single-points']
145
143
  })
@@ -148,7 +146,6 @@ console.log('cl', event.type)
148
146
  const position = properties.markerPosition.slice(1, -1).split(',').map(p => +p)
149
147
  this.#ui.markerEvent_(event, feature.id, position, properties.models, properties)
150
148
  }
151
- console.log('cl handled...')
152
149
  event.originalEvent.stopPropagation()
153
150
  }
154
151
 
@@ -425,14 +425,10 @@ export class LayerManager
425
425
  mapLayer.setFilter(this.__layerOptions);
426
426
  }
427
427
  if (this.#flightPathLayer) {
428
- // * @arg options.layerOptions.sckan {string} Show neuron paths known to SCKAN: values are ``valid`` (default),
429
- // * ``invalid``, ``all`` or ``none``.
430
-
431
-
432
428
  const sckanState = options.sckan || 'valid'
433
429
  const sckanFilter = (sckanState == 'none') ? {NOT: {HAS: 'sckan'}} :
434
430
  (sckanState == 'valid') ? {sckan: true} :
435
- (sckanState == 'invalid') ? {NOT: {sckan: true}} : // {sckan: false} is different...
431
+ (sckanState == 'invalid') ? {NOT: {sckan: true}} :
436
432
  true
437
433
  const featureFilter = new PropertiesFilter(sckanFilter)
438
434
  if ('taxons' in options) {
package/src/main.js CHANGED
@@ -49,15 +49,12 @@ const ALL_MARKERS = [
49
49
  'UBERON:0037094',
50
50
  'ILX:0738305',
51
51
 
52
- // 'UBERON:0000948', // {className: 'heart-marker'}); // Heart
52
+ 'UBERON:0000948', // {className: 'heart-marker'}); // Heart
53
53
  'UBERON:0002048', // Lung
54
54
  'UBERON:0000945', // Stomach
55
55
  'UBERON:0001155', // Colon
56
56
  'UBERON:0001255', // Bladder
57
57
  'UBERON:0001759', // Vagus
58
-
59
- 'UBERON:0016508', // Pelvic ganglion
60
-
61
58
  ]
62
59
 
63
60
  //==============================================================================
@@ -175,8 +172,6 @@ export async function standaloneViewer(map_endpoint=null, options={})
175
172
  mapOptions.background = args[0].value;
176
173
  } else if (eventType === 'annotation') {
177
174
  drawControl.handleEvent(...args)
178
- } else if (args[0].type === 'marker') {
179
- console.log(eventType, ...args)
180
175
  }
181
176
  }, mapOptions)
182
177
  .then(map => {
@@ -188,11 +183,7 @@ export async function standaloneViewer(map_endpoint=null, options={})
188
183
  map.addMarker('UBERON:0001255'); // Bladder
189
184
  map.addMarker('UBERON:0001759'); // Vagus
190
185
  */
191
- map.addMarker('UBERON:0000945', {cluster: true}); // Stomach
192
- // map.addMarker('UBERON:0016508', {cluster: false}); // Pelvic ganglion
193
- map.addMarker('UBERON:0016508', {cluster: true}); // Pelvic ganglion
194
- map.addMarker('UBERON:0000948', {cluster: true, className: 'heart-marker'}); // Heart
195
- // map.addMarkers(ALL_MARKERS)
186
+ map.addMarkers(ALL_MARKERS, {cluster: true})
196
187
  currentMap = map;
197
188
  drawControl = new DrawControl(map)
198
189
  })
package/src/utils.js CHANGED
@@ -120,7 +120,6 @@ export function normaliseId(id)
120
120
 
121
121
  export function setDefaults(options, defaultOptions)
122
122
  {
123
- // c.f. Object.assign({}, defaultOptions, options)
124
123
  if (options === undefined || options === null) {
125
124
  return defaultOptions;
126
125
  }
package/src/types.ts DELETED
@@ -1,26 +0,0 @@
1
- /******************************************************************************
2
-
3
- Flatmap viewer and annotation tool
4
-
5
- Copyright (c) 2019 - 2024 David Brooks
6
-
7
- Licensed under the Apache License, Version 2.0 (the "License");
8
- you may not use this file except in compliance with the License.
9
- You may obtain a copy of the License at
10
-
11
- http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- Unless required by applicable law or agreed to in writing, software
14
- distributed under the License is distributed on an "AS IS" BASIS,
15
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- See the License for the specific language governing permissions and
17
- limitations under the License.
18
-
19
- ******************************************************************************/
20
-
21
- export type Constructor<T> = new(...args: any[]) => T
22
-
23
- export type ObjectRecord = Record<string, any>
24
-
25
- //==============================================================================
26
-