KaliedaRik / Scrawl-canvas

Responsive, interactive and more accessible HTML5 canvas elements. Scrawl-canvas is a JavaScript library designed to make using the HTML5 canvas element easier, and more fun

Home Page:https://scrawl-v8.rikweb.org.uk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chrome UI fund request

KaliedaRik opened this issue · comments

As described in this repository's README.md[1] file, Scrawl-canvas exists to help make the HTML5 canvas element more responsive, interactive and accessible for end users. I have designed this Javascript library to make developing more responsive, accessible canvas outputs easier for web developers.

As things stand, I have been the sole developer and maintainer of Scrawl-canvas for over 8 years, and I have no plans to stop this work in the known future. My key failure over this time has been my inability to build a community of developers and users to help with this (what I consider to be important) work. As clever as I may think I am, I'm not very good at promoting the library, or the issues that the library is designed to tackle.

The initial aim for this (small) funding request is, initially, to help cover the hosting and development costs for the library's dedicated website[2][3]. That site includes extensive documentation on learning and using the code, as well as a wide range of demonstrations, which makes it an integral part of the product. These uncertain times (and my age) have made me realise that not being able to cover those costs - for whatever reason - would cripple the entire project. Additionally, I have a CodePen[4] Pro account which I use to create the CodePen examples embedded into the 'Learn' sections of the library website.

While this funding request may address the initial aim, it does not address the biggest problem facing the Scrawl-canvas project: the lack of a viable community surrounding it. Without a community, I can't raise awareness of the project among developers, project managers and other key players. And without that awareness, the project will fail to deliver on its keystone purpose: to give end users a better experience of a webpage through the use of properly responsive, interactive and - most importantly -accessible canvas-based graphics and animations. I don't know how to solve this problem - maybe others can advise?

[1] - README.md link: https://github.com/KaliedaRik/Scrawl-canvas/blob/master/README.md
[2] - Library website: https://scrawl-v8.rikweb.org.uk/
[3] - Library website's code on GitHub - https://github.com/KaliedaRik/scrawl-canvas-website
[4] - CodePen link: https://codepen.io/collection/RzzMjw

It's not a bad library. Lacks documentation though. Trying to learn from the demos to understand what properties do what is hard. The weird thing is the "mimics" instead of some matrix based system and groups. I still don't know how to make a pack of objects with a common coordinate system, like having a line drawn relative to a box. You can mimic the start, but not the end of the line and it still requires you to set lockTo, mimic, useMimicStart, addOwnStartToMimic....

It's not a bad library.

Thank you!

Lacks documentation though. Trying to learn from the demos to understand what properties do what is hard.

In addition to the Docs (annotated code) and Demos (which is the testing suite), there's a Learning to use SC section on the website with detailed information on doing things the SC way. There's also a How Do I... section which I want to build into a sort of cookbook on how to do specific things with SC.

The weird thing is the "mimics" instead of some matrix based system and groups. I still don't know how to make a pack of objects with a common coordinate system, like having a line drawn relative to a box. You can mimic the start, but not the end of the line and it still requires you to set lockTo, mimic, useMimicStart, addOwnStartToMimic....

"Mimic" has its uses, but for most positioning-by-reference needs you'll want to use "pivot" and "path" positioning. Lesson 3 covers some of the basics for pivot positioning; Lesson 12 includes a very brief introduction on how to animate text along a path.

SC doesn't use a "traditional" scene graph for layout. See this How Do I article for a broad overview of the approach I've taken.

So how do I exactly draw a horizontal line (top border of the box sans the first 10px) in the example below?
I can see I have to use "offsetX" instead of "startX" in the line definition.
But what is the meaning of endX and endY in this situation, I have no idea. Perhaps I should draw my line in some other way?

What I meant when I said "lacks documentation" I meant a reference. If an object has a property or a function argument it should be documented.

let block = scrawl.makeBlock({
  name: "box",
  startX: 100,
  startY: 100,
  width: 100,
  height: 100,
  fillStyle: "#888899",
  globalAlpha: 0.8,
});

let line = scrawl.makeLine({
  name: 'path-line',
  strokeStyle: 'black',
  method: 'draw',
  offsetX: 10,
  offsetY: 0,
  endX: 100,
  endY: 0,
  handleX: 'left',
  handleY: 'top',
  lockTo: "pivot",
  pivot: "box",
});

What I meant when I said "lacks documentation" I meant a reference.

Fair comment. I don't have a "formal" reference set of docs (such as is produced by JSDoc), but I do comment extensively in the code base, from which the SC documentation is generated. All attributes are defined and explained there - for instance see the Line factory docs page which includes links to the various mixin files where all of the line entity's attributes get detailed.

So how do I exactly draw a horizontal line (top border of the box sans the first 10px) in the example below?

For a static scene, we can do it with two renders:

// First render - establish the entitys
let block = scrawl.makeBlock({
  name: "box",
  startX: 100,
  startY: 100,
  width: 100,
  height: 100,
  fillStyle: "#888899",
  globalAlpha: 0.8,
});

let line = scrawl.makeLine({
  name: 'path-line',
  strokeStyle: 'black',
  method: 'draw',
  endX: 90,
});

scrawl.render();

// Second render
line.set({
  lockTo: "pivot",
  pivot: "box",
  offsetX: 10,
});

// Now when the block moves, the line will move with it
block.set({
  startX: 200,
  startY: 200,
});

scrawl.render();

... Or if you're using an animation loop:

scrawl.makeRender({

    name: "demo",
    target: canvas,

    // this hook will only run once, after the first Display cycle completes
    afterCreated: () => {

        line.set({
          lockTo: "pivot",
          pivot: "box",
          offsetX: 10,
        });
    }
});

Closing this issue as the Chrome UI Fund never responded (not even to say "no")