Skip to content

ozgrozer/react-turkey-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-turkey-map

Customizable Turkey map

npm license

Demo

Basic Map

PlayCode - StackBlitz - CodeSandbox - Vercel (Next.js) - CodePen (UMD) - JSFiddle (UMD)

Colorful Map

PlayCode - StackBlitz - CodeSandbox - Vercel (Next.js) - CodePen (UMD) - JSFiddle (UMD)

Preview

Basic Map

Colorful Map

Installation

Install with NPM

npm install react-turkey-map

Usage

import TurkeyMap from 'react-turkey-map'

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

Props

<TurkeyMap
  showTooltip
  colorData={{}}
  tooltipData={{}}
/>

// types and defaults
showTooltip: bool (default: true)
colorData: object (default: {})
tooltipData: object (default: {})

// 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'
}}

Contribution

Feel free to contribute. Open a new issue, or make a pull request.

License

MIT