Coder Social home page Coder Social logo

emilefokkema / infinite-canvas Goto Github PK

View Code? Open in Web Editor NEW
102.0 6.0 7.0 3.61 MB

an infinite version of the html canvas

Home Page: https://infinite-canvas.org

License: MIT License

JavaScript 4.24% TypeScript 95.70% HTML 0.03% CSS 0.01% Dockerfile 0.02%
canvas infinite panning zooming

infinite-canvas's People

Contributors

dependabot[bot] avatar emilefokkema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

infinite-canvas's Issues

Missing types, or types incorrectly exported?

Hello :)

Any tips on how the issue below could be resolved?

pic-004165

Seems perhaps the typings have not been correctly exported, and there's no typing defined at bun add @types/ef-infinite-canvas either :/

Hope you can assist ๐Ÿ™
Thanks for your work on this
๐Ÿคœ๐Ÿค›

Sticky notes transformer

Hi. I'd like to add sticky notes that stick to the correct transformed location when zoomed and panned. Any ideas?

putImageData does not work on some safari version

I'm using putImageData with the infinite canvas and the behavior is fine using most browser.
But on safari version 16.5 using Ventura 13.4, when a call to this function is made,
the console logs the following error and does not display the expected content.

Unhandled Promise Rejection: TypeError: Type error

The problem did not occur in other settings using safari.

I created this minimal project using svelte.
The component using the canvas is at src/routes/TestComponent.svelte.

On most platform, a pixelated heart is shown, using this function

const draw = () => {
    if (context && canvas) {
      context.clearRect(0, 0, canvas.width, canvas.height);

      const res = 21;
      console.log(content.length, res * res * 4);
      let imageData = new ImageData(res, res);
      imageData.data.set(content);

      // behaviour is different if this is used before
      // context.fillRect(0,0, 100,100)

      context.putImageData(
        imageData,
        Math.floor(canvas.width / 2),
        Math.floor(canvas.height / 2)
      );
    }
  };

Is there a problem with the way I use the library ?

I plan to create an example not using svelte, to make sure the problem is not from here.

Access to coordinate / zoom state (Question)

Hello, first of all thank you for your effort.

Is there a way to read the current coordinate state ?
Like the current zoom/scale state, or the local coordinates after panning?

Thank you

Uncaught error calculating inverse: zero determinant

Hello,
I get error:
"Uncaught error calculating inverse: zero determinant"
after running code with this line:
const canvas_src = new InfiniteCanvas(document.createElement("canvas"))

Is it possible to set document.createElement("canvas") as an argument InfiniteCanvas?

Toggle panning

Hi, first, thank you for this awesome work.

Not really an issue, but a question: is there any way to toggle enable/disable the panning?
In some cases, I need the click to perform other actions.

What I have tried so far (didn't work):
infCanvas.addEventListener("mousedown", e => { e.preventDefault(); });

Add a license

Would it be possible to add a LICENSE file to this project?

Question: how can I pan the canvas?

I am looking for a way to programatically move around the canvas, so I can implement moving with arrow keys, etc. Is there a way to do this?

Thank you

Not an issue - just sharing feedback.
Thank you for sharing your work and implementing such a great project.
Really useful.

quadraticCurveTo

quadraticCurveTo is seemingly not working in this implementation.

Dummy question

Hi, before digging into your project, I have got a simple question :
Does it allow the use of images to create an infinite draw like the app Endless Paper (https://endlesspaper.app/)?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.