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

sympler-map

v1.0.8

Published

A multipurpose Map component for usage by Sympler

Readme

Installation

yard add sympler-map

Note: You must also have the following package installed in your project as a dependency.

  • react-map-gl

Getting Started

import React, { useState, useRef } from "react";
import SymplerMap from "sympler-map";
import { ViewportProps, PointerEvent } from "react-map-gl";

// Create the type of response that will be used throughout the map
interface Response {
  lat: number;
  long: number;
  emotion_scores: {
    disgust: number;
    sadness: number;
    anger: number;
    joy: number;
    surprise: number;
    fear: number;
  };
  primary_emotion:
    | "anger"
    | "sadness"
    | "fear"
    | "joy"
    | "surprise"
    | "disgust";
}

// Create the response from the map
interface Results {
  results: Response[];
  event: PointerEvent;
}

const users: Response[] = [
  ...
];

function App() {
  const [responses] = useState(users);
  const [viewport, updateViewport] = useState({
    longitude: -43.9,
    latitude: 41.3,
    zoom: 2
  });

  const mapRef = useRef(null);

  function handleMapClick(results: Results) {
    console.log({ results });
  }

  function handleMapMove(viewport: ViewportProps) {
    updateViewport(viewport);
  }

  return (
    <div style={{ width: "100vw", height: "100vh", position: "relative" }}>
      <SymplerMap<Response>
        mapRef={mapRef}
        viewport={viewport as ViewportProps}
        responses={responses}
        onMapClick={handleMapClick}
        onMapMove={handleMapMove}
        mapboxToken={// provided by Mapbox}
      />
    </div>
  );
}

export default App;

API

| Prop | | Type | Description | | :--------------: | -------- | :------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | mapRef | required | React.RefObject<MapGL> | This is an ref that you create and will be forwarded to the Map itself, allowing you access to internal APIs. | | viewport | required | ViewportProps | This is the state of the viewport. Initially you can pass it an object like { long: number, lat: number, zoom: number } and when the map first loads it will be centered on this location. | | responses | required | UserResponse[] | The individual responses to render onto the map. Each response must include the following keys { lat: number, long: number, emotion_scores: EmotionScores, primary_emotion: EmotionType }. More info on this here: link. | | emotions | | EmotionType[] | This is an array of all emotions (ie: ["joy", "anger"...]) that you'd render to the map. | | filteredEmotions | | EmotionType[] | This is an array of all emotions that you would like to filter on. Pass an empty array ([]) to not filter on any emotions and display all. | | onMapClick | required | (responses: UserResponses[]) => void | This function is called every time the map is clicked. If there are responses, they are made available in this callback. | | onMapMove | required | (viewport: ViewportProps) => void | This function is called every time the map is moved. The latest viewport data is made available in this callback, in which your local viewport state should be updated with these values. | | onMapChange | | (state: ExtraState) => void | | | onMapLoad | | () => void | | | mapboxToken | required | string | The access token provided by Mapbox. | | children | | | Any JSX you'd like to render inside of the map. |

Errors

TypeError: Cannot read property 'heatmap' of undefined

It's likely you are supplying the map with emotions it does not support. Current we only handle anger (red), surprise (orange), joy (yellow), disgust (green), sadness (blue), fear (purple). Make sure you are only passing in a value from this list.