Skip to content

Infinite canvas that allows drawing with pen and pinch zoom. It should feel more ore less like OneNote drawing.

License

Notifications You must be signed in to change notification settings

thfrei/infinite-drawing-canvas

Repository files navigation

infinite-drawing-canvas

Infinite canvas that allows drawing with pen and pinch zoom. It should feel more or less like drawing in an app like OneNote, Krita or other, pen-enabled apps.

Important: development for infinite-drawing-canvas stalled. You might want to consider using the open-source library: https://github.com/excalidraw/excalidraw

Demo:

https://thfrei.github.io/infinite-drawing-canvas/

Video:

demo

Try / Contribute:

Gitpod ready-to-code

Features:

  • Resizable Canvas
  • Infinite Canvas*
  • Pan Canvas to all sides
  • Pan with Touch (Hammer.js) or ALT+Moues
  • Pinch zoom (Hammer.js)
  • Draw with Mouse / Touch / Pen
  • Add Text
  • Erase custom path (known issue: Resolution suffers... :-/)
  • Erase whole object (existing path)

* Actually one can define how big it is. In the demo it is 1500x1500px, way bigger than the visible area. Resultion of paths drawn depend on the scaling factor..., so infinite in fact is an overstatement.

Roadmap

  • see CHANGELOG.md

Development

Release new version

npm version patch
git push --follow-tags

Github Actions

  • ./.github/workflows/gh-pages.yml: Create github pages in branch.

Known Issues

Fabric adaptions

  • Custom build via: http://fabricjs.com/build/,
    • with all options except: Gestures, Named accessors (from default, this is plus Erasing)
    • From built file remove: no options ticked (mainly window.fabric is unchecked)
  • Change js-file:
    • Remove in code where jsdom is required, which would allow to run fabric under node.js context. The jsdom dependency causes issues with webpack 5, since webpack 5 has no longer a polyfill for node.js stuff:
      BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
      This is no longer the case. Verify if you need this module and configure a polyfill for it.
      
      If you want to include a polyfill, you need to:
            - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
            - install 'path-browserify'
      If you don't want to include a polyfill, you can use an empty module like this:
            resolve.fallback: { "path": false }
      

Credits

  • Fabric.js - Great canvas library

Prior Art

About

Infinite canvas that allows drawing with pen and pinch zoom. It should feel more ore less like OneNote drawing.

Resources

License

Stars

Watchers

Forks