import { NodeAutocompletion } from "./autocompletions" import { IndicatorDimension } from "./indicators" export interface Chart extends ChartNodeBase { data?: ChartData type: ChartNodeType.Chart } export interface ChartBasemap { path: string /// Name of TopoJSON field matching keyField of dimension of indicator topoJsonField: string } export interface ChartData { basemap: ChartBasemap breaks: number[] colorInterpolatorName: string colors: string[] discretizationMethod: string indicator: ChartIndicator /// labels by basemap code labels: { [key: string]: string } maxValue: number minValue: number reverseColors: boolean /// values by basemap code values: { [key: string]: number } } export interface ChartGroup extends ChartNodeBase { childrenAutocompletion?: NodeAutocompletion[] type: ChartNodeType.Group } export interface ChartIndicator { /// one of the dimensions of indicator, matching the dataset of the basemap dimension: IndicatorDimension path: string } export type ChartNode = Chart | ChartGroup export interface ChartNodeBase { description?: string name: string path: string type: ChartNodeType } export enum ChartNodeType { Chart = "CHART", Group = "GROUP", }