npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ts-turkey-map

v1.0.30

Published

Customizable Turkey map with TypeScript and React 19 support

Readme

ts-turkey-map

Customizable Turkey map with TypeScript and React 19 support

npm license

Installation

Install with NPM

npm install ts-turkey-map

Or with Yarn

yarn add ts-turkey-map

Usage

JavaScript/JSX

import TurkeyMap from 'ts-turkey-map'

export default () => {
  return (
    <TurkeyMap />
  )
}

TypeScript/TSX

import TurkeyMap from 'ts-turkey-map'
import type { TurkeyMapProps } from 'ts-turkey-map'

const MyComponent: React.FC = () => {
  const handleCityClick = (data: { city: string; plate: string }) => {
    console.log('Clicked city:', data.city, 'Plate:', data.plate)
  }

  return (
    <TurkeyMap 
      onClick={handleCityClick}
      showTooltip={true}
    />
  )
}

export default MyComponent

Next.js Usage

For Next.js projects, use the SSR-compatible wrapper:

import dynamic from 'next/dynamic'
import type { TurkeyMapProps } from 'ts-turkey-map'

// Using dynamic import to avoid SSR issues
const TurkeyMap = dynamic(() => import('ts-turkey-map'), { 
  ssr: false,
  loading: () => <div>Harita yükleniyor...</div>
})

export default function MyPage() {
  const colorData = {
    "01": "#ff0000", // Adana - red
    "06": "#00ff00", // Ankara - green
  }

  return (
    <div>
      <h1>Turkey Map</h1>
      <TurkeyMap 
        colorData={colorData}
        showTooltip={true}
        onClick={(data) => console.log(data)}
      />
    </div>
  )
}

Props

<TurkeyMap
  showTooltip={true}
  colorData={{}}
  tooltipData={{}}
  onClick={(data) => console.log(data)}
/>

TypeScript Interface

interface TurkeyMapProps {
  colorData?: ColorData;          // Record<string, string>
  showTooltip?: boolean;          // default: true
  tooltipData?: TooltipData;      // Record<string, string | number>
  onClick?: (data: { city: string; plate: string }) => void;
}

interface ColorData {
  [plate: string]: string;        // plate number to color mapping
}

interface TooltipData {
  [plate: string]: string | number; // plate number to tooltip content
}

Prop Details

  • showTooltip: boolean (default: true) - Shows/hides city tooltips on hover
  • colorData: ColorData (default: {}) - Maps plate numbers to colors
  • tooltipData: TooltipData (default: {}) - Maps plate numbers to tooltip content
  • onClick: function (optional) - Callback when a city is clicked
// colorData prop
// plate: city color
colorData={{
  '34': '#071E58',
  '06': '#253494',
  '35': '#253494',
  '16': '#253494',
  '07': '#225EA8'
}}

// tooltipData prop
// plate: city tooltip
tooltipData={{
  '34': '15.655.924',
  '06': '5.803.482',
  '35': '4.479.525',
  '16': '3.214.571',
  '07': '2.696.249'
}}

Based on

react-turkey-map

License

MIT