import { NodeAutocompletion } from "./autocompletions" export interface Indicator extends IndicatorNodeBase { data?: IndicatorData dimensions: IndicatorDimension[] type: IndicatorNodeType.Indicator } export type IndicatorData = { [key: string]: number } /// Dataset and its fields definining the keys of the indicator. /// An indicator must have at least one dimension. /// A dimension is not always perfect: some keys may be missing, /// other may have duplicates… export interface IndicatorDimension { /// Name of the field in the defining dataset that matches the keys of indicator keyField: string /// Optional name of the field that gives a label for each indicator key labelField?: string /// Path of dataset defining the indicator path: string } export interface IndicatorGroup extends IndicatorNodeBase { childrenAutocompletion?: NodeAutocompletion[] type: IndicatorNodeType.Group } export type IndicatorNode = Indicator | IndicatorGroup export interface IndicatorNodeBase { description?: string name: string path: string type: IndicatorNodeType } export enum IndicatorNodeType { Group = "GROUP", Indicator = "INDICATOR", }