Description
Description
I'm implementing a custom function(eg. AGGREGATE) in a HyperFormula plugin that needs both the data and the formula text of each argument range to determine if certain functions should be ignored. However, I’m encountering two issues:
-
Range Undefined for Single Cells: When a single cell is passed as an argument, the
range
property isundefined
. For multi-cell ranges,range
provides the expected values. For consistency, it would be helpful ifrange
was defined for single cells as well. -
Request for Formula Text: In addition to the data, I need access to the formula text used in each range. Currently, I have no straightforward way to access the formula text directly in the custom function. This would allow me to handle certain behaviors based on the specific formula used.
Here is the code I’m using:
export class MyCustomPlugin extends FunctionPlugin {
aggregate(ast, state) {
return this.runFunction(
ast.args,
state,
this.metadata('AGGREGATE'),
(args) => {
console.log(args);
}
);
}
}
Expected Behavior
- The
range
property should not beundefined
for single-cell arguments. - Ideally, HyperFormula could provide formula text alongside the data for each argument range, allowing custom functions to process ranges based on the formula used.
Video or screenshots
Demo
https://codesandbox.io/p/devbox/exciting-cloud-cd9j7s
HyperFormula version
2.7.1
Your framework
Vue 3
Your environment
Chrome 90 Macos 15.0.1