WPL Get Started Ported To JavaScript

node v0.12.18
version: 1.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.
Add 2 and 2.
2+2
A list of numbers from 1 to 10.
require("ramda").range(1, 10)
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/3.0.0
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);
Loading…

6 comments

  • posted 5 years ago by jdomingo1102
    Pretty neat!
  • posted 3 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 5 months ago by 7491016869
    https://youtube.com/@YouTubebenja?si=PkRvs6n2tuuSStG4

sign in to comment