WPL Get Started Ported To JavaScript

node v0.12.18
version: 6.0.0
endpointsharetweet
This is a JavaScript translation of the first lesson from Wolfram Programming Lab found here: https://lab.open.wolframcloud.com/objects/wpl/GetStarted.nb One of the nice things is that all the APIs we'll use are completely open, so if you want to dig deeper, you can actually drill in and find out how they're implemented (and even fork them!). This will be useful for the more complex examples further down like the image manipulation with filters.
Add 2 and 2.
2+2
A list of numbers from 1 to 10.
require("ramda").range(1, 11)
Draw a circle using the canvas API.
var canvas = new (require("canvas"))(200, 200); var context = canvas.getContext("2d"); context.arc(100, 100, 100, 0, 2 * Math.PI, false); context.fill(); canvas.toBuffer()
Find an image of a horse using Google. If you want to learn about how this API works, just go to https://tonicdev.com/tolmasky/google-image-search
var notebook = require("notebook"); var googleSearch = notebook("tolmasky/google-image-search/3.0.0"); var horseImage = await googleSearch("horse (domestic)");
Apply an oil painting effect. Interested to know how this filter works? Just go to https://tonicdev.com/tolmasky/oil-paint-filter to see how it was implemented.
var oilPaint = notebook("tolmasky/oil-paint-filter/7.0.0"); oilPaint(horseImage);
Want to make your own edits? Clone this document at https://tonicdev.com/tolmasky/wpl-get-started-ported-to-javascript/6.0.0/clone Or, make your own here: https://tonicdev.com/new
Loading…

6 comments

  • posted 6 years ago by jdomingo1102
    Pretty neat!
  • posted 4 years ago by paulinaparangerhr
    Jpg... pgf...
  • posted 3 years ago by adamsey
    Great!!!!
  • posted 2 years ago by vvccccxhg
    FFr
  • posted 2 years ago by mikypearl
    Well
  • posted a year ago by 7491016869
    https://youtube.com/@YouTubebenja?si=PkRvs6n2tuuSStG4

sign in to comment