Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-svg-worldmap

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-svg-worldmap - npm Package Compare versions

Comparing version 1.0.36 to 1.0.37

10

CHANGELOG.md

@@ -59,2 +59,10 @@ # CHANGELOG

* Added localization ability and tooltip text customization through a callback function called tooltipTextFunction
* Added example of how to use to examples
* Added example of how to use to examples
## 1.0.36
* README.md typo
## 1.0.37
* Onclick callback as requested, for instructions on usage see README.md, for an example look at the example folder under onclick-example.

@@ -26,2 +26,3 @@ import React from "react";

styleFunction?: (context: ICountryContext) => {};
onClickFunction?: (event: React.MouseEvent<SVGElement, MouseEvent>, countryName: string, isoCode: string, value: string, prefix: string, suffix: string) => {};
tooltipTextFunction?: (countryName: string, isoCode: string, value: string, prefix: string, suffix: string) => string;

@@ -28,0 +29,0 @@ borderColor?: string;

2

package.json
{
"name": "react-svg-worldmap",
"version": "1.0.36",
"version": "1.0.37",
"license": "MIT",

@@ -5,0 +5,0 @@ "displayName": "React Worldmap",

@@ -109,2 +109,21 @@ # react-svg-worldmap [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://img.shields.io/npm/v/react-svg-worldmap.svg?style=flat)](https://www.npmjs.com/package/react-svg-worldmap) [![Demo: Simple Example](https://img.shields.io/badge/demo-live-red.svg)](https://react-svg-worldmap-simple-example.imfast.io)

### On Click Action
This is an optional more advanced customization option. When used, the developer has full access to the click event, country name, iso code, value, prefix and suffix is given.
This is done by passing your custom implementation of the `onClickFunction`. The function takes in the following parameters:
`1. event: React.MouseEvent<SVGElement, MouseEvent>`
`2. countryName: string`
`3. isoCode: string`
`4. value: string`
`5. prefix?: string`
`6. suffix?: string`
For example:
~~~tsx
const clickAction = (event: React.MouseEvent<SVGElement, MouseEvent>, countryName: string, isoCode: string, value: string, prefix?: string, suffix?: string) => {
//Your action on click that you want to perform see example in the examples folder called onclick-example
}
~~~
### Optional Props

@@ -111,0 +130,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc