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

@marthvon/mazehub

v0.0.4

Published

MazeMap API + React.js

Downloads

19

Readme

Mazehub Component Library

Author: marthvon <[email protected]>

Modern React Integration of Mazemap Package

Package of Frontend Components using React > 18.

Installation Guide

npm install tailwindcss postcss postcss-import autoprefixer --save-dev
npm install @marthvon/mazehub

Configuration Setup

Setup Tailwind

tailwind.config.js

const config = {
  content: [
    // ...
    "./node_modules/@marthvon/mazehub/dist/**/*.{js,ts,jsx,tsx,mdx,css}"
  ] // ...

Or, ensure compiled tailwind codegen css file includes classes:

w-full h-full z-10 overflow-visible

How To Use?

Example

<Suspense fallback={<>Loading Mazemap...</>}> {/* <- Wrap Mazehub components inside Suspense Component */}
   <MazeMapApi> {/* provides MazemapApi to childe elements through useMapApi() context */}
      <MarkerProvider markers={markers}> {/* Optional */}
         <GpsNavigation zLevel={1} accuracy={25}> {/* Optional  */}
            <MazeMapConsumer campuses={296} center={{ lng: 115.895, lat: -32.006 }} highlighter={{
               showOutline:true, showFill:true,
               outlineColor:"MazeBlue", fillColor:"MazeBlue"
            }} />
         </GpsNavigation>
      </MarkerProvider>
   </MazeMapApi>
</Suspense>

Core Structure

<Suspense fallback={<>Loading Mazemap...</>}> {/* <- Wrap Mazehub components inside Suspense Component */}
   <MazeMapApi> {/* provides MazemapApi to childe elements through useMapApi() context */}
      {/* Add other modules and construct map with only features you need */}
      <MazeMapConsumer campuses={296} center={{ lng: 115.895, lat: -32.006 }} highlighter={{
         showOutline:true, showFill:true,
         outlineColor:"MazeBlue", fillColor:"MazeBlue"
      }} />
      {/* Add other modules and construct map with only features you need */}
   </MazeMapApi>
</Suspense>

Map Modules

  1. <MarkerProvider ... /> Module
  2. <ClusterMarkerProvider ... /> Module
  3. <GpsNavigation ... /> Module

How to Write You're own Map Module

import { useEffect, useRef } from "react";
import type { MutableRefObject, ReactNode, RefObject } from "react";
import { MapRefAPI, useMapAPI } from "./mazemap_api";

const MapModule({ children }: { children?: ReactNode }) {
  // static methods inside Mazemap Package
  const { colorPresets } = useMazemapPackage(); // example static method colorPresets
  
  // returns MapApi for MapInstance inside <MazeMapApi> ... <MazeMapConsumer /> ... </MazeMapApi>
  const { mapRef } = useMapAPI();  

Mazemap Static Methods

fetchPoiData: (lngLat: LngLatType, zLevel: number) => Promise<PoiData>;
fetchPoiDataFromId: (poiId: number) => Promise<PoiData>;
fetchPoiDataFromBldg: (bldgId: number) => Promise<PoiData>;
fetchRouteJson: (start: LocationType, dest: LocationType) => Promise<RouteJsonObject>;
colorPresets: (color: MazemapColor | string | undefined) => string|"#.*";
setToken: (token: string) => void;

Mazemap Instance Api Methods

/* Getters */
getMazeMap: () => typeof window.Mazemap.Map;
isLoaded: () => Set<string> | null;
/* Map API Methods */
addMarker: (
  zLevel: number, lngLat: LngLatType,
  props?: MarkerBaseType | MarkerGlyphType | MarkerImgType, 
) => typeof window.Mazemap.MazeMarker;
addZlevelMarker: (
  zLevel: number, lngLat: LngLatType, 
  el: HTMLElement, props?: ZLevelMarkerType
) => typeof window.Mazemap.ZLevelMarker;
displayRoute: (
  poi : { start: LocationType, dest: LocationType } | RouteJsonObject, 
  padding?: number, config?:RouterConfig
) => RouteJsonObject|Promise<RouteJsonObject>;
clearRoute: () => void;
displayBlueDot: (
  latLng: LngLatType, zLevel: number, accuracy: number, 
  props?: { bearing?: { value: number, accuracy: number }, color?: string}
) => BlueDot|Promise<BlueDot>;
highlightPoi: (poi: PoiData | LocationType, config?: Partial<HighlighterConfig>) => PoiData | Promise<PoiData>;
clearHighlight: () => void|Promise<void>;

Types

type LngLatType = {
  lng: number; 
  lat: number;
}

type MazemapColor = "MazeBlue" | "MazePink" | "MazeOrange" | "MazeRed" | "MazeGreen" | "MazePurple";
type MarkerColor = MazemapColor;

type HighlighterConfig = { 
  showOutline:boolean, showFill:boolean,
  outlineColor?:MazemapColor, fillColor?:MazemapColor
}

type RouterConfig = {
  showDirectionArrows?:boolean, 
  routeLineColorPrimary?:string, 
  routeLineColorSecondary?:string
}

// check global.d.ts for the rest of the types

Future Updates

  1. Dungeon Controlling Modules (WASD & Virtual Joystick for Mobile)