Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Use a config option to display labels instead of values in the tooltip #1280

Closed
wadhwamatic opened this issue Jun 18, 2024 · 2 comments · Fixed by #1286
Closed
Assignees
Labels
enhancement New feature or request triage to be triaged for next action

Comments

@wadhwamatic
Copy link
Member

Provide a clear and concise description of what you want to happen.

In many cases, admin_level_data layers represent categorical variables. For example, in RBD, the ifpri_conflict_2023 layer uses the data field ACI_value which range from 1-4. The numeric values have a concept of ranking, but not of a real value.

When a user clicks on the map, the tooltip shows the numeric value (i.e. '1', '2', '3', '4'). I want to be able to optionally configure admin_level_data to use label instead of value in the tooltip. We can do this using feature_info_props by adding an attribute such as source. See the example below

    "feature_info_props": {
      "ACI_value": {
        "type": "string",
        "source": "label",
        "dataTitle": "Classification"
      }, 

This would then make use of the label associated with each value configured in the legend of this layer:

    "legend": [
      {
        "label": "Low / Inactive",
        "value": 1,
        "color": "#e6e6e6"
      },
      {
        "label": "Turbulent",
        "value": 2,
        "color": "#1f77b3"
      },
      {
        "label": "High",
        "value": 3,
        "color": "#f4a582"
      },
      {
        "label": "Extreme",
        "value": 4,
        "color": "#e51a19"
      }
    ]

The change mentioned above should show this:

Mali, Gao, Menaka
IFPRI / ACLED Conflict Analysis - 2023
Classification: Extreme

A side note - the term feature_info_props is pretty abstract. If we can look into changing this to tooltip or something more clear, that would be appreciated too!

Is there anything else you can add about the proposal? You might want to link to related issues here, if you haven't already.

No response

@wadhwamatic wadhwamatic added enhancement New feature or request triage to be triaged for next action labels Jun 18, 2024
@wadhwamatic wadhwamatic self-assigned this Jun 18, 2024
@wadhwamatic
Copy link
Member Author

The RBD configuration mentioned above is in #1189

@wadhwamatic wadhwamatic assigned gislawill and unassigned wadhwamatic Jun 18, 2024
@gislawill
Copy link
Collaborator

Example for Will to reference later
Screenshot 2024-06-18 at 11 44 08 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage to be triaged for next action
Projects
None yet
2 participants