Skip to content

Commit

Permalink
πŸ”’ Statistics and async asset loading
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed May 5, 2020
1 parent 8f043ac commit 98728e0
Show file tree
Hide file tree
Showing 15 changed files with 1,105 additions and 846 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Pluto"
uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
license = "MIT"
authors = ["Fons van der Plas <[email protected]>", "MikoΕ‚aj Bochenski <[email protected]>"]
version = "0.7.10"
version = "0.8.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ _Writing a notebook is not just about writing the final document β€” Pluto empow
### 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 - our intelligent syntax parser figures out the dependencies between them and takes care of execution.
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

Expand All @@ -24,7 +26,7 @@ Your notebooks are **saved as pure Julia files** ([sample](https://github.com/fo
## 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 a _one-to-one correspondence_ between variables and code. In a Pluto notebook, the value of a variable _always_ corresponds to the code that defines it β€” there is no hidden state.
Unlike Jupyter or Matlab, there is **no mutable workspace**, but rather a _one-to-one correspondence_ between variables and code. In a Pluto notebook, a variable or function definition _always_ corresponds to the code that defines it β€” there is no hidden state.

### Interactivity

Expand Down Expand Up @@ -100,7 +102,7 @@ We are happy to say that Pluto.jl runs smoothly for most users, and is **ready t

That being said, the Pluto project is an ambition to [_rethink what a programming environment should be_](http://worrydream.com/#!/LearnableProgramming). We believe that scientific programming can be a lot simpler. Not by adding more buttons to a text editor β€” by giving space to creative thought, and automating the rest.

If you feel the same, give Pluto a try! We would love to hear your thoughts. 😊
If you feel the same, give Pluto a try! We would love to hear your what you think. 😊

This comment has been minimized.

Copy link
@vdplasthijs

vdplasthijs May 5, 2020

fons

This comment has been minimized.

Copy link
@fonsp

fonsp May 5, 2020

Author Owner

derp


<img alt="feedback screencap" src="https://user-images.githubusercontent.com/6933510/78135402-22d02d80-7422-11ea-900f-a8b01bdbd8d3.png" width="70%">

Expand Down
2 changes: 2 additions & 0 deletions assets/bond.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ function makeBond(bondNode) {
return
}
bondNode.generator.next().value.then(val => {
window.statistics.numBondSets++

window.refreshAllCompletionPromise()
window.client.sendreceive("bond_set", {
sym: bondNode.getAttribute("def"),
Expand Down
6 changes: 5 additions & 1 deletion assets/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ class PlutoConnection {
this.MSG_DELIM = "IUUQ.km jt ejggjdvmu vhi"
this.clientID = this.getUniqueShortID()
this.sentRequests = {}
this.plutoVersion = "unknown"
this.juliaVersion = "unknown"

window.addEventListener("beforeunload", e => {
//this.send("disconnect", {})
Expand All @@ -201,7 +203,9 @@ class PlutoConnection {
})

const plutoPromise = this.sendreceive("getversion", {}).then(u => {
return u.message.pluto
this.plutoVersion = u.message.pluto
this.juliaVersion = u.message.julia
return this.plutoVersion
})

return Promise.all([githubPromise, plutoPromise])
Expand Down
110 changes: 62 additions & 48 deletions assets/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">

<head>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<meta name="viewport" content="width=device-width" />
<title>⚑ Pluto.jl ⚑</title>
<meta charset="utf-8" />
<script>
Expand All @@ -14,16 +14,16 @@
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="assets/favicon-96x96.png">
<meta name="description" content="Pluto.jl notebook" />
<meta name="description" content="Pluto.jl notebooks" />

<script src="assets/client.js"></script>
<script src="assets/filepicker.js"></script>
<script src="assets/client.js" defer></script>
<script src="assets/filepicker.js" defer></script>
<style>
@import url('https://fonts.googleapis.com/css?family=Roboto+Slab:700&display=swap');
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i&display=swap&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese');

/* GENERAL PAGE LAYOUT */
html{
html {
font-size: 17px;
}

Expand Down Expand Up @@ -195,7 +195,7 @@
border-bottom-left-radius: 0 !important;
}

#logocontainer:after {
#logocontainer:after {
margin-left: auto;
align-self: center;
}
Expand Down Expand Up @@ -235,10 +235,10 @@
opacity: 1.0;
}


}



body.disconnected>header {
background-color: rgba(255, 169, 114, 0.56);
Expand Down Expand Up @@ -308,9 +308,9 @@
cell.code-folded>cellinput {
display: none;
}

cell.output-notinsync>cellinput,
cell.codediffers>cellinput {
cell.code-differs>cellinput {
display: unset;
}

Expand Down Expand Up @@ -379,9 +379,9 @@
cell.code-folded>runarea {
display: none;
}

cell.output-notinsync>runarea,
cell.codediffers>runarea {
cell.code-differs>runarea {
display: block;
}

Expand Down Expand Up @@ -420,8 +420,8 @@
display: none;
}

@media screen and (min-width: 1050px){
@media screen and (min-width: 1050px) {

#helpbox-wrapper {
display: block;
position: sticky;
Expand All @@ -439,7 +439,7 @@
width: 300px;
height: 400px;
/* overflow: hidden; */

background-color: white;
/* border: 2px solid darkgray; */
border-right: none;
Expand All @@ -448,7 +448,7 @@
box-shadow: 0 0 11px 0px #00000010;
font-family: "Alegreya Sans", sans-serif;
}

helpbox>header {
background-color: #eef1f7;
color: hsl(230, 14%, 11%);
Expand All @@ -458,7 +458,7 @@
cursor: pointer;
/* border-top: 4px solid #8a8a8a; */
}

helpbox>section {
height: 100%;
overflow: auto;
Expand All @@ -475,11 +475,11 @@
border-bottom: none;
font-size: 1rem;
}

helpbox>section h1 {
font-size: 1.3rem;
}

helpbox.hidden {
height: initial;
}
Expand All @@ -488,22 +488,22 @@
display: none;
}

helpbox>header::before{
helpbox>header::before {
content: "πŸ“– ";
}

/* helpbox.loading>header::before{
content: "βŒ› ";
} */

helpbox.hidden>header::before{
helpbox.hidden>header::before {
content: "πŸ“š ";
}


}

@media screen and (min-width: 1050px) and (max-width: 1400px){
@media screen and (min-width: 1050px) and (max-width: 1400px) {
main {
margin-right: 350px;
}
Expand All @@ -520,38 +520,49 @@
z-index: 7;
}

footer form{
footer form {
height: 1.5rem;
display: flex;
flex-direction: row;
justify-content: flex-end;
}

footer form > *{
footer form>* {
flex: 0 0 auto;
margin-left: .5rem;
}

footer form a,
footer form label {
align-self: center;
}

footer form>a {
margin-right: auto;
}

footer a {
color: black;
opacity: .6;
font-weight: 700;
}

@media (max-width: 650px) {
footer form>label {
display: none;
}
}

footer input {
border: 2px solid #818181;
font-family: "Roboto Mono";

border-radius: 3px;
padding: 3px;
}

body>header button,
footer button{
footer button {
background: #896c6c;
border-radius: 3px;
border: 2px solid #896c6c;
Expand Down Expand Up @@ -601,31 +612,33 @@
}
}
</style>
<script src="https://cdn.jsdelivr.net/npm/@observablehq/[email protected]/dist/stdlib.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/codemirror.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/mode/julia/julia.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/addon/hint/show-hint.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/addon/display/placeholder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/addon/edit/matchbrackets.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/@observablehq/[email protected]/dist/stdlib.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/codemirror.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/mode/julia/julia.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/addon/hint/show-hint.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/addon/display/placeholder.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/addon/edit/matchbrackets.min.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/lib/codemirror.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/addon/hint/show-hint.min.css"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/addon/hint/show-hint.min.css">

<link rel="stylesheet" href="assets/light.css" />
<!-- The instant feedback form at the bottom of the page uses Google Firestore to save feedback. We DO NOT use Google Analytics, and NO DATA is sent except for data entered in the feedback form. We might add telemetry in the future, and this will be an opt-in feature. -->
<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-firestore.js"></script>
<!-- The instant feedback form at the bottom of the page uses Google Firestore to save feedback and statistics. We DO NOT use Google Analytics, and NO DATA is sent except for data entered in the feedback form and anonymous statistics. See /statistics-info for more details. -->
<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-app.js" defer></script>
<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-firestore.js" defer></script>
</head>

<body class="loading no-MΞ±ΞΈJax">
<header>
<div id="logocontainer">
<a href="./"><h1>
<img src="assets/logo.svg" alt="Pluto.jl" /></h1></a>
<filepicker>

<button>Rename</button>
</filepicker>
<a href="./">
<h1>
<img src="assets/logo.svg" alt="Pluto.jl" /></h1>
</a>
<filepicker>

<button>Rename</button>
</filepicker>
</div>
</header>

Expand Down Expand Up @@ -666,16 +679,17 @@
<footer>
<div id="info">
<form id="feedback" action="#" method="post">
<label for="opinion">πŸ™‹ How can we make <a href="https://github.com/fonsp/Pluto.jl" target="_blank">Pluto.jl</a> better?</label>
<a id="statistics-info" href="statistics-info">Statistics</a>
<label for="opinion">πŸ™‹ How can we make <a href="https://github.com/fonsp/Pluto.jl">Pluto.jl</a> better?</label>
<input type="text" name="opinion" id="opinion" autocomplete="off" placeholder="Instant feedback...">
<button>Send</button>
</form>
</div>
</footer>

<script src="assets/editor.js"></script>
<script src="assets/bond.js"></script>
<script src="assets/feedback.js"></script>
<script src="assets/bond.js" defer></script>
<script src="assets/editor.js" defer></script>
<script src="assets/feedback.js" defer></script>

<script>
MathJax = {
Expand Down
Loading

2 comments on commit 98728e0

@fonsp
Copy link
Owner Author

@fonsp fonsp commented on 98728e0 May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/14190

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.0 -m "<description of version>" 98728e06c7b6b14137156a0dc0e13c19328697d8
git push origin v0.8.0

Please sign in to comment.