1.1.0 • Published 4 years ago

@fuzzco/full-canvas v1.1.0

Weekly downloads
5
License
MIT
Repository
-
Last release
4 years ago

Auto-resizing canvas. Demo

npm i @fuzzco/full-canvas

Register component in Vue, then:

<template>
    <main>
        <!-- canvas that resizes to fit its container (positions: absolute, top/right/bottom/left: 0) -->
        <full-canvas />

        <!-- lower rect-throttle value for smoother resizing, at the cost of more expensive calculations -->
        <full-canvas rect-throttle="20" />
    </main>
</template>

Options

PropTypeDefaultNotes
rect-throttleString, Number150How often the canvas resizes itself, in ms

Events

EventParamsNotes
canvas-ready(canvas)Fires after all initialization has completed and canvas is ready. Looking for the canvas before this point doesn't guarantee that the canvas will exist.