Skip to content

Commit

Permalink
feat: Add info popups for MCDA layer parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
albaranau committed May 31, 2024
1 parent 875eb64 commit 7a29b64
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
8 changes: 8 additions & 0 deletions src/core/localization/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@
"range_from_cannot_be_bigger": "The ‘from’ value cannot be bigger than the ‘to’ value",
"range_cannot_be_empty": "Range cannot be empty",
"range_must_be_a_number": "Range must be a valid number"
},
"tips": {
"range": "Define the minimum and maximum values considered for analysis. For example, if analysing temperature data, set the range from the lowest to the highest temperatures recorded in the dataset.",
"sentiment": "Determine the direction of sentiment for the layer's impact on the analysis:\n* **Bad → Good**: Higher values indicate a positive sentiment.\n* **Good → Bad**: Higher values indicate a negative sentiment.",
"weight": "By default, all layers contribute equally to the analysis through a weighted average. Adjusting the increased weight of a layer (2, 3, etc.) allows you to assign additional importance to it in the analysis.",
"transform": "Apply additional calculations to the layer to linearize distribution. Calculates before normalization:\n * **No**: No additional transformation is applied.\n* **Natural logarithm**: Apply the natural logarithm function to the values.\n* **Square root**: Apply the square root function to the values.\n* **Cube root**: Apply the cube root function to the values.\n\nBy default, transformation with the least skew is selected.",
"normalize": "Adjusts values to a standardized scale. This helps compare them easily and make decisions.\n* **Standard score scaling**: This option adjusts values to a standardized scale, ensuring they are all comparable.\n* **No (for specialists only)**: Leaves values unmodified.",
"outliers": "* **As values on limits**: Keep 0 and 1 for min and max, but allow outlier scores beyond this range.\n* **Exclude**: Exclude areas where values are out of range."
}
},
"bad": "Bad",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ export function MCDALayerParameterRow({
<div className={s.inputLine}>
<span className={s.inputLinelabel}>
{name}
{/* TODO: hidden temporarily until we add content for these popups */}
{/* <TooltipTrigger
<TooltipTrigger
className={s.infoButton}
tipText={tipText}
tooltipId={LAYERS_PANEL_FEATURE_ID}
/> */}
/>
</span>
<div className={s.inputContainer}>{children}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
// Edit mode
<div className={s.layerEditContainer}>
{/* RANGE */}
<MCDALayerParameterRow name={i18n.t('mcda.layer_editor.range')} tipText="">
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.range')}
tipText={i18n.t('mcda.layer_editor.tips.range')}
>
<div className={s.rangeInputContainer}>
<Input
className={s.rangeInputRoot}
Expand Down Expand Up @@ -295,7 +298,10 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
</div>
</MCDALayerParameterRow>
{/* OUTLIERS */}
<MCDALayerParameterRow name={i18n.t('mcda.layer_editor.outliers')} tipText="">
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.outliers')}
tipText={i18n.t('mcda.layer_editor.tips.outliers')}
>
<Select
className={s.selectInput}
classes={{
Expand All @@ -311,7 +317,7 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
{/* SENTIMENT */}
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.sentiment')}
tipText=""
tipText={i18n.t('mcda.layer_editor.tips.sentiment')}
>
<Select
className={s.selectInput}
Expand All @@ -326,7 +332,10 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
/>
</MCDALayerParameterRow>
{/* WEIGHT */}
<MCDALayerParameterRow name={i18n.t('mcda.layer_editor.weight')} tipText="">
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.weight')}
tipText={i18n.t('mcda.layer_editor.tips.weight')}
>
<Input
classes={{
inputBox: s.textInputBox,
Expand All @@ -350,7 +359,7 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
{/* TRANSFORM */}
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.transform')}
tipText=""
tipText={i18n.t('mcda.layer_editor.tips.transform')}
>
<Select
className={s.selectInput}
Expand All @@ -367,7 +376,7 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
{/* NORMALIZE */}
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.normalize')}
tipText=""
tipText={i18n.t('mcda.layer_editor.tips.normalize')}
>
<Select
className={s.selectInput}
Expand Down

0 comments on commit 7a29b64

Please sign in to comment.