Transformations: Add documentation around new behavior of Calculate field (#104429)

* Docs changes

* remove generated placeholder for binary ops with variables

* Update public/app/features/transformers/docs/content.ts

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* Update public/app/features/transformers/docs/content.ts

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
This commit is contained in:
Kristina
2025-05-22 09:43:35 -05:00
committed by GitHub
parent c98792d924
commit bc3679957b
3 changed files with 5 additions and 3 deletions

View File

@ -695,9 +695,9 @@ export function getNameFromOptions(options: CalculateFieldTransformerOptions) {
const { binary } = options;
const alias = `${binary?.left?.matcher?.options ?? binary?.left?.fixed ?? ''} ${binary?.operator ?? ''} ${binary?.right?.matcher?.options ?? binary?.right?.fixed ?? ''}`;
//Remove $ signs as they will be interpolated and cause issues. Variables can still be used
//in alias but shouldn't in the autogenerated name
return alias.replace(/\$/g, '');
// binary calculations with variables will be interpolated on the visualization but we don't want to do that here, so just give a blank placeholder
const variableFound = /\$/g.test(alias);
return variableFound ? '' : alias;
}
case CalculateFieldMode.ReduceRow:
{