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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@marciniak/map

v0.9.4

Published

component outlining areas defined in map

Downloads

18

Readme

highlight-map

highlight-map is an Angular component outlining and highlighting areas defined in map. It allows you to define different types of brushes that can be assigned to individual areas.

The main idea is based on https://github.com/kemayo/maphilight. However, it provides different configuration options and some additional functionalities. This library only supports poly shaped areas.

Demo

Demo project: https://github.com/Mariusz-Marciniak/highlight-map Deployed demo: https://highlight-map.herokuapp.com/

Features

  • customizable highlight for areas - define highlight-brush component with specific brushClass this brush will be used for all highlight-areas having the same brushClass
  • on hover brushes - define brush used on mouseover events by adding :hover to brushClass
  • default brushes - brush with empty, undefined or set to default-brush brushClass is used as default; this brush will be used for all highlight-areas without defined matching brush; similarly brush with brushClass set to :hover or default-brush:hover will be used as default for on mouseover events
  • inactive areas - it is possible to mark area as inactive="true"; such a area is disabled and does not react to on mouseover events

Usage

<highlight-map src="/assets/angular.png" name="angular-img">
  <highlight-brush brushClass="fooBrush" fillStyle="blue"></highlight-brush>
  <highlight-brush brushClass="fooBrush:hover" strokeStyle="red" fillStyle="orange"></highlight-brush>
  <highlight-brush brushClass="" fillStyle="yellow"></highlight-brush>
  <highlight-area brushClass="fooBrush" inactive="true" coords="34,153, 58,153, 56,104"></highlight-area>
  <highlight-area coords="93,20, 56,104, 77,104"></highlight-area>
  <highlight-area brushClass="fooBrush" inactive="true" coords="131,104, 93,20, 93,70"></highlight-area>
</highlight-map>

Brush properties

| Property | Type | | ------ | ------ | | lineWidth | number | | lineCap | CanvasLineCap | | lineJoin | CanvasLineJoin | | strokeStyle | string | CanvasGradient | CanvasPattern | | lineDash | string | number[] | | fillStyle | string | CanvasGradient | CanvasPattern |

Install library

Run npm install @marciniak/map

Changelog

  • 0.9.3 updated Angular version to 13; tested on Microsoft Edge
  • 0.9.2 default brush class named as default-brush
  • 0.9.1 layout bug fixes:
    • overwritten text-align property of parent component
    • synchronize parent div size with image size
  • 0.9.0 initial version

Tested with

  • Firefox
  • Chrome
  • Microsoft Edge