npm.io
2.1.0 • Published 7 years ago

@benmaclaurin/hanzigrid

Licence
—
Version
2.1.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0

Hanzi Grid

JS module for creating hanzi grids/tables

This is a simple module (my first) which generates SVG-based hanzi grids/tables for Chinese language learners. You can use Browserify to require this module on the web.

Install

npm install @benmaclaurin/hanzigrid

Usage

const grid = require('@benmaclaurin/hanzigrid');

document.getElementById('grid').innerHTML = grid.generate(14, 10, options = {
  dashes: 20,
  opacity: 0.1,
  lines: 4
});

Generates a new grid with 14 rows and 10 columns. Options:

  • dashes - dash density of guidelines
  • opacity - opacity of guidelines
  • lines - number of guidelines (2 or 4)

More options/features to come.