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

gomjau-hogg

v0.0.17

Published

Gomjau-hogg notation tessellations of regular polygons

Downloads

1,350

Readme

This is a FORK of the original Antwerp.

The original Antwerp can be found on Github.

The major differences are:

  • the original Antwerp has a better demo
  • runs optimally in O(n); original runs in O(n^3) (where n is the number of tiles)
  • 🔥blazingly fast🔥 - under a micro-second per tiled shape

Demo

Installation

npm install gomjau-hogg

Usage

import { toShapes } from 'gomjau-hogg';

// Any tesselation in GomJau-Hogg notation
const configuration = '6-4-3,3/m30/r(h1)';

// transformation repetition count ~ c*sqrt of number of shapes tiled,
// e.g. `15` results in `1099` tiles for the above configuration
const repeatCount = 15;

// size of sidelength of shapes
const shapeSize = 25;  

const data = toShapes(configuration, repeatCount, shapeSize);

// `data` will be:
{
    maxStage: 9,
    maxStagePlacement: 4,
    shapes: [
        {
          "sides": 6,  // number of sides of shape -> hexagon in this case
          "stage": 0,  // transformation stage -> 0 means seed placement
          "stagePlacement": 1,  // stage within each transformation - can be used for coloring
          "θm": -6,    // the rotation angle of the shape in 𝜋/12 increments
          "c": [0,0]   // shape centroid
        },
        { "sides": 4, "stage": 0, "stagePlacement": 2, "θm": 16, "c": [ 13.660254037844375, 23.660254037844393 ] },
        ...
    ],
    transformPointsMaps: [Map(...)]  // map of transform points
}

To get the actual vertices of a shape just call:

const { c, θm, sides } = shape;
fromCentroidAndAngle(c, θm, sides, shapeSize);  //=> array of points, i.e. `points: number[][]`

Demo Notes

The demo has been hacked from the original and for the purpose of testing the library so lots of functionality has been removed mostly because I struggled (and didn't have the time) getting things (mostly the newest version of React Router and preshape) working but it's relatively easy to fix all the shortcomings.

Most notably:

  • no web workers
  • repeatCount replaces maxRepeat in the web address search params
  • cannot directly edit notation - must use the library
  • options can only be set in the addess bar, an example being
    • https://florissteenkamp.github.io/gomjau-hogg/?configuration=6-4-3%2C3%2Fm30%2Fr(h1)&repeatCount=20&shapeSize=20
  • several minor omissions, e.g. only one way of coloring, doesn't display transforms, etc.