Martin Kavalar / Feb 07 2019
Remix of 👋 Nextjournal by Nextjournal
👋 Nextjournal
👋 Nextjournal
Welcome to this quick introduction to Nextjournal.
1. Introduction
1.
Introduction
Remixing enables effortless reuse and sharing.
2. Working with Code & Data
2.
Working with Code & Data
2.1. Basics
2.1.
Basics
randn(500)
2.2. Accessing Files
2.2.
Accessing Files
library(tidyverse) read_csv2(Passagiere S-Bahn Hamburg 2009.csv↩) %>% group_by(Station) %>% summarize(Einsteiger= sum(Einsteiger)) %>% top_n(4) %>% ggplot(aes(Station, Einsteiger, fill=Station)) + geom_bar(stat = "identity") + scale_y_continuous(labels = scales::comma) + theme(axis.text.x=element_blank(), axis.ticks.x=element_blank(), plot.title = element_text(hjust = 0.5)) + ggtitle("Top 5 Stations S-Bahn Hamburg 2009")
2.3. JavaScript
2.3.
JavaScript
For instant feedback.
var size = 12, x = [], y = [], z = [], i, j; for (var i = 0; i < size; i++) { x[i] = y[i] = -2 * Math.PI + 4 * Math.PI * i / size; z[i] = new Array(size); } for (var i = 0; i < size; i++) { for (j = 0; j < size; j++) { var r2 = x[i] * x[i] + y[j] * y[j]; z[i][j] = Math.sin(x[i]) * Math.cos(y[j]) * Math.sin(r2) / Math.log(r2+1); } } Nextjournal.plot([{ z: z, x: x, y: y, type: 'contour' }]);
2.4. Reusing Custom Environments
2.4.
Reusing Custom Environments
import math import random import svgwrite dots, c, size, w, h = 100, 6.1, 4, 670, 150 phi = (1 + math.sqrt(5)) / 2 rad_phi = (math.pi * 2) / (phi + 1) dwg = svgwrite.Drawing("/results/spiral.svg", (w, h)) a = 0 for n in range (0, dots): r = c * math.sqrt(n) x = r * math.cos (a) + w / 2 y = r * math.sin (a) + h / 2 color = "#%06x" % random.randint(0, 0xFFFFFF) dwg.add(dwg.circle ((x, y), size, fill=color)) a += rad_phi dwg.save()
2.5. Installing Dependencies
2.5.
Installing Dependencies
2.6. Building Custom Environments
2.6.
Building Custom Environments
3. Versioning
3.
Versioning
Notebooks are fully versioned including referenced data files, results and environments.
4. Importing
4.
Importing
4.1. Files
4.1.
Files
4.2. Notebooks (Jupyter / Markdown / RMarkdown)
4.2.
Notebooks (Jupyter / Markdown / RMarkdown)
Let's import something from a gallery of interesting Jupyter Notebooks.
4.3. Docker Images
4.3.
Docker Images
Bash Official
Download as Docker image from:
This image was imported from: bash
head -n 2 /etc/os-release
4.4. GitHub Repositories
4.4.
GitHub Repositories
nextjournal/demo
Private
ls -lah /demo
4.5. Data (Amazon S3 / Google Cloud Storage)
4.5.
Data (Amazon S3 / Google Cloud Storage)
mxnet-public
Public
ls /mxnet-public
5. Exporting
5.
Exporting
5.1. Markdown
5.1.
Markdown
5.2. Data
5.2.
Data
5.3. Docker Images
5.3.
Docker Images
6. Sharing
6.
Sharing