1.0.9 • Published 6 months ago

noa-iran-map-react v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Noa Iran Map React

Features

  • Dynamic Province Coloring: Change the color intensity of provinces using their codes and provided values.
  • TypeScript Support: Enjoy type safety and seamless integration in TypeScript projects.
  • Next.js Ready: Fully compatible with React and Next.js environments.
  • Interactive: Easy-to-use props for dynamic updates and event handling.

Installation

   npm install noa-iran-map-react

Usage

"use cleint"
import React from 'react';
import {IranMap} from 'noa-iran-map-react';

export default function Home() {
    const data = {
        "IR-32": 100, // استان البرز
        "IR-15": 200, // استان کرمان
        "IR-04": 250, // استان کرمان
        // سایر استان‌ها...
    };

    return (
        <div style={{height:"200px"}}>
            <IranMap data={data}  />
        </div>
    );
}

Props

Prop NameTypeDefaultDescription
colorstring'#FF5733'The fill color for provinces that have data.
backgroundColorstring'#E0E0E0'The default color for provinces without specific data.
tooltipLabel(code: string) => stringundefinedFunction to define the tooltip label when hovering provinces.
dataRecord<string, number>{}An object containing province codes as keys and values as data.

Province Codes

Province NameCode
AlborzIR-32
KermanIR-15
FarsIR-04

All province codes's JSON file: Download

Authors

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago