Scrawl-canvas v8.6.2 #16
Closed
KaliedaRik
announced in
Releases
Replies: 1 comment
-
New additions for v8.6.22 new filters: glitch; spiral. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Scrawl-canvas Library
Version:
8.6.2 - 21 Sept 2021
.Scrawl-canvas website: scrawl-v8.rikweb.org.uk.
Do you want to contribute? I've been developing this project for too long by myself, and would really welcome contributions from - even collaboration with - people who can bring a different perspective and a fresh set of eyes to the work.
What?
Scrawl-canvas is a JavaScript library for working with the HTML5 <canvas> element. The library:
Why?
There are a number of other Javascript libraries available, each with their strengths and weaknesses. Some have been designed to make the production of charts and other data visualisations easier. Some focus on game development, others on making videos interactive. Libraries which attempt to emulate Flash/Actionscript animations have been developed, as have libraries whose aim is to combine 2D, 3D and even SVG graphics into a usable whole. Speed is a key goal for some of the best libraries, while ease-of-use is an objective for many others.
Working with the native Canvas API is hard work - particularly when the desired result is more complex than a couple of coloured boxes in a static display.
But the benefits of using canvases for graphical displays and animations are also great: canvases are part of the DOM (unlike Flash); they are natively wired for events and user interactions; they use immediate mode redering (which makes them very quick); and the canvas-related APIs are designed to be used with Javascript.
Yet these advantages are also significant barriers:
Scrawl-canvas overcomes these barriers
Yes, Scrawl-canvas aims to be fast, and developer-friendly. It also aims to be broadly focussed, suitable for building infographics, games, interactive videos - whatever we can imagine for a 2D graphical presentation.
But the main purpose of Scrawl-canvas is to make the <canvas> element, and the parts that make up its displays and animations, responsive, interactive, linkable, trackable. And accessible!
Installation and use
There are three main ways to include Scrawl-canvas in your project:
Download, unpack, use
Alternatively, a zip package of the v8.6.2 files can be downloaded from this link: scrawl.rikweb.org.uk/downloads/scrawl-canvas_8-6-2.zip - this package only includes the minified files.
CDN - unpkg.com
This will pull the requested npm package directly into your web page:
NPM/Yarn
This approach is still experimental: Scrawl-canvas has been designed for use in the browser, not server-side. Add the library to a React/Vue/Svelte/etc project at your own risk - your mileage may vary!
Local development and testing
After downloading the library and unzipping it into a directory or folder, cd into that folder on the command line, run
yarn install
ornpm install
(for the toolchain - the library itself has no external dependencies) and start a local server. For instance if you havehttp-server
installed:Navigate to http://localhost:8080 to access the documentation and demo tests.
Testing
The code base does not include any unit testing frameworks. Instead, we rely on a set of Demo tests which allow us to perform integration testing and user interface testing.
Why this approach? Because most of the Scrawl-canvas functionality revolves around various forms of animation, which requires visual inspection of the Demo tests to check that the canvas display - and thus, by inference, the underlying code - performs as expected.
Most Demos include some form of user interaction, which allows us to test specific aspects of the code base.
Documentation
The source code has been extensively commented. We generate documentation from that code using Docco. Documentation is regenerated each time the library is rebuilt.
Minification
We minify the source code using rollup and its terser plugin.
Building the library
Running the following command on the command line will recreate the minified file, and regenerate the documentation:
$> yarn build
Development team
Developed by Rik Roots: rik.roots@rikworks.co.uk
This discussion was created from the release Scrawl-canvas v8.6.2.
Beta Was this translation helpful? Give feedback.
All reactions