eurostat-map
    Preparing search index...

    Interface StatData

    A statistical dataset indexed by NUTS region ID. Returned by map.statData() and created internally by statData().

    interface StatData {
        get(
            nutsId?: string,
        ):
            | { value: any; status?: string }
            | Record<string, { value: any; status?: string }>;
        getValue(nutsId: string): any;
        set(nutsId: string, stat: any): this;
        setData(
            data: Record<string, number | string | { value: any; status?: string }>,
        ): this;
        setManualMultiDate(data: Record<string, Record<string, number>>): this;
        hasData(): boolean;
        hasNumericData(): boolean;
        getArray(): any[];
        getUniqueValues(): any[];
        getMin(): number;
        getMax(): number;
        getMaxRegionId(): string;
        getMinRegionId(): string;
        isReady(): boolean;
        getTime(): string;
        unitText(): string;
        unitText(text: string): this;
        metadata?: {
            label?: string;
            href?: string;
            source?: string;
            updated?: string;
            time?: string;
            extension?: any;
        };
        eurostatDatasetCode_?: string;
        csvURL_?: string;
        retrieveFromRemote(
            nutsLevel: number,
            lang: string,
            callback: () => void,
        ): this;
    }
    Index

    Properties

    metadata?: {
        label?: string;
        href?: string;
        source?: string;
        updated?: string;
        time?: string;
        extension?: any;
    }

    Metadata from the Eurostat API response or CSV source.

    Type Declaration

    • Optionallabel?: string

      Label.

    • Optionalhref?: string

      Href.

    • Optionalsource?: string

      Source.

    • Optionalupdated?: string

      Updated.

    • Optionaltime?: string

      Time.

    • Optionalextension?: any

      Extension.

    eurostatDatasetCode_?: string

    Eurostat dataset code.

    csvURL_?: string

    CSV source URL.

    Methods

    • Returns the stat entry {value, status} for a given NUTS ID. If called with no argument, returns the entire data index.

      Parameters

      • OptionalnutsId: string

      Returns
          | { value: any; status?: string }
          | Record<string, { value: any; status?: string }>

      map.statData().get('DE')  // → { value: 120, status: 'e' }
      
    • Returns the raw value for a given NUTS ID.

      Parameters

      • nutsId: string

      Returns any

      map.statData().getValue('DE')  // → 120
      
    • Sets a stat value for a given NUTS ID.

      Parameters

      • nutsId: string

        The NUTS region ID.

      • stat: any

        Either a value directly or an object { value, status }.

      Returns this

      map.statData().set('DE', 120)
      
      map.statData().set('DE', { value: 120, status: 'e' })
      
    • Sets the entire dataset at once, indexed by NUTS ID. Overwrites any previously loaded data.

      Parameters

      • data: Record<string, number | string | { value: any; status?: string }>

      Returns this

      map.statData().setData({ DE: 120, FR: 95, IT: 88 })
      // or with status:
      map.statData().setData({ DE: { value: 120, status: 'e' }, FR: 95 })
    • Sets multi-date data for sparkline maps.

      Parameters

      Returns this

      map.statData().setManualMultiDate({ DE: { '2020': 100, '2021': 110 } })
      
    • Returns the time stamp of the loaded Eurostat dataset. Reflects the 'time' filter if set, otherwise the first time dimension in the API response.

      Returns string

    • Fetches data from the configured remote source (Eurostat API or CSV). Called internally by the map build pipeline.

      Parameters

      • nutsLevel: number

        NUTS level (0–3).

      • lang: string

        BCP 47 language code. e.g. 'en'

      • callback: () => void

        Called when data is ready.

      Returns this