
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
react-image-mapper
Advanced tools
React Component to highlight interactive zones in images
Live demo: coldiary.github.io/react-image-mapper
To build the example locally, run:
npm install
npm start
Then open localhost:8000
in a browser.
The easiest way to use react-image-mapper is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc).
You can also use the standalone build by including dist/react-image-mapper.js
in your page. If you use this, make sure you have already included React, and it is available as a global variable.
npm install react-image-mapper --save
Import the component as you normally do, and add it wherever you like in your JSX views as below:
// ES5 require
var ImageMapper = require('react-image-mapper');
// ES6 import
import ImageMapper from 'react-image-mapper';
<ImageMapper src={IMAGE_URL} map={AREAS_MAP}/>
Props | type | Description | default |
---|---|---|---|
src | string | Image source url | required |
map | string | Mapping description | { name: generated, areas: [ ] } (see below) |
fillColor | string | Fill color of the highlighted zone | rgba(255, 255, 255, 0.5) |
strokeColor | string | Border color of the highlighted zone | rgba(0, 0, 0, 0.5) |
lineWidth | number | Border thickness of the highlighted zone | 1 |
width | number | Image width | Displayed width |
height | number | Image height | Displayed height |
active | bool | Enable/Disable highlighting | true |
Props callbacks | Called on | signature |
---|---|---|
onLoad | Image loading and canvas initialization completed | (): void |
onMouseEnter | Hovering a zone in image | (area: obj, index: num, event): void |
onMouseLeave | Leaving a zone in image | (area: obj, index: num, event): void |
onClick | Click on a zone in image | (area: obj, index: num, event): void |
onImageClick | Click outside of a zone in image | (event): void |
Map is an object describing highlighted areas in the image.
Its structure is similar to the HTML syntax of mapping:
Property | type | Description |
---|---|---|
_id | string | Uniquely identify an area. Index in array is used if this value is not provided. |
shape | string | Either rect , circle or poly |
coords | array of number | Coordinates delimiting the zone according to the specified shape:
|
href | string | Target link for a click in the zone (note that if you provide a onClick prop, href will be prevented) |
src
, lib
and the build process)NOTE: The source code for the component is in src
. A transpiled CommonJS version (generated with Babel) is available in lib
for use with node.js, browserify and webpack. A UMD bundle is also built to dist
, which can be included without the need for any build system.
To build, watch and serve the examples (which will also watch the component source), run npm start
. If you just want to watch changes to src
and rebuild lib
, run npm run watch
(this is useful if you are working with npm link
).
This a component is still a work in progress.
If you encounter a bug of some kind, feel free to report the issue.
If you'd like to improve this code or ask/advise for any improvement, feel free to comment it as well.
Distributed with an MIT License. See LICENSE.txt for more details
Copyright (c) 2017 Coldiary.
FAQs
imageMapper
The npm package react-image-mapper receives a total of 833 weekly downloads. As such, react-image-mapper popularity was classified as not popular.
We found that react-image-mapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.