Giter Site home page Giter Site logo

iodide-project / iodide Goto Github PK

View Code? Open in Web Editor NEW
1.5K 1.5K 141.0 34.78 MB

Literate scientific computing and communication for the web

License: Mozilla Public License 2.0

JavaScript 79.68% CSS 2.23% HTML 0.62% Makefile 0.08% Shell 0.29% Python 16.89% Dockerfile 0.21%

iodide's People

Contributors

algentile avatar bcolloran avatar cglotr avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar djbarnwal avatar fkohlgrueber avatar hamilton avatar iflameing avatar imranariffin avatar imshubhamsingh avatar jandrewtorres avatar jezdez avatar mdboom avatar mehmetoguzderin avatar openjck avatar pradeepgangwar avatar ralts1337 avatar renovate-bot avatar renovate[bot] avatar robhudson avatar robotblake avatar rvwatch avatar samrose-ahmed avatar teonbrooks avatar thenamankumar avatar wlach avatar ziyaowei avatar zzl0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iodide's Issues

implement a simple DOM cell type for svg, canvas, webgl, etc

We need a DOMCell, which allows you to simply have a cell displayed as an active DOM element. It needs the following options:

  • id, which allows for css selection.
  • element type, such as div, svg, canvas, etc
  • some way of saving the last render state of the enclosed dom element, which will make translating to a static report easier in many cases.

create the right primitives for dom manipulation within the computation engine

The aim of a serverless notebook is to create a client-based computational "kernel" that can live in the browser. This removes the need for a server to do the heavy lifting. Removing the server opens the door for a truly portable (thus reproducible) scientific computing environment.

There are many challenges with this approach, but from a low-level / technical point of view, one very important challenge will be how to manipulate the dom from the kernel layer.

delete declared variables when loading a notebook from local storage

Our demo version (for now) keeps everything saved / stored in the current thread. So when we switch notebooks, we still have the global namespace of whatever has been run so far.

Really, this is a deeper question about WHERE notebooks live, WHAT a notebook represents, and HOW we manage state.

For a demo, this won't be an issue. But we will need to eventually come to some major decisions.

save execution history to state

We want to maintain a running list of chunks of code that are executed. Cell execution and external script additions should be appended to this list.

implement a forward / backward state button

Given that we're using redux, and have the entire state saved, we can very easily move back and forth between states - that is, we can implement forward / backward state buttons.

add a declared variables view

At the moment we're just putting the js-interpreter properties out there but it's not particularly usable or useful. This needs to be wrapped in some functional language to pull out before it even hits that component.

function declaration doesn't really work

hmmm, this is a big problem.

with the following cells:
%% function add(a,b){return a+b) return add(1,2) %% add(3,4) %%

from the first cell, you correctly get 3; but from the second cell, there is no output, and the console reports "ReferenceError: add is not defined".

So crapola, the scoping issues involved in executing code with Function are getting us. Gonna play with a branch using vanilla eval, which may operate differently wrt scope-- https://stackoverflow.com/questions/4599857/are-eval-and-new-function-the-same-thing

recall saved notebooks

For the demo notebooks will be saved in local storage. Build some functionality to recall them. Relies on #3

remove state from the title bar

Allowing there to be some small state-saving in the title component actually makes it harder to update the title from the main redux state object.

make cells selectable

A cell is selected if it is clicked, or currently being edited. This allows us to supply keybindings for running a cell, moving a cell, adding / deleting, and inserting a cell before or after the selected.

This should be as easy as providing an action called SELECT_CELL which takes the cellID.

cell styling, wrapping, click zones

for parity with jupyter, we should wrap both the input and output from each cell in a div that is clickable without entering edit mode (in jupyter you can click to the left of the edit box to select a cell while in command mode). a click target like this is useful for editing/deleting/adding/moving cells.

external script loader cell type

As discussed, we want a cell type for loading external scripts. In terms of UI, the proposal at this point is to have an input in which you can list URLs for external scripts to be loaded, and upon execution of the cell, the scripts will be added to the document head. This should also update the execution history list (see #46)

implement localStorage solution to maintain state between sessions

Given that this app uses react + redux, and the stored state of the app is fundamentally just a big json object, we can save this in local storage so that this early-stage app can persist for a particular user.

As a starting point, let's simply make a big 'save' button to save the state to local storage. I attempted to save the state to local storage with each state change (which happens with every cell edit right now) and that made the app a little fussy.

We can use #16 to capture the name of the notebook, which can be saved w/ a simple, serialized key-value pair.

[meta] redesign cell display to remove clutter

I put together an mvp cell design to simply get all the underlying logic in-place. Ultimately getting the actual result displays looking closer to a well-formulated document (like RMarkdown) is the goal. Will update this list w/ more points as I tweak / commit.

  • move buttons to right of cell
  • tweak the CodeMirror instances for cleanup
  • keep buttons invisible until cell hover

create a solution for changing cell type

This includes the requisite action, reducer, and UI element. The first two will be reusable across the app in other ways, while the UI piece will likely change.

dealing with scope: global / window, var, etc.

as of this filing, we have no great way to make sure the scope feels consistent. Using var in a cell block, for instance, will not perpetuate across cells, because the declaration will be made within the scope of the Function call. So var b = 10 will not make b available to all cells, whereas b=10 will. This seems like merely a nuisance, but this issue will track all discussion re: how we want to approach scope in case others have strong opinions.

remove js-interpreter and replace with Function, for sake of demo expediency

Eventually we want to address the compute kernel issue, but for the sake of expediency (and easy DOM manipulation #13) we're going to keep everything tractable so we can begin showing others a demo version. This requires removing js-interpreter (already considered a stopgap) with Function, which gives us the app's scope.

[meta] mvp keybindings, pt. 1

We need to implement jupyter-style keybindings for:

  • entering / exiting command mode (lifted directly from jupyter)
  • selecting the next / previous cell
  • moving a selected cell up and down
  • adding / inserting a cell
  • deleting a cell
  • running a cell
  • switching between cell types

Given that these are Page-specific, we can implement the keybindings in that component.

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.