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

feat(18117): Add info popups for MCDA layer parameters #753

Merged
merged 7 commits into from
Jun 3, 2024
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 @@ -4,25 +4,24 @@ import s from './MCDALayerParameterRow.module.css';

export type MCDALayerParameterRowProps = {
name: string;
tipText: string;
infoText: string;
children?: JSX.Element | JSX.Element[];
};

export function MCDALayerParameterRow({
name,
tipText,
infoText,
children,
}: MCDALayerParameterRowProps) {
return (
<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}
tipText={infoText}
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 @@ -265,7 +265,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')}
infoText={i18n.t('mcda.layer_editor.tips.range')}
>
<div className={s.rangeInputContainer}>
<Input
className={s.rangeInputRoot}
Expand Down Expand Up @@ -308,7 +311,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')}
infoText={i18n.t('mcda.layer_editor.tips.outliers')}
>
<Select
className={s.selectInput}
classes={{
Expand All @@ -324,7 +330,7 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
{/* SENTIMENT */}
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.sentiment')}
tipText=""
infoText={i18n.t('mcda.layer_editor.tips.sentiment')}
>
<Select
className={s.selectInput}
Expand All @@ -339,7 +345,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')}
infoText={i18n.t('mcda.layer_editor.tips.weight')}
>
<Input
classes={{
inputBox: s.textInputBox,
Expand All @@ -363,7 +372,7 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
{/* TRANSFORM */}
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.transform')}
tipText=""
infoText={i18n.t('mcda.layer_editor.tips.transform')}
>
<Select
className={s.selectInput}
Expand All @@ -380,7 +389,7 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
{/* NORMALIZE */}
<MCDALayerParameterRow
name={i18n.t('mcda.layer_editor.normalize')}
tipText=""
infoText={i18n.t('mcda.layer_editor.tips.normalize')}
>
<Select
className={s.selectInput}
Expand Down
Loading