Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook: drawings, graphs #22

Open
switham opened this issue Jun 15, 2013 · 0 comments
Open

notebook: drawings, graphs #22

switham opened this issue Jun 15, 2013 · 0 comments

Comments

@switham
Copy link
Owner

switham commented Jun 15, 2013

This is not about drawings that gradually show up as you draw them, or drawings that can be cleared and redrawn, see [https://github.com//issues/23] for that.

Let the user create drawings within the notebook. What sort of API?

  • Processing.py -like (simpler wrapper around openGL), but only static drawings.
  • Pyglet-like (wrapper around openGL)
  • Look at two.js: "Two.js is a two-dimensional drawing api geared towards modern web browsers. It is renderer agnostic enabling the same api to draw in multiple contexts: svg, canvas, and webgl."

Whether "proccessing.py-like or pyglet-like," we're talking about a non-animated, non-interactive API, which means either

  • Emulate a subset of the existing library's API from scratch, or
  • Take the source of the existing library and disable the animated and interactive stuff.

Graphs as a layer over the drawing api

  • Matplotlib-like (some small subset of matplotlib graph styles)
  • use tinyplot.py (already just one style, and a small amount of code)

Implementation method:

  • Server creates a GIF or PNG (perhaps using an existing standard library) and ships it to the browser
  • SVG? Do Android browsers handle that?
  • Server creates JSON instruction lists interpreted by JS in the browser, which draw on an HTML5 canvas... do old Android browsers have canvas?

JS can draw with raw Canvas commands, or WebGL... if Android browsers have WebGL.

Drawing or graph gets stored up until the code block is done or code says "show". Probably allow the code to start another drawing, but not redraw Multiple drawings pile up on the server until the code block is done, then they're all shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant