1.0.2 • Published 10 years ago

dotpic v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

dotpic

Build Status Code Climate Code Coverage npm Version JS Standard

Doc picture generator

Installation

$ npm install dotpic --save

Usage

'use strict'

const dotpic = require('dotpic')
const fs = require('fs')

// Write dot picture
let src = `
000011110000
000001100000
000001100000
000001100000
100001100001
111111111111
111111111111
100001100001
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000001100000
000011110000
`

let svg = dotpic(src, {
  colors: {
    '0': '#444',
    '1': '#FFF'
  }
})

fs.writeFile('my-svg.svg', svg)

Signature

dotpic(src, options) -> string

Params

NameTypeDescription
srcstringimage data
optionsObjectOptional settings
options.colorsObjectColor data
options.widthnumberImage width
options.heightnumberImage height
options.backgroundstringBackground color

License

This software is released under the MIT License.

Links

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago