eurostat-map
    Preparing search index...

    Interface TrivariateChoroplethMap

    Trivariate choropleth map type.

    interface TrivariateChoroplethMap {
        svgId(): string;
        svgId(id: string): this;
        containerId(): string;
        containerId(id: string): this;
        width(): number;
        width(w: number): this;
        height(): number;
        height(h: number): this;
        geo(): string;
        geo(g: string): this;
        proj(): string;
        proj(p: string): this;
        scale(): string;
        scale(s: "60M" | "20M" | "10M" | "03M" | "01M"): this;
        nutsLevel(): number | "mixed";
        nutsLevel(level: number | "mixed"): this;
        nutsYear(): number;
        nutsYear(year: number): this;
        nuts2jsonBaseURL(): string;
        nuts2jsonBaseURL(url: string): this;
        worldTopojsonURL(): string;
        worldTopojsonURL(url: string): this;
        position(v: { x?: number; y?: number; z?: number }): this;
        position(): { x: number; y: number; z: number };
        defaultFitZoom(): number;
        defaultFitZoom(factor: number): this;
        projectionFunction(): any;
        projectionFunction(fn: any): this;
        title(): string;
        title(t: string): this;
        subtitle(): string;
        subtitle(t: string): this;
        footnote(): string | false;
        footnote(text: string | false): this;
        footnoteTooltipText(): string | false;
        footnoteTooltipText(text: string | false): this;
        footnoteWrap(): number | false;
        footnoteWrap(chars: number | false): this;
        stat(): | StatConfig
        | CompositionStatConfig<Record<string, Record<string, number>>>;
        stat(
            config:
                | StatConfig
                | CompositionStatConfig<Record<string, Record<string, number>>>,
        ): this;
        stat(
            key: string,
        ):
            | StatConfig
            | CompositionStatConfig<Record<string, Record<string, number>>>;
        stat(
            key: string,
            config:
                | StatConfig
                | CompositionStatConfig<Record<string, Record<string, number>>>,
        ): this;
        stat(
            key: string,
            config:
                | StatConfig
                | CompositionStatConfig<Record<string, Record<string, number>>>,
            categoryParameter: string,
            categoryCodes?: string[],
            categoryLabels?: string[],
            categoryColors?: string[],
            totalCode?: string,
        ): this;
        encoding(): Record<string, EncodingConfig>;
        encoding(channel: string): EncodingConfig;
        encoding(channel: string, config: EncodingConfig): this;
        encoding(configs: Record<string, EncodingConfig>): this;
        getEncodingStat(channel: string, fallback?: string): string;
        getEncodingStats(channel: string, fallback?: string[]): string[];
        getEncodingStatKey(
            channel: string,
            categoryCode?: string,
            fallbackStat?: string,
        ): string;
        getEncodingStatData(
            channel: string,
            categoryCode?: string,
            fallbackStat?: string,
        ): StatData;
        getEncodingValue(
            channel: string,
            regionId: string,
            categoryCode?: string,
            fallbackStat?: string,
        ): string | number;
        getEncodingUnitText(
            channel: string,
            categoryCode?: string,
            fallbackStat?: string,
        ): string;
        statData(): StatData;
        statData(key: string): StatData;
        statData(key: string, data: StatData): this;
        getTime(): string;
        noDataText(): string;
        noDataText(text: string): this;
        language(): string;
        language(lang: string): this;
        legend(): false | LegendConfig;
        legend(config: false | LegendConfig): this;
        updateLegend(): this;
        rankedBarChart(): false | RankedBarChartConfig;
        rankedBarChart(config: false | RankedBarChartConfig): this;
        updateRankedBarChart(): this;
        tooltip(): TooltipConfig;
        tooltip(config: TooltipConfig): this;
        zoomExtent(): [number, number];
        zoomExtent(extent: [number, number]): this;
        zoomButtons(): boolean;
        zoomButtons(show: boolean): this;
        translateExtent(): [[number, number], [number, number]];
        translateExtent(extent: [[number, number], [number, number]]): this;
        lockPanUntilZoom(): boolean;
        lockPanUntilZoom(lock: boolean): this;
        gridCartogramSettings(): GridCartogramSettings;
        gridCartogramSettings(settings: Partial<GridCartogramSettings>): this;
        insets(): false | "image" | "default" | InsetConfig[] | "eu" | "euEfta";
        insets(
            config: boolean | "image" | "default" | InsetConfig[] | "eu" | "euEfta",
        ): this;
        insetBoxPosition(): [number, number];
        insetBoxPosition(pos: [number, number]): this;
        insetBoxPadding(): number;
        insetBoxPadding(px: number): this;
        insetBoxWidth(): number;
        insetBoxWidth(px: number): this;
        insetScale(): string;
        insetScale(scale: string): this;
        insetZoomExtent(): [number, number];
        insetZoomExtent(extent: [number, number]): this;
        drawGraticule(): boolean;
        drawGraticule(show: boolean): this;
        drawCoastalMargin(): boolean;
        drawCoastalMargin(show: boolean): this;
        coastalMarginSettings(): CoastalMarginSettings;
        coastalMarginSettings(settings: Partial<CoastalMarginSettings>): this;
        placenames(): boolean;
        placenames(show: boolean): this;
        labels(): LabelsConfig;
        labels(config: false | LabelsConfig): this;
        annotations(): { annotations: any[]; editMode?: boolean };
        annotations(
            config: false | { annotations: any[]; editMode?: boolean },
        ): this;
        stamp(): StampConfig;
        stamp(config: false | StampConfig): this;
        scalebar(): ScalebarConfig;
        scalebar(config: boolean | ScalebarConfig): this;
        showScalebar(): boolean;
        showScalebar(show: boolean): this;
        scalebarPosition(): [number, number];
        scalebarPosition(pos: [number, number]): this;
        showEstatLogo(): boolean;
        showEstatLogo(show: boolean): this;
        logoWidth(): number;
        logoWidth(px: number): this;
        logoHeight(): number;
        logoHeight(px: number): this;
        showEstatRibbon(): boolean;
        showEstatRibbon(show: boolean): this;
        ribbonWidth(): number;
        ribbonWidth(px: number): this;
        ribbonHeight(): number;
        ribbonHeight(px: number): this;
        svg(): any;
        svg(s: any): this;
        addLocation(config: LocationConfig): this;
        removeLocation(id: string): this;
        clearLocations(): this;
        locations(): LocationConfig[];
        locations(configs: LocationConfig[]): this;
        updateLocations(): this;
        filterGeometriesFunction(): (geometry: any) => boolean;
        filterGeometriesFunction(fn: (geometry: any) => boolean): this;
        gridCartogram(): boolean;
        gridCartogram(enable: boolean): this;
        backgroundMap(): boolean;
        backgroundMap(show: boolean): this;
        updateBackgroundMap(): this;
        minimap(): MinimapConfig;
        minimap(config: MinimapConfig): this;
        insetsButton(): boolean;
        insetsButton(show: boolean): this;
        legendButton(): boolean;
        legendButton(show: boolean): this;
        placenamesFilter(): (name: any) => boolean;
        placenamesFilter(fn: (name: any) => boolean): this;
        header(): boolean;
        header(show: boolean): this;
        footer(): boolean;
        footer(show: boolean): this;
        footerPadding(): number;
        footerPadding(padding: number): this;
        headerPadding(): number;
        headerPadding(padding: number): this;
        titlePosition(): [number, number];
        titlePosition(pos: [number, number]): this;
        subtitlePosition(): [number, number];
        subtitlePosition(pos: [number, number]): this;
        footnotePosition(): [number, number];
        footnotePosition(pos: [number, number]): this;
        logoPosition(): [number, number];
        logoPosition(pos: [number, number]): this;
        ribbonPosition(): [number, number];
        ribbonPosition(pos: [number, number]): this;
        zoomButtonsPosition(): [number, number];
        zoomButtonsPosition(pos: [number, number]): this;
        insetsButtonPosition(): [number, number];
        insetsButtonPosition(pos: [number, number]): this;
        insetsVisibilityBreakpoint(): number;
        insetsVisibilityBreakpoint(px: number): this;
        legendButtonPosition(): [number, number];
        legendButtonPosition(pos: [number, number]): this;
        legendVisibilityBreakpoint(): number;
        legendVisibilityBreakpoint(px: number): this;
        hoverColor(): string;
        hoverColor(color: string): this;
        showSourceLink(): boolean;
        showSourceLink(show: boolean): this;
        patternFill(): PatternFillConfig | PatternFillConfig[];
        patternFill(config: PatternFillConfig | PatternFillConfig[]): this;
        dorling(): boolean;
        dorling(enable: boolean): this;
        dorlingSettings(): DorlingSettings;
        dorlingSettings(settings: Partial<DorlingSettings>): this;
        onZoomEnd(): (event: any) => void;
        onZoomEnd(fn: (event: any) => void): this;
        onZoom(): (event: any) => void;
        onZoom(fn: (event: any) => void): this;
        onRegionMouseOver(): (
            event: MouseEvent,
            regionId: string,
            props: any,
        ) => void;
        onRegionMouseOver(
            fn: (event: MouseEvent, regionId: string, props: any) => void,
        ): this;
        onRegionMouseMove(): (
            event: MouseEvent,
            regionId: string,
            props: any,
        ) => void;
        onRegionMouseMove(
            fn: (event: MouseEvent, regionId: string, props: any) => void,
        ): this;
        onRegionMouseOut(): (
            event: MouseEvent,
            regionId: string,
            props: any,
        ) => void;
        onRegionMouseOut(
            fn: (event: MouseEvent, regionId: string, props: any) => void,
        ): this;
        onRegionClick(): (event: MouseEvent, regionId: string, props: any) => void;
        onRegionClick(
            fn: (event: MouseEvent, regionId: string, props: any) => void,
        ): this;
        onBuild(): (map: MapInstance) => void;
        onBuild(callback: (map: MapInstance) => void): this;
        build(): this;
        updateGeoData(): this;
        updateStatData(): this;
        updateStatValues(): this;
        updateClassification(): this;
        updateStyle(): this;
        recalculateLayout(): void;
        exportMapToSVG(filename?: string): this;
        exportMapToPNG(
            width?: number,
            height?: number,
            filename?: string,
        ): Promise<TrivariateChoroplethMap>;
        setFromURL(): this;
        transitionDuration(): number;
        transitionDuration(ms: number): this;
        filtersDefinitionFunction(): (svg: any, numberOfClasses: number) => void;
        filtersDefinitionFunction(
            fn: (svg: any, numberOfClasses: number) => void,
        ): this;
        regionCentroids(): Map<string, [number, number]>;
        layers_: Layer[];
        activeLayerIndex_: number;
        activeLayer(): Layer;
        layer(ref?: string | number): Layer;
        layers(): Layer[];
        layers(configs: LayerConfig[]): this;
        addLayer(type: string, config?: LayerConfig): Layer;
        addLayer(config: LayerConfig): Layer;
        removeLayer(ref: string | number): this;
        activeLayerIndex(): number;
        activeLayerIndex(i: number): this;
        updateAllLayers(): this;
        getTernaryStatCodes(): [string, string, string];
        ternaryCodes(): string[];
        ternaryCodes(v: string[]): this;
        noDataFillStyle(): string;
        noDataFillStyle(v: string): this;
        ternarySettings(): TrivariateTernarySettings;
        ternarySettings(v: Partial<TernarySettings>): this;
        [key: string]: any;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any

      Allow additional map-type-specific properties and methods.

    Index
    svgId containerId width height geo proj scale nutsLevel nutsYear nuts2jsonBaseURL worldTopojsonURL position defaultFitZoom projectionFunction title subtitle footnote footnoteTooltipText footnoteWrap stat encoding getEncodingStat getEncodingStats getEncodingStatKey getEncodingStatData getEncodingValue getEncodingUnitText statData getTime noDataText language legend updateLegend rankedBarChart updateRankedBarChart tooltip zoomExtent zoomButtons translateExtent lockPanUntilZoom gridCartogramSettings insets insetBoxPosition insetBoxPadding insetBoxWidth insetScale insetZoomExtent drawGraticule drawCoastalMargin coastalMarginSettings placenames labels annotations stamp scalebar showScalebar scalebarPosition showEstatLogo logoWidth logoHeight showEstatRibbon ribbonWidth ribbonHeight svg addLocation removeLocation clearLocations locations updateLocations filterGeometriesFunction gridCartogram backgroundMap updateBackgroundMap minimap insetsButton legendButton placenamesFilter header footer footerPadding headerPadding titlePosition subtitlePosition footnotePosition logoPosition ribbonPosition zoomButtonsPosition insetsButtonPosition insetsVisibilityBreakpoint legendButtonPosition legendVisibilityBreakpoint hoverColor showSourceLink patternFill dorling dorlingSettings onZoomEnd onZoom onRegionMouseOver onRegionMouseMove onRegionMouseOut onRegionClick onBuild build updateGeoData updateStatData updateStatValues updateClassification updateStyle recalculateLayout exportMapToSVG exportMapToPNG setFromURL transitionDuration filtersDefinitionFunction regionCentroids activeLayer layer layers addLayer removeLayer activeLayerIndex updateAllLayers getTernaryStatCodes ternaryCodes noDataFillStyle ternarySettings
    layers_: Layer[]

    Ordered thematic layer stack (bottom → top).

    activeLayerIndex_: number
    • Base URL used to fetch NUTS2JSON boundary geometries (and, for insets, whatever base URL is set on the owning map, unless overridden per-inset). Setting this on the top-level map also propagates it to all insets.

      Returns string

      'https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2' (or the
      ec.europa.eu cache when running on an ec.europa.eu host)
    • Parameters

      • url: string

      Returns this

    • URL of the world boundaries topojson file used by geo('WORLD') maps. Not part of Nuts2json (a separate, bundled eurostat-map asset), so it is independent of nuts2jsonBaseURL. Setting this on the top-level map also propagates it to all insets.

      Returns string

      'https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/WORLD_4326.json'
      (or the ec.europa.eu asset host when running on an ec.europa.eu host)
    • Parameters

      • url: string

      Returns this

    • Initial map viewport. x/y in projected coordinates, z is pixel size (map units per screen pixel — smaller = more zoomed in).

      Parameters

      • v: { x?: number; y?: number; z?: number }

      Returns this

      map.position({ x: 4800000, y: 3400000, z: 6000 })
      
    • Returns { x: number; y: number; z: number }

    • Returns the concrete statData key for a channel/category combination.

      Parameters

      • channel: string
      • OptionalcategoryCode: string
      • OptionalfallbackStat: string

      Returns string

    • Returns a region value through encoding lookup.

      Parameters

      • channel: string
      • regionId: string
      • OptionalcategoryCode: string
      • OptionalfallbackStat: string

      Returns string | number

    • Returns unit text through encoding lookup.

      Parameters

      • channel: string
      • OptionalcategoryCode: string
      • OptionalfallbackStat: string

      Returns string

    • Returns the time dimension value from the loaded Eurostat dataset. Useful for displaying the data period in the map title.

      Returns string

      map.onBuild(() => map.title('Population ' + map.getTime()))
      
    • Inset map configurations. Pass a named preset string, or a custom array, or false to disable. Passing true is an alias for 'default'.

      • 'default': simple grid layout of overseas territories.
      • 'image': Malta, Liechtenstein and EU/EFTA overseas/remote territories, hand-tuned layout with connecting decoration (background box, separator lines, blur gradients).
      • 'eu': simple grid layout of EU overseas/outermost territories, no decoration.
      • 'euEfta': like 'eu', plus Liechtenstein and Svalbard, no decoration.

      Returns false | "image" | "default" | InsetConfig[] | "eu" | "euEfta"

      map.insets('default')
      
      map.insets('image')
      
      map.insets(true)
      
      map.insets([{ geo: 'MT' }, { geo: 'LI' }])
      
    • Parameters

      • config: boolean | "image" | "default" | InsetConfig[] | "eu" | "euEfta"

      Returns this

    • Annotation configuration, rendered via the d3-svg-annotation library. annotations is an array of d3-svg-annotation annotation objects; each object's type may be one of 'annotationLabel' (default), 'annotationCallout', 'annotationCalloutRect', 'annotationCalloutCircle', 'annotationXYThreshold', resolved to the matching d3-svg-annotation function internally.

      Returns { annotations: any[]; editMode?: boolean }

    • Parameters

      • config: false | { annotations: any[]; editMode?: boolean }

      Returns this

    • Shows or hides the background map on an already-built instance to match the current backgroundMap() value, without a full rebuild - draws it on demand if it wasn't already built. No-op for grid cartograms.

      Returns this

    • Builds the map from scratch. Call once after initial configuration.

      Returns this

      eurostatmap.map('choropleth')
      .stat({ eurostatDatasetCode: 'demo_r_d3dens' })
      .build()
    • Exports the map as an SVG file and triggers a browser download. Computed CSS styles are inlined before export.

      Parameters

      • Optionalfilename: string

        Download filename without extension.

      Returns this

      'eurostatmap'
      
    • Exports the map as a PNG file and triggers a browser download.

      Parameters

      • Optionalwidth: number

        Output width in pixels. Defaults to SVG width.

      • Optionalheight: number

        Output height in pixels. Defaults to SVG height.

      • Optionalfilename: string

        Download filename without extension.

      Returns Promise<TrivariateChoroplethMap>

      'eurostatmap'
      
    • Returns the resolved [v1, v2, v3] stat codes for the three ternary variables, honoring any 'color' encoding before falling back to ternaryCodes.

      Returns [string, string, string]