2D drawing for Jupyter?

I teach introductory computer science lessons, and I like to do this using 2D graphics. I used the excellent John Zell library graphics.py , but I want to move on to using Jupyter with my students, so I need a new graphics solution. This should be available to students as early as 8th grade without programming experience.

All I need is the basic functionality of a rectangle / ellipse / arc / polyangular / line with the ability to control the stroke and fill colors. Plus image import. But I want the API to be as simple as possible.

  1. matplotlib is an obvious choice, but the syntax is a bit confusing and needs to be used to build graphs, so some extra steps need to be taken to clear it.
  2. toyplot is a simplified and prettier matplotlib, but as far as I can tell, it does not include the main figures, it is intended only for building charts / building charts
  3. The vincent API is as clean as I could ask for (although in any case I will ask for more ... see below), but it does not support arbitrary forms, only graphing / graphing
  4. SVG can do whatever I want, but the syntax is too complicated for beginners
  5. The same for d3 through JavaScript magic

Although I would be pleased if Vincent had basic forms, after some work with graphics.py, I would prefer something that doesn't use objects. The Processing3 API is probably ideal, because (for example) you call the rectangle () function, which uses the current stroke and fill options, rather than creating a Rectangle object, setting its properties and then telling it to draw itself. (Yes, I personally prefer the latter, but I think this just adds to the confusion for beginners.)

So ... what options am I missing?

+5
source share

Source: https://habr.com/ru/post/1662596/


All Articles