Comments (2)
Could you provide a link to the example of react canvas you found? Was it this one?. I found some interesting information about the subject here. There is a react-canvas out there which is not really an HTML 5 canvas, so might be misleading.
Can you help me with a basic understanding of why react is incompatible with HTML5 canvas? I notice in your TurtleCanvas.js, you use the following to obtain the context:
var context = ReactDOM.findDOMNode(this).getContext('2d');
Is your concern about getting access to the context? While looking into how to do this I came across this post, which offers a couple of different ways to obtain canvas context access.
It seems to me that react + canvas should function fine, but maybe you feel it's not the correct approach for some reason. The turtle_port branch contains turtle.js ported to be a react component, and this can be adapted to output either gcode or raw vertices.
from sandify.
Sorry, this issue is out of date. I think it should probably be closed.
The example I found was this: http://jsfiddle.net/JMZc5/1/ but it didn't work until I did the ReactDOM.findDOMNode call.
I'm currently happy enough with the drawing that we have in MachinePreview.js. If using 'react-canvas' is more right/better/more flexible, then I'm fine with that too.
I'll open another issue where we can integrate turtle.
from sandify.
Related Issues (20)
- Feature request: Max radius presets HOT 1
- Add Comment Line Between Tracks on Export
- Add new "code" layer HOT 1
- Local install OSX HOT 6
- gcode import broken HOT 1
- Starting GCode getting reformatted HOT 5
- Draw Portion being converted to int HOT 2
- Export Adds Points HOT 3
- Our sortable dependency is being deprecated HOT 1
- help with sandsara Table HOT 9
- G-code target exceeds machine limits error in octoprint. HOT 1
- Feature request: Save and Open local files HOT 3
- Wrong / wierd pattern HOT 1
- Fine tuning: decimal numbers instead of just whole numbers HOT 1
- Dockerfile and docker-compose broken? HOT 1
- Preview render missing when width is 992px HOT 4
- "npm start" failing with "JSX syntax extension is not currently enabled" HOT 4
- Request: mask with path
- crash/infinite loop with effects HOT 1
- rho in thr format is limited to 0.5 with rectangle table
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 sandify.