1
0
Fork 0
freesewing/packages/plugin-scalebox
2019-04-19 08:58:45 +02:00
..
img tada: Initial commit 2019-04-19 08:22:42 +02:00
src sparkles: Switched to attribute.set() for version info 2019-04-19 08:22:43 +02:00
tests Merge branch 'master' of github.com:freesewing/plugin-scalebox 2019-04-19 08:22:43 +02:00
.babelrc Merge branch 'master' of github.com:freesewing/plugin-scalebox 2019-04-19 08:22:43 +02:00
.editorconfig tada: Initial commit 2019-04-19 08:22:42 +02:00
.gitignore tada: Initial commit 2019-04-19 08:22:42 +02:00
.npmignore tada: Initial commit 2019-04-19 08:22:42 +02:00
.travis.yml Merge branch 'master' of github.com:freesewing/plugin-scalebox 2019-04-19 08:22:43 +02:00
LICENSE tada: Initial commit 2019-04-19 08:22:42 +02:00
package-lock.json bookmark: v0.4.0 2019-04-19 08:22:43 +02:00
package.json chore(release): publish 2019-04-19 08:58:45 +02:00
README.md Merge branch 'master' of github.com:freesewing/plugin-scalebox 2019-04-19 08:22:43 +02:00
rollup.config.js wrench: Updated rollup config 2019-04-19 08:22:43 +02:00

Freesewing logo

 freesewing
a library for made-to-measure sewing patterns

Travis build Version License Code coverage DeepScan grade Chat on Gitter Become a Patron

plugin-scalebox

A freesewing plugin to add a scalebox to your pattern.

Usage

To load this plugin, add it to your instantiated pattern.

On node.js:

import freesewing from 'freesewing'
import scalebox from '@freesewing/plugin-scalebox'

let pattern = new freesewing.Pattern()
  .with(scalebox);

In the browser, this plugin will register as freesewing.plugins.scalebox:

<script type="text/javascript" src="https://unpkg.com/freesewing"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/plugin-scalebox"></script>

<script>
var pattern = new freesewing.Patter()
  .with(freesewing.plugins.scalebox);
</script>

You can now use the scalebox macro as such:

macro('scalebox', {
  at: new Point(0,0),
  lead: 'This is the lead',
  title: 'This is the title',
  text: "And this is the text\nwhich has room for a few lines should you\nfeel so inclined"
});

Configuration

The macro configuration object takes the following properties:

Name Description Default
at A Point object to anchor the scalebox on
lead The lead text freesewing
title The lead text pattern name & version
text The lead text See example below

Example

This plugin provides the scalebox macro that inserts a scalebox like this:

Example of the scalebox inserted by this plugin

These are the default values. The example under Usage above would render like this:

Example of the scalebox inserted by this plugin

Install

To install, run:

npm install @freesewing/plugin-scalebox

Build

To build this plugin, run:

npm run build