eurostat-map
    Preparing search index...

    Interface SparkMap

    Spark map type.

    interface SparkMap {
        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;
        position(v: { x?: number; y?: number; z?: number }): this;
        position(): { x: number; y: number; z: number };
        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;
        stat(config: StatConfig): this;
        stat(key: string): StatConfig;
        stat(key: string, config: StatConfig): this;
        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;
        updateLegend(): this;
        tooltip(): TooltipConfig;
        tooltip(config: TooltipConfig): this;
        zoomExtent(): [number, number];
        zoomExtent(extent: [number, number]): this;
        zoomButtons(): boolean;
        zoomButtons(show: boolean): this;
        insets(): false | "default" | InsetConfig[];
        insets(config: false | "default" | InsetConfig[]): this;
        drawGraticule(): boolean;
        drawGraticule(show: boolean): this;
        drawCoastalMargin(): boolean;
        drawCoastalMargin(show: boolean): this;
        coastalMarginSettings(): object;
        coastalMarginSettings(settings: object): this;
        placenames(): boolean;
        placenames(show: boolean): this;
        labels(): object;
        labels(config: object): this;
        annotations(): any;
        annotations(config: any): this;
        stamp(): object;
        stamp(config: { x: number; y: number; text: string; size?: number }): this;
        showScalebar(): boolean;
        showScalebar(show: boolean): this;
        scalebarPosition(): [number, number];
        scalebarPosition(pos: [number, number]): this;
        showEstatLogo(): boolean;
        showEstatLogo(show: boolean): this;
        showEstatRibbon(): boolean;
        showEstatRibbon(show: boolean): this;
        dorling(): boolean;
        dorling(enable: boolean): this;
        animateDorling(): boolean;
        animateDorling(animate: boolean): this;
        dorlingStrength(): { x: number; y: number };
        dorlingStrength(strength: { x: number; y: number }): this;
        dorlingIterations(): number;
        dorlingIterations(n: number): this;
        dorlingPadding(): number;
        dorlingPadding(padding: number): 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(): this;
        exportMapToPNG(width?: number, height?: number): Promise<SparkMap>;
        setFromURL(): this;
        transitionDuration(): number;
        transitionDuration(ms: number): this;
        filtersDefinitionFunction(): (svg: any, numberOfClasses: number) => void;
        filtersDefinitionFunction(
            fn: (svg: any, numberOfClasses: number) => void,
        ): this;
        regionCentroids(): { id: string; x: number; y: number }[];
        legend(): SparklineLegendConfig;
        legend(config: false | SparklineLegendConfig): this;
        sparkLineColor(): any;
        sparkLineColor(v: any): this;
        showOnlyWhenComplete(): boolean;
        showOnlyWhenComplete(v: boolean): this;
        sparkType(): "area" | "line" | "bar";
        sparkType(v: "area" | "line" | "bar"): this;
        sparkLineWidth(): number;
        sparkLineWidth(v: number): this;
        sparkLineHeight(): number;
        sparkLineHeight(v: number): this;
        sparkLineStrokeWidth(): number;
        sparkLineStrokeWidth(v: number): this;
        sparkLineOpacity(): number;
        sparkLineOpacity(v: number): this;
        sparkLineCircleRadius(): number;
        sparkLineCircleRadius(v: number): this;
        sparkLineAreaColor(): any;
        sparkLineAreaColor(v: any): this;
        sparkTooltipChart(): any;
        sparkTooltipChart(v: any): this;
        sparkLineChartFunction(): any;
        sparkLineChartFunction(v: any): this;
        sparkLineOffsets(): { x: number; y: number };
        sparkLineOffsets(v: { x: number; y: number }): this;
        sparklineData(dataObject: Record<string, Record<string, number>>): this;
        statSpark(config: SparkStatConfig): this;
        [key: string]: any;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any

      Allow additional map-type-specific properties and methods.

    Index

    Methods

    • 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 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()))
      
    • 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 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.

      Returns Promise<SparkMap>