@sooshisan/hyperglyph-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Hyperglyph-js library

Javascript code for prototyping with hyperglyph outputs.

Usage

import { Keypair } from "@solana/web3.js";
import { buildSvg, generate, toEncodedSvg } from "../";

const renderMode = 'dark';

// optionally: define args to generate hyperglyph; defaults are shown below
const args: HyperglyphArgs = {
    dimensions: {
        height: 64,
        width: 64,
    },
    seedLength: 8,
    generatorClass: 0
};

const data = generate(Keypair.generate().publicKey.toBase58(), args);
const svg = buildSvg(data, renderMode, args);

// optional: encode to a base64 data string
const encodedSvg = toEncodedSvg(svg, 'base64');

Getting started

Run the following:

  • Install pacakges yarn
  • Build the code yarn build
  • Run the code yarn start
  • Check output/ folder

Readme

Keywords

none

Package Sidebar

Install

npm i @sooshisan/hyperglyph-js

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

36 kB

Total Files

59

Last publish

Collaborators

  • sooshisan