The correlation link will appear by the {correlations.resultField}
field. You can use the following
variables to set up your correlations:
{Object.entries(correlations.vars).map((entry) => {
return `\$\{${entry[0]}\} = ${entry[1]}\n`;
})}
{
setIsLabelDescOpen(!isLabelDescOpen);
}}
label={
Label / Description
{!isLabelDescOpen && !loadingLabel && (
{`Label: ${getValues('label') || defaultLabel}`}
)}
}
>
{
if (getValues('label') === '' && defaultLabel !== undefined) {
setValue('label', defaultLabel);
}
}}
/>
{
setIsTransformOpen(!isTransformOpen);
}}
label={
Transformations
}
>
{transformations.map((transformation, i) => {
const { type, field, expression, mapValue } = transformation;
const detailsString = [
(mapValue ?? '').length > 0 ? `Variable name: ${mapValue}` : undefined,
(expression ?? '').length > 0 ? (
<>
Expression: {expression}
>
) : undefined,
].filter((val) => val);
return (
{field}: {type}
{detailsString.length > 0 && (
{detailsString}
)}
{
setTransformationIdxToEdit(i);
setShowTransformationAddModal(true);
}}
/>
setTransformations(transformations.filter((_, idx) => i !== idx))}
closeOnConfirm
/>
);
})}
>
);
};
const getStyles = (theme: GrafanaTheme2) => {
return {
labelCollapseDetails: css({
marginLeft: theme.spacing(2),
...theme.typography['bodySmall'],
fontStyle: 'italic',
}),
transformationAction: css({
marginBottom: theme.spacing(2),
}),
transformationMeta: css({
alignItems: 'baseline',
}),
};
};