Skip to content

Can't get the custom functions to work #965

@vhpoet

Description

@vhpoet

Followed your readme to come up with the below code which throws a Function name METRIC not recognized.. What am I doing wrong? Here's the codesandbox. Might be the same bug as this.

import HyperFormula, { FunctionPlugin } from "hyperformula"; class MetricPlugin extends FunctionPlugin { static implementedFunctions = { METRIC: { method: "metric" } }; metric(ast, state) { return this.runFunction(ast, state, this.metadata('METRIC'), () => 63); } } export default function App() { HyperFormula.registerFunctionPlugin(MetricPlugin); const hfInstance = HyperFormula.buildFromArray([["=METRIC()"]], { licenseKey: "gpl-v3" }); const value = hfInstance.getCellValue({ sheet: 0, col: 0, row: 0 }); console.log(value); return null; }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions