CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/features/jupyter-notebook.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Layout } from "antd";
7
8
import { Icon } from "@cocalc/frontend/components/icon";
9
import { COLORS } from "@cocalc/util/theme";
10
import Backups from "components/landing/backups";
11
import Comparison from "components/landing/compare";
12
import Content from "components/landing/content";
13
import Footer from "components/landing/footer";
14
import Head from "components/landing/head";
15
import Header from "components/landing/header";
16
import Info from "components/landing/info";
17
import LaTeX from "components/landing/latex";
18
import Pitch from "components/landing/pitch";
19
import SignIn from "components/landing/sign-in";
20
import { Paragraph, Title } from "components/misc";
21
import A from "components/misc/A";
22
import { Customize } from "lib/customize";
23
import withCustomize from "lib/with-customize";
24
import { ChatGPTFixError } from "./ai";
25
26
import JupyterChat from "/public/features/cocalc-chat-jupyter-20171120-2.png";
27
import JupyterKernels from "/public/features/cocalc-jupyter-kernels.png";
28
import Nbgrader from "/public/features/cocalc-jupyter-nbgrader-overview.png";
29
import JupyterNasa from "/public/features/cocalc-jupyter-share-nasa.png";
30
import JupyterTF from "/public/features/cocalc-jupyter2-20170508.png";
31
import JupyterMem from "/public/features/cocalc-jupyter2-memory-cpu.png";
32
import RTC from "/public/features/cocalc-real-time-jupyter.png";
33
import JupyterLab from "/public/features/jupyter-lab.png";
34
import JupyterLogo from "/public/features/jupyter-logo.svg";
35
36
export default function JupyterNotebook({ customize }) {
37
function pitchNoSetup() {
38
return (
39
<>
40
<Title level={2}>
41
No software setup: <small>100% online</small>
42
</Title>
43
<Paragraph>
44
CoCalc is an online web service where you can{" "}
45
<strong>
46
run <A href="http://jupyter.org/">Jupyter notebooks</A> right inside
47
your browser
48
</strong>
49
. You can privately share your notebook with your{" "}
50
<A href="https://doc.cocalc.com/project-settings.html#about-collaborators">
51
project collaborators
52
</A>{" "}
53
– all changes are{" "}
54
<A href="#a-realtimesync">
55
<strong>synchronized in real-time</strong>
56
</A>
57
.
58
</Paragraph>
59
<Paragraph>
60
You no longer have to worry about setting up your Python environment,
61
installing/updating/maintaining your libraries, or backing up files.
62
CoCalc manages everything for you!{" "}
63
</Paragraph>
64
</>
65
);
66
}
67
68
function pitchTeaching() {
69
return (
70
<>
71
<Title level={2}>Jupyter Notebooks made for teaching!</Title>
72
<Paragraph>
73
<ul>
74
<li>
75
A sophisticated{" "}
76
<strong>
77
<A href="/features/teaching">course management system</A>
78
</strong>{" "}
79
keeps track of all notebooks of all students. It manages
80
distributing and collecting files as well as grading.
81
</li>
82
<li>
83
The{" "}
84
<A href="/features/whiteboard">
85
Jupyter collaborative whiteboard
86
</A>{" "}
87
supports presentations that mix Jupyter cells, mathematical
88
notation, and sketching with a pen and other tools.
89
</li>
90
<li>
91
CoCalc{"'"}s Jupyter Notebooks fully support{" "}
92
<A href="https://doc.cocalc.com/teaching-nbgrader.html">
93
<strong>very flexible automatic grading via nbgrader</strong>
94
</A>
95
! The teacher{"'"}s notebook contains exercise cells for students
96
and test cells, some of which students can also run to get
97
immediate feedback. Once collected, you tell CoCalc to
98
automatically run the full test suite across all student notebooks
99
and tabulate the results.
100
</li>
101
</ul>
102
</Paragraph>
103
<Paragraph>
104
CoCalc supports many kernels right out of the box: several Python
105
environments, <A href="http://www.sagemath.org/">SageMath</A>,{" "}
106
<A href="http://www.r-project.org/">R Statistical Software</A>
107
Octave, <A href="/features/julia">Julia</A> and many more.{" "}
108
</Paragraph>
109
</>
110
);
111
}
112
113
return (
114
<Customize value={customize}>
115
<Head title="Online Jupyter Notebooks" />
116
<Layout>
117
<Header page="features" subPage="jupyter-notebook" runnableTag="py" />
118
<Layout.Content>
119
<Content
120
landing
121
startup={"Jupyter"}
122
body={JupyterLogo}
123
title={"Online Jupyter Notebooks"}
124
subtitle={
125
"CoCalc's own collaborative, fully compatible and supercharged notebooks."
126
}
127
subtitleBelow={true}
128
image={JupyterTF}
129
alt={"Using Pandas and Tensorflow in a Jupyter notebook"}
130
/>
131
132
<Pitch col1={pitchTeaching()} col2={pitchNoSetup()} ext="ipynb" />
133
134
<Info
135
title="Collaborative editing"
136
icon="users"
137
image={RTC}
138
anchor="a-realtimesync"
139
alt={"Two browser windows editing the same Jupyter notebook"}
140
style={{ backgroundColor: COLORS.ANTD_BG_BLUE_L }}
141
>
142
<Paragraph>
143
You can share your Jupyter notebooks privately with project
144
collaborators. All modifications are{" "}
145
<strong>synchronized in real time</strong>, where you can see the
146
cursors of others while they edit the document. You are also
147
notified about the presence of collaborators.
148
</Paragraph>
149
<Paragraph>
150
Edit text between code cells using{" "}
151
<A href="https://doc.cocalc.com/markdown.html">
152
markdown or our collaborative rich text editor
153
</A>
154
.
155
</Paragraph>
156
<Paragraph>
157
We have extended ipywidgets so that sliders, menus and knobs of{" "}
158
<A href="https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Basics.html">
159
interactive widgets
160
</A>{" "}
161
are also fully synchronized among all collaborators.
162
</Paragraph>
163
<Paragraph>
164
Additionally, the status and results of all computations in the
165
currently running kernel session are also synchronized, because
166
the session runs remotely in CoCalc's cluster.
167
</Paragraph>
168
<Paragraph>
169
Together, everyone involved experiences the notebook in the same
170
way.
171
</Paragraph>
172
</Info>
173
174
<Info.Heading
175
description={
176
<>
177
The following are some more specific features of Jupyter
178
notebooks in CoCalc.
179
<br />
180
There is also more{" "}
181
<A href="https://doc.cocalc.com/jupyter.html">
182
comprehensive documentation
183
</A>
184
.
185
</>
186
}
187
>
188
Feature Overview
189
</Info.Heading>
190
191
<Info
192
anchor="a-timetravel"
193
title="TimeTravel"
194
icon="history"
195
video={[
196
"features/cocalc-jupyter2-timetravel-20170515-3x.webm",
197
"features/cocalc-jupyter2-timetravel-20170515-3x.mp4",
198
]}
199
alt="Video showing the TimeTravel slider in a SageMath Jupyter notebook"
200
>
201
<Paragraph>
202
<strong>
203
<A href="https://doc.cocalc.com/time-travel.html">TimeTravel</A>
204
</strong>{" "}
205
is a powerful feature of the CoCalc platform. It records all your
206
changes in your Jupyter notebook in fine detail. You can go back
207
and forth in time across thousands of changes to see all previous
208
edits.
209
</Paragraph>
210
<Paragraph>
211
This allows you to easily recover anything from previous versions
212
of your notebook by copy and pasting.
213
</Paragraph>
214
<Paragraph>
215
You can also browse the entire process of creating the notebook
216
from the start. This lets you discover how you arrived at a
217
particular solution and see what you (or your students) tried to
218
get there.
219
</Paragraph>
220
</Info>
221
222
<Info
223
anchor="a-nbgrader"
224
title="NBGrader: automatically grading assignments"
225
icon="graduation-cap"
226
image={Nbgrader}
227
alt="Creating an NBGrader-enhanced Jupyter notebook"
228
>
229
<Paragraph>
230
CoCalc's Jupyter Notebooks fully support both{" "}
231
<strong>automatic</strong> and <strong>manual grading</strong>!
232
</Paragraph>
233
<Paragraph>
234
When using NBGrader, the teacher's notebook contains exercise
235
cells for students and test cells, some of which students run to
236
get immediate feedback. Once collected, you tell CoCalc to
237
automatically run the full test suite across all student notebooks
238
and tabulate the results.
239
</Paragraph>
240
<Paragraph>
241
Learn more about{" "}
242
<A href="https://doc.cocalc.com/teaching-nbgrader.html">
243
NBGrader in CoCalc
244
</A>
245
.{" "}
246
</Paragraph>
247
</Info>
248
249
<ChatGPTFixError embedded={true} />
250
251
<Info
252
anchor="a-kernels"
253
title="Managed Jupyter kernels"
254
icon="python"
255
image={JupyterKernels}
256
alt="Dropdown menu showing a large number of preinstalled Jupyter kernels"
257
>
258
<Paragraph>
259
CoCalc makes sure that your desired computational environment is
260
available and ready to work with. Select from many pre-installed
261
and <strong>fully managed kernels</strong>. You can also create
262
your own{" "}
263
<A href="https://doc.cocalc.com/howto/custom-jupyter-kernel.html">
264
custom kernel
265
</A>
266
.
267
</Paragraph>
268
<Paragraph>
269
Look at our <A href="/software">list of available software</A> for
270
more about what is available.
271
</Paragraph>
272
</Info>
273
274
<Info
275
anchor="a-chat"
276
title="Chat about your Jupyter notebook"
277
icon="comment"
278
image={JupyterChat}
279
alt="Chatting about a Jupyter notebook"
280
>
281
<Paragraph>
282
A{" "}
283
<strong>
284
<A href="https://doc.cocalc.com/chat.html">chat to the side</A>
285
</strong>{" "}
286
of each Jupyter notebook lets you discuss the content of your
287
notebook with colleagues or students. You can drag and drop or
288
paste images and files into chat, use <LaTeX /> math formulas, and
289
fix typos in messages.
290
</Paragraph>
291
<Paragraph>
292
Collaborators who are not online will be notified about new
293
messages the next time they sign in or you can @mention them so
294
they get emailed.
295
</Paragraph>
296
<Paragraph>
297
Chat fully supports markdown formatting and <LaTeX /> formulas.{" "}
298
</Paragraph>
299
</Info>
300
301
<Info
302
anchor="a-kernels"
303
title="JupyterLab and Jupyter Classic"
304
icon="server"
305
image={JupyterLab}
306
alt="Running JupyterLab inside a CoCalc Project"
307
>
308
<Paragraph>
309
CoCalc's Jupyter is a <strong>complete rewrite</strong> of the
310
classical <A href="http://jupyter.org/">Jupyter notebook</A>{" "}
311
interface and backend server. It is tightly integrated into CoCalc
312
and adds realtime collaboration, TimeTravel history and{" "}
313
<A href="http://blog.sagemath.com/jupyter/2017/05/05/jupyter-rewrite-for-smc.html">
314
more
315
</A>
316
. This rewrite does not change the underlying Jupyter notebook
317
file format; you can download your <code>*.ipynb</code> file at
318
any time and continue working in another environment.
319
</Paragraph>
320
<Paragraph>
321
In addition, CoCalc also{" "}
322
<A href="https://doc.cocalc.com/jupyter.html#alternatives-plain-jupyter-server-and-jupyterlab-server">
323
fully supports running
324
</A>{" "}
325
standard JupyterLab (with realtime collaboration enabled) and
326
Jupyter Classic notebook servers from any CoCalc project! You can
327
still use all libraries and extension that might rely on specifics
328
of one of those implementations. Moreover,{" "}
329
<strong>
330
you can fully use your CoCalc project via the powerful
331
JupyterLab interface!
332
</strong>
333
</Paragraph>
334
<Paragraph>
335
CoCalc also supports{" "}
336
<A href="https://doc.cocalc.com/jupyter.html#collaboration-with-classical-jupyter">
337
using Jupyter Classic with collaborative editing and chat
338
</A>
339
.
340
</Paragraph>
341
</Info>
342
343
<Info
344
anchor="a-monitoring"
345
title="CPU and memory monitoring for each notebook"
346
icon="line-chart"
347
image={JupyterMem}
348
alt="Jupyter notebook showing CPU and memory indicators"
349
>
350
<Paragraph>
351
Long running notebook sessions or intense computations might
352
deplete available CPU or memory resources. This slows down all
353
calculations or even causes an unexpected termination of the
354
current session.
355
</Paragraph>
356
<Paragraph>
357
CoCalc's per-notebook CPU and memory indicators helps you to{" "}
358
<strong>
359
keep an eye on the notebook's memory and CPU consumption
360
</strong>
361
.
362
</Paragraph>
363
<Paragraph>
364
You can even close your browser during long running computations,
365
and check on the results later.{" "}
366
<strong>Output will not be lost</strong> while your browser is
367
closed.
368
</Paragraph>
369
</Info>
370
371
<Backups />
372
373
<Info
374
anchor="a-publishing"
375
title="Publishing your notebooks"
376
icon="bullhorn"
377
image={JupyterNasa}
378
alt="Jupyter notebook hosted on the CoCalc share server"
379
>
380
<Paragraph>
381
CoCalc helps you{" "}
382
<A href="/share">
383
<strong>share your work with the world</strong>
384
</A>
385
. It offers its own hosting of shared documents, which includes
386
Jupyter notebooks and any other associated data files.
387
</Paragraph>
388
<Paragraph>
389
Under the hood, CoCalc uses a novel renderer which generates a
390
static HTML representation of your notebook (sanitized to prevent
391
XSS attacks) on the server, which includes pre-rendered <LaTeX />{" "}
392
formulas. This approach is very efficient and lightweight compared
393
to solutions based on{" "}
394
<A href="https://nbconvert.readthedocs.io">nbconvert</A>.{" "}
395
</Paragraph>
396
</Info>
397
398
<Comparison
399
name="jupyter"
400
disclaimer
401
title={
402
<h2 style={{ textAlign: "center" }}>
403
<Icon name="bolt" /> Jupyter notebooks in CoCalc versus the
404
competition
405
</h2>
406
}
407
/>
408
409
<SignIn startup="Jupyter" />
410
</Layout.Content>
411
<Footer />
412
</Layout>
413
</Customize>
414
);
415
}
416
417
export async function getServerSideProps(context) {
418
return await withCustomize({ context });
419
}
420
421