Coder Social home page Coder Social logo

Comments (5)

lavrton avatar lavrton commented on July 28, 2024

Use. You can use "ref" and "refs" to get access to Konva.Node instance. And then you need to find the right moment for shape caching and it really depend your specific case.
Demo: http://jsbin.com/qofiwo/4/edit?js,output

from react-konva.

malygin avatar malygin commented on July 28, 2024

thank you!

from react-konva.

Zabedovskiy avatar Zabedovskiy commented on July 28, 2024

Hi! Very strange cache, @lavrton. When I changed count of texts to 1000, I saw 15 fps at Stats. Although I checked use cache, I saw the same 15 fps at Stats. Are you sure that cache work fine in react-konva realization? It's really important question for me, because I have large map 482250x120250 and I have about 4000 objects on map, when I try dragging or scale it I have about 10-20 fps. It's realy few. In the future at this map will be about 30000 object and I scared about performance that I will have. Can you recomend best way for it, or may be i must change 'react-konva' to simple konva library, because on this example with cache all works fine with count 20000k of objects

https://jsfiddle.net/513c8s5d/2/

from react-konva.

hsluoyz avatar hsluoyz commented on July 28, 2024

@lavrton can you make a demo about cache usage on react-konva? I still don't get how to do it?

from react-konva.

lavrton avatar lavrton commented on July 28, 2024

@hsluoyz use ref (https://reactjs.org/docs/refs-and-the-dom.html) to get access to Konva node. Then call node.cache().

from react-konva.

Related Issues (20)

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.