# Change Firefly Javascript API for colormaps

XMLWordPrintable

#### Details

• Type: Story
• Status: To Do
• Resolution: Unresolved
• Fix Version/s: None
• Component/s:
• Labels:
• Story Points:
4
• Sprint:
SUIT Sprint 2019-02, SUIT Sprint 2019-03, SUIT Sprint 2019-04, SUIT Sprint 2019-05, SUIT Sprint 2019-07, SUIT Sprint 2019-08, SUIT Sprint 2019-09
• Team:
Science User Interface

#### Description

The current Javascript API for colormaps requires an integer from 0 to 21 (parameter cbarId to ImagePlotCntlr.ColorChange), mimicking a user picking from the menu bar. It has been decided that an integer is too fragile, especially if colormap choices are changed.
This ticket is to implement colormap changes to use names in the form of strings.

Before implementing this ticket, it will be necessary to reach consensus on the names of the colormaps.

IPAC FIRELFY ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-138

#### Activity

Hide
David Shupe added a comment -

The first-draft implementation of DM-15427 used the following names, which might be an appropriate starting point.

  'gray' or 0 : Gray Scale  'reversegray' or 1 : Reverse Gray Scale  'colorcube' or 2 : Color Cube  'spectrum' or 3 : Spectrum  'false' or 4 : For False Color  'reversefalse' or 5 : For False Color - Reverse  'falsecompressed' or 6 : For False Color - Compressed  'difference' or 7 : For difference images  'a-ds9' or 8 : ds9's a color bar  'b-ds9' or 9 : ds9's b color bar  'bb-ds9' or 10 : ds9's bb color bar  'he-ds9' or 11 : ds9's he color bar  'i8-ds9' or 12 : ds9's i8 color bar  'aips-ds9' or 13 : ds9's aips color bar  'sls-ds9' or 14 : ds9's sls color bar  'hsv-ds9' or 15 : ds9's hsv color bar  'heat-ds9' or 16 : Heat (ds9)  'cool-ds9' or 17 : Cool (ds9)  'rainbow-ds9' or 18 : Rainbow (ds9)  'standard-ds9' or 19 : Standard (ds9)  'staircase-ds9' or 20 : Staircase (ds9)  'color-ds9' or 21 : Color (ds9) 

Show
David Shupe added a comment - The first-draft implementation of DM-15427 used the following names, which might be an appropriate starting point. 'gray' or 0 : Gray Scale 'reversegray' or 1 : Reverse Gray Scale 'colorcube' or 2 : Color Cube 'spectrum' or 3 : Spectrum 'false' or 4 : For False Color 'reversefalse' or 5 : For False Color - Reverse 'falsecompressed' or 6 : For False Color - Compressed 'difference' or 7 : For difference images 'a-ds9' or 8 : ds9's a color bar 'b-ds9' or 9 : ds9's b color bar 'bb-ds9' or 10 : ds9's bb color bar 'he-ds9' or 11 : ds9's he color bar 'i8-ds9' or 12 : ds9's i8 color bar 'aips-ds9' or 13 : ds9's aips color bar 'sls-ds9' or 14 : ds9's sls color bar 'hsv-ds9' or 15 : ds9's hsv color bar 'heat-ds9' or 16 : Heat (ds9) 'cool-ds9' or 17 : Cool (ds9) 'rainbow-ds9' or 18 : Rainbow (ds9) 'standard-ds9' or 19 : Standard (ds9) 'staircase-ds9' or 20 : Staircase (ds9) 'color-ds9' or 21 : Color (ds9)
Hide
Gregory Dubois-Felsmann added a comment -

It's already implicit from David Shupe's above comment, but I would strongly suggest decoupling the API string names of the color maps from any text displayed for them in the UI, e.g., in tooltips.

I would also suggest that we refactor things a bit so that the list of color maps known to Firefly (i.e., ones for which it has implementation code available) can be larger than the list of color maps that are exposed through the UI.

Show
Gregory Dubois-Felsmann added a comment - It's already implicit from David Shupe 's above comment, but I would strongly suggest decoupling the API string names of the color maps from any text displayed for them in the UI, e.g., in tooltips. I would also suggest that we refactor things a bit so that the list of color maps known to Firefly (i.e., ones for which it has implementation code available) can be larger than the list of color maps that are exposed through the UI .
Hide
Gregory Dubois-Felsmann added a comment -

Two reasons for the above:

1. If we withdraw a colormap from the UI, this will not immediately break external (i.e., user) code that refers to that colormap via the API.
2. It would be nice for the selection and order of colormaps in the UI to be application-configurable.
Show
Gregory Dubois-Felsmann added a comment - Two reasons for the above: If we withdraw a colormap from the UI, this will not immediately break external (i.e., user) code that refers to that colormap via the API. It would be nice for the selection and order of colormaps in the UI to be application-configurable.

#### People

Assignee:
Trey Roby
Reporter:
David Shupe
Watchers:
Cindy Wang [X] (Inactive), David Shupe, Gregory Dubois-Felsmann, Tatiana Goldina, Trey Roby, Xiuqin Wu [X] (Inactive)