Comments (1)
Good question. My first guess would be to create a <canvas>
in React, and then simply reference it in Pt.
React:
render() {
return(<canvas id="hello"></canvas>)
}
Then to instantiate Pt by referencing the id:
new CanvasSpace("#hello").setup(...);
Use the latest v0.2 version. This won't work in Pt v0.1 because of a constructor bug.
Probably you'll need to clean up the Pt instance in React's componentWillUnmount()
(or something like that), so that it won't try to draw to an element that no longer exists.
Hope this will work. If not, we'll fix it. 💪 Cheers!
from pt.
Related Issues (20)
- Color's alpha property cannot be set by array HOT 2
- Add shaping functions HOT 1
- Clearer documentation and API for initializing CanvasSpace HOT 1
- CanvasSpace does not set its size HOT 1
- grid.canFit doesn't work on empty grid HOT 3
- Documentation url HOT 1
- Easing functions missing in docs HOT 2
- Make all demos accessible in mobile HOT 1
- Make it possible to pass DOM-object to CanvasSpace instead of id HOT 4
- Create a CanvasSpace with transparent color HOT 5
- Some classes cannot be imported in ES6 HOT 1
- npm scripts for development HOT 1
- on window resize HOT 1
- trigger methods from other dom elements HOT 3
- Do you have any guide for angular 5 ? HOT 2
- No Grid methods in 2017 version ?
- CanvasSpace bgcolor HOT 1
- Add license to dist files HOT 1
- Broken links to demos from documentation page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pt.