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

cljs-canvas-backgrounds

v1.1.0

Published

Geometric repeating patterns for the HTML5 Canvas

Downloads

3

Readme

cljs-canvas-backgrounds

Geometric repeating patterns for the HTML5 Canvas, written in ClojureScript.

They use Fabric.js but are otherwise framework agnostic, so can be easily included in any JavaScript project.

Usage

npm install cljs-canvas-backgrounds --save

Load the script at resources/public/js/compiled/cljs_canvas_backgrounds.js in your project.

This will give you a global cljs_canvas_backgrounds object, with the backgrounds as properties. Each has a draw function which you need to call, passing an options object, containing at least the id of your canvas element.

So, to initialize the checkerboard background:

cljs_canvas_backgrounds.checkerboard.draw({ id: "my-canvas-id" });

Replace the name to use a different background.

Other options

|Background |colors |size |spacing |width |height | |-----------|---------|-------|----------|--------|---------| |checkerboard |Array of strings, max. 2 |Number (size of squares) |||| |polkadot |Array of strings, max. 2 |Number (size of dots) |Number (space between dots) ||| |mosaic |Array of strings, no max. |||Number (width of triangles) |Number (height of triangles) |

Running locally

Make sure you have Leiningen installed.

To get an interactive development environment, run:

lein figwheel

and open your browser at localhost:3449. This will auto compile and send all changes to the browser without the need to reload. After the compilation process is complete, you will get a Browser Connected REPL. An easy way to try it is:

(js/alert "Am I connected?")

and you should see an alert in the browser window.

To clean all compiled files:

lein clean

To create a production build run:

lein do clean, cljsbuild once min

And open your browser in resources/public/index.html. You will not get live reloading, nor a REPL.