GithubHelp home page GithubHelp logo

Get Drawing Working about sandify HOT 2 CLOSED

jeffeb3 avatar jeffeb3 commented on August 20, 2024
Get Drawing Working

from sandify.

Comments (2)

jamesd256 avatar jamesd256 commented on August 20, 2024

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.

jeffeb3 avatar jeffeb3 commented on August 20, 2024

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)

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.