AnatomicMaps / flatmap-viewer

0 stars 7 forks source link

Adding 3 function to flatmap-view.js #10

Closed napakalas closed 9 months ago

napakalas commented 1 year ago

Adding three functions to FlatMap class

  1. getPathFilters()

    • return: {control: true, type: Array())
    • control: indicate the PATH button is activated or not
    • type: an array of path type
      • example: {checked:true, label: 'CNS', colour: '#9B1FC1', type: 'cns', id: 'path-cns', style: ['nerve-line','nerve-para-post']}
  2. getLayerFilters()

    • return: {control: true, type: Array())
    • control: indicate the PATH button is activated or not
    • type: an array of layer type
      • example: {checked:true, description: 'Layer whole-rat', type: 'whole-rat', id: 'layer-whole-rat', image-layers: ['whole-rat_image']}
  3. getFC()

    • checking whether FC or AC, returning boolean

Ignore changes in main.js. Those are for testing purpose.

napakalas commented 1 year ago

adding more functions to access annotation/feature's attributes:

dbrnz commented 1 year ago

This all seems more detailed than necessary: Why isFC() when an external user can test .options.style === 'fcdiagram'? Why a lot of getAnnotation*(featureId) methods when a single getAnnotation(featureId) would do to get all properties in a single structure?

More generally, what is the intended use of exposing these properties? Describing them as annotation may be attaching more weight to what they are in the context of drawing external legends and controls.

napakalas commented 1 year ago

Yes, .options.style === 'fcdiagram' is sufficient for external users. I was just thinking of providing an interface that is easy to spot from the function name. But since they are familiar with mapviewer, I understand that isFC is unnecessary.

For getAnnotation*, the motivation is the same as isFC, I agree that it is too detailed and is already represented by annotation(). What hasn't been shown yet is the status, i.e. {active:true, annotated:true}. If needed, I can add it in annotation().