molgenis / molgenis-emx2

MOLGENIS EMX2, the latest version of the MOLGENIS data platform.
GNU Lesser General Public License v3.0
11 stars 16 forks source link

Allow users to retrieve and display additional values in tooltips #3847

Open davidruvolo51 opened 1 month ago

davidruvolo51 commented 1 month ago

Is your feature request related to a problem? Please describe.

In the GeoMercatorEmx component, it is possible to create a tooltip. However, you are limited to the variables retrieved by other predefined parameters (e.g., latitude, longtude, group, etc.). The tooltip component has the functionality to render data points as long as they are in the input object (i.e., row level). To allow for this flexibility, another parameter is needed to allow users to name additional variables as strings or graphql objects.

Describe the solution you'd like

Add a parameter to the GeoMercatorEmx component that allows users to select additional variables. Something like tooltipData or tooltipColumns.

Describe alternatives you've considered

You can define an extra variable using the group parameter, but this isn't the place to define tooltip variables.

Additional context

The functionality is available. In the file molgenis-viz/src/utils/emxViz.ts, there are a few functions available. gqlExtractSelectionName and gqlExtractSubSelectionNames. These are defined to unpack graphql strings, but they only return the first element. (This is to ensure the charts render properly.) Consider rewriting these functions to return the first element or all elements depending on the use.