Developer guide
Import the Trevas TS engine
yarn add @inseefr/trevas
Call the Trevas TS engine
import { interpret, type Bindings } from 'trevas';
const bindings: Bindings = {
sca: 1,
DS_1: {
dataStructure: [
{ name: 'id', type: 'STRING', role: 'IDENTIFIER' },
{ name: 'col1', type: 'INTEGER', role: 'MEASURE' },
{ name: 'col2', type: 'NUMBER', role: 'MEASURE' },
],
dataPoints: [
['a', 1, 1.1],
['b', 2, 2.2],
['c', 3, 303.33],
],
},
};
const result = interpret('sca + DS_1', bindings);
WebAssembly mode
See here the dedicated documentation.