Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fonsp/pluto.jl

🎈 Simple reactive notebooks for Julia
https://github.com/fonsp/pluto.jl

designed-for-teachers education exploration interactive julia notebook pluto-notebooks reactive visualization

Last synced: 1 day ago
JSON representation

🎈 Simple reactive notebooks for Julia

Awesome Lists containing this project

README

        

🎈 Pluto – introduction (20 min) at Juliacon 2020 🎈



🌐 Pluto – one year later (25 min) at Juliacon 2021 🌐



πŸͺ Pluto – reactive and reproducible (25 min) at JupyterCon 2023 πŸͺ


Pluto.jl

_Writing a notebook is not just about writing the final document β€” Pluto empowers the experiments and discoveries that are essential to getting there._

**Explore models and share results** in a notebook that is

- **_reactive_** - when changing a function or variable, Pluto automatically updates all affected cells.
- **_lightweight_** - Pluto is written in pure Julia and is easy to install.
- **_simple_** - no hidden workspace state; friendly UI.

reactivity screencap

🎈 Pluto demo inside your browser 🎈

### Input

A Pluto notebook is made up of small blocks of Julia code (_cells_) and together they form a [**_reactive_** notebook](https://medium.com/@mbostock/a-better-way-to-code-2b1d2876a3a0).
When you change a variable, Pluto automatically re-runs the cells that refer to it. Cells can even be placed in arbitrary order - intelligent syntax analysis figures out the dependencies between them and takes care of execution.

Cells can contain _arbitrary_ Julia code, and you can use external libraries. There are no code rewrites or wrappers, Pluto just looks at your code once before evaluation.

### Output

Your notebooks are **saved as pure Julia files** ([sample](https://github.com/fonsp/Pluto.jl/blob/main/sample/Basic.jl)), which you can then import as if you had been programming in a regular editor all along. You can also export your notebook with cell outputs as attractive HTML and PDF documents. By reordering cells and hiding code, you have full control over how you tell your story.


## Dynamic environment

Pluto offers an environment where changed code takes effect instantly and where deleted code leaves no trace.
Unlike Jupyter or Matlab, there is **no mutable workspace**, but rather, an important guarantee:

At any instant, the program state is completely described by the code you see.

No hidden state, no hidden bugs.

### Interactivity

Your programming environment becomes interactive by splitting your code into multiple cells! Changing one cell **instantly shows effects** on all other cells, giving you a fast and fun way to experiment with your model.

In the example below, changing the parameter `A` and running the first cell will directly re-evaluate the second cell and display the new plot.

plotting screencap


### Built-in package manager

Pluto uses syntax analysis to understand which packages are being used in a notebook, and it **automatically manages a package environment** for your notebook. You no longer need to install packages, you can directly import any registered package like `Plots` or `DataFrames` and use it.

To ensure reproducibility, the information to exactly reproduce the package environment is **stored in your notebook file**. When someone else opens your notebook with Pluto, the exact same package environment will be used, and packages will work on their computer, automatically! _[more info](https://plutojl.org/pkg/)_

package manager screencap


### HTML interaction

Lastly, here's _**one more feature**_: Pluto notebooks have a `@bind` macro to create a **live bond between an HTML object and a Julia variable**. Combined with reactivity, this is a very powerful tool!

@bind macro screencap


You don't need to know HTML to use it! The [PlutoUI package](https://github.com/fonsp/PlutoUI.jl) contains basic inputs like sliders and buttons. Pluto's interactivity is very easy to use, you will learn more from the featured notebooks inside Pluto!

But for those who want to dive deeper - you can use HTML, JavaScript and CSS to write your own widgets! Custom update events can be fired by dispatching a `new CustomEvent("input")`, making it compatible with the [`viewof` operator of observablehq](https://observablehq.com/@observablehq/a-brief-introduction-to-viewof). Have a look at the JavaScript featured notebook inside Pluto!


## Pluto for teaching

Pluto was developed alongside the free online course [Introduction to Computational Thinking](https://computationalthinking.mit.edu/) at MIT, with the goal of creating a programming environment that is powerful, helpful and interactive, without being too intimidating for students and teachers.

Are you interested in using Pluto for your class? Here are some presentations by people who are using it already: [the MIT team](https://www.youtube.com/watch?v=LFRI3s0DE-o), [Gerhard Dorn](https://www.youtube.com/watch?v=6Qs5EXDpZBI), [Daniel Molina](https://www.youtube.com/watch?v=NrIxgnFXslg), [Henki W. Ashadi](https://youtu.be/GnEKgW23PvY?t=586) and [Max KΓΆhler](https://www.youtube.com/watch?v=8H5KgSIWsWQ).

https://user-images.githubusercontent.com/6933510/134824521-7cefa38a-7102-4767-bee4-777caf30ba47.mp4

_([video](https://www.youtube.com/watch?v=rpB6zQNsbQU)) Grant Sanderson ([3Blue1Brown](https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw)) using Pluto's interactivity to teach [Computational Thinking at MIT](https://computationalthinking.mit.edu/)!_






# Let's do it!

### Ingredients

For one tasty notebook πŸ₯ž you will need:

- [**Julia** v1.6 or above](https://julialang.org/downloads/#current_stable_release)
- Mozilla **Firefox** or Google **Chrome**

### Installation

🎈 How to install Julia & Pluto (6 min) 🎈

Run Julia, enter `]` to bring up Julia's [package manager](https://docs.julialang.org/en/v1/stdlib/Pkg/),
and add the Pluto package:

```julia
julia> ]
(v1.10) pkg> add Pluto
```

_Press `Ctrl+C` to return to the `julia>` prompt._

### Usage

To run Pluto, run the following commands in your Julia REPL:

```julia
julia> import Pluto
julia> Pluto.run()
```

Pluto will open in your browser, and you can get started!

## Questions and Help

Questions? Have a look at the [FAQ](https://github.com/fonsp/Pluto.jl/wiki).








Interested in learning Julia, Pluto and applied mathematics? Join the open MIT course taught by Alan Edelman, David P. Sanders & Grant Sanderson (3blue1brown) (and a bit of me): Introduction to Computational Thinking, Spring 2021.




## Contribute to Pluto

Follow [these instructions](https://github.com/fonsp/Pluto.jl/blob/main/CONTRIBUTING.md) to start working on the package.

## License

Pluto.jl is open source! Specifically, it is [MIT Licensed](https://github.com/fonsp/Pluto.jl/blob/main/LICENSE). Pluto.jl is built by gluing together open source software:

- `Julia` - [license](https://github.com/JuliaLang/julia/blob/master/LICENSE.md)
- `CodeMirror` - [license](https://github.com/codemirror/codemirror.next/blob/master/LICENSE-MIT)
- `HTTP.jl` - [license](https://github.com/JuliaWeb/HTTP.jl/blob/master/LICENSE.md)
- `MsgPack.jl` - [license](https://github.com/JuliaIO/MsgPack.jl)
- `msgpack-lite` - [license](https://github.com/kawanet/msgpack-lite/blob/master/LICENSE)
- `observablehq/stdlib` - [license](https://github.com/observablehq/stdlib/blob/master/LICENSE)
- `preact` - [license](https://github.com/preactjs/preact/blob/master/LICENSE)
- `developit/htm` - [license](https://github.com/developit/htm/blob/master/LICENSE)
- `MathJax` - [license](https://github.com/mathjax/MathJax-src/blob/master/LICENSE)

If you want to reference Pluto.jl in scientific writing, you can use our DOI: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4792401.svg)](https://doi.org/10.5281/zenodo.4792401)

### Featured notebooks

Unless otherwise specified, the included featured notebooks have a more permissive license: the [Unlicense](https://github.com/fonsp/Pluto.jl/blob/main/sample/LICENSE). This means that you can use them however you like - you do not need to credit us!

Your notebook files are _yours_, you also do not need to credit us. Have fun!

## From the authors

The Pluto project is an ambition to [_rethink what a programming environment should be_](http://worrydream.com/#!/LearnableProgramming). We believe that scientific computing can be a lot simpler and more accessible. If you feel the same, give Pluto a try! We would love to hear what you think. 😊

### You can chat with us

- talk with fellow Pluto users in the **[Zulip chat room](https://gist.github.com/fonsp/db7d00fd3fe5bc0b379b4af9ec6674b6)** (_search for the `pluto.jl` stream_)
- use Pluto's **[built-in feedback system:](https://github.com/fonsp/Pluto.jl/issues/182#issue-637726414)**
- contact fons **[via email](mailto:[email protected])**

feedback screencap

Questions? Have a look at the [FAQ](https://github.com/fonsp/Pluto.jl/wiki).

## Sponsors

Development of Pluto.jl is partially sponsored by

| | |
|----|----|
| MIT logo | The free online course _[Introduction to Computational Thinking](https://computationalthinking.mit.edu)_ at **MIT** uses Pluto notebooks to teach scientific computing in a new way. Homeworks react to the student in realtime, with _live answer checks and visualizations_ while you solve problems. |
| QuEra logo | **QuEra Computing** uses a Pluto notebook as an online dashboard to control their _quantum computer_! |
| JuliaHub logo | [**JuliaHub**](https://juliahub.com) enables the creation and editing of Pluto notebooks *on the cloud*! |
| NumFOCUS logo | The mission of **NumFOCUS** is to promote open practices in research, data, and scientific computing by serving as a fiscal sponsor for open source projects and organizing community-driven educational programs. |

_Created by [**Fons van der Plas**](https://github.com/fonsp) and [**MikoΕ‚aj Bochenski**](https://github.com/malyvsen). Inspired by [Observable](https://observablehq.com/)._