Skip to content

Notebooks

NotebooksLearn about notebooks vs. projects

Observable notebooks are interactive, editable documents defined by code. In notebooks, you can combine formatted text (in Markdown), code (JavaScript, SQL, HTML), and outputs (e.g. customized data tables and visualizations), then share your work with teammates and stakeholders.

A notebook is both a final product for presentation, and a large blank canvas for trying out ideas and calculations. How do you start? By creating cells. Cells are where you place content — text, JavaScript code, or other instructions.

All content in notebooks is made in cells. Within cells, you can author formatted text (in Markdown) and code (JavaScript, SQL, HTML) to view right alongside customized data tables and visualizations. Then, quickly share your work with teammates and stakeholders to get everyone literally on the same page.

An illustration of an Observable notebook being broken down into its cells.

A notebook is both a final product for presentation, and a blank canvas for data analysis, exploration, and creative tinkering. With zero software installation or environment setup required, the barriers to get up and running in an Observable notebook are low for coders and non-coders alike.

Upload data, visualize and add interactivity

At Observable, we aim to help everyone—regardless of their previous experience with data, writing code, or building visualizations—get from data to insights with the least possible friction. In Observable notebooks, a wealth of features and code snippets for low-code data access, analysis, and visualization exist at your fingertips.

Upload data

In Observable, you can quickly access your own data by attaching local files or spreadsheets, connecting to APIs, and—for Enterprise and Pro users—connecting to databases or cloud files. Here is an example of uploading a CSV file to an Observable notebook, and viewing its contents in a data table.

Visualize data with Plot

The Observable Plot library lets you quickly build and customize data visualizations. Code snippets are provided in the cell menu as a starting point for many common chart types. They help get you up and running quickly with your own visualizations by simply substituting your data and variable names.

Add interactivity

Observable Inputs are lightweight interface components (including buttons, sliders, dropdowns, tables, and text inputs) that help you explore data and build interactive displays. You can also find them in the cell menu.

Once you've added an Input to your notebook, link its value to one or more elements of a chart to add interactivity. Since your Observable notebook is on the web and in the language of the web, your interactive chart is immediately shareable with collaborators.

Made for collaboration

At Observable, we believe that collaboration is key to doing responsible, innovative work with data. That's why we support several ways to collaborate with others in notebooks, whether it's co-editing a visualization or adding comments to an analysis. Here are a few ways that Observable is built with collaboration in mind.

Multiplayer editing

You can invite others to join and edit notebooks with you. Edits are live and visible to all users who are present at the same time. You can see other active users' avatars at the top of the screen. Click on them to automatically follow them around the notebook!

Explore, comment and discuss—right in the notebook

Collaborators and stakeholders don't require edit access to contribute to work in an Observable notebook. Anyone with view access can interact with notebooks using inputs, and can give feedback and participate in discussions using comments. Comments get sent to the original editor so they can respond and resolve.

Version history

Whether working solo or with collaborators in a notebook, it is useful to have a record of changes made. The History pane (accessed by clicking the clock icon in the right margin) shows what changes were made to your notebook. You can also revert back to earlier versions at any time.

Automated version history in Observable means that everyone working in the notebook can safely make edits and investigate changes.

JavaScript for data analysis

At Observable, we believe that JavaScript is the future of data analysis. Our co-founder, Mike Bostock, wrote in Towards Data Science:

JavaScript is the richest medium we've ever had for communication, but thanks to the open nature of the web it's also something more: a medium amenable to inspection and tinkering, for learning and collaboration.

While JavaScript lacks some of the extensive data analysis and data science libraries you see in R, Python, or Julia, it makes up for that with portability and convenience. Notebooks can run in a browser, on your laptop, tablet or phone. You can see the code, edit the code, run the code from any of those devices. There is no setup required, there is no software to install. It simply works.

As so many of our workflows move to the web, the ones that don't become more inconvenient. What we need are better tools in JavaScript for data analysis, and that's where Observable comes in.

Data analysis and visualization

JavaScript has been a common language for data visualization for many years. D3 has become the de facto framework for bespoke data visualization, used extensively by news organizations and for custom visualization applications. Many other great visualization frameworks are also built in JavaScript, such as VegaLite, Highcharts, Observable Plot, and more. JavaScript is clearly the language of choice for data visualization today.

At Observable, we believe that data visualization is data analysis. Charts let us explore and understand patterns in data using visual encodings, rather than through mathematical models. They can reveal insights and raise questions that may otherwise be hidden within model assumptions and numerical outputs. And, visuals can be a more approachable and compelling way to communicate insights with stakeholders who may not be familiar with models or know how to interpret them.

With tools to aggregate and summarize raw data directly in visualizations (for example, see Plot group for grouped transformations right in Observable Plot), Observable makes it straightforward to view patterns in raw and transformed data without the need for extensive data preparation.

Combined with SQL cells and JavaScript libraries for data wrangling and analysis (which are easily loaded into notebooks using require), Observable has the tools you need for many data analysis essentials.

The Observable community

The community of Observable creators, learners, readers, and ambassadors is vast. By joining the Observable community, you tap into a universe of published notebooks and examples that you can look to for inspiration and reuse in your own work. You also get direct support from community members when you have questions or need help.

Community contributions for inspiration and reuse

The Observable community is home to thousands of visualization and data analysis examples. Our explore page is your portal to our top content, rated by community likes and curated by the Observable team. Examples you find can be reused for your own analysis, either by importing the code itself or forking the notebook to your own workspace.

Visualization code is easy to reuse for other datasets. The components collection features reusable functions that you can easily import into your own notebooks to analyze your own data.

The video above shows an example of an import. Observable lets you quickly reuse content by importing named cells from other notebooks. Most often you'll import code and functions for reuse, but imports are versatile—you can also import charts, inputs, tables, text, or even data. This works with community notebooks, as well as private notebooks within a team.

With content from thousands of community-contributed Observable notebooks available for reuse, how can you focus your search to find what you need? Check out our guide for searching on Observable and visit a couple of our favorite links, such as the Plot and D3 galleries.

Collections

Collections are a way to organize notebooks into custom groups. Notebooks can be added to a single collection or many collections, and collections can be nested within other collections. You can view a users public notebooks as well as their public collections.

Forking

Creating a fork of a notebook means to make your own copy, like suddenly making a fork in the road and going your own way. This is a fundamental concept in software development, but if this idea is new to you, think of it as making a copy of a recipe. Once you have a copy, you can make changes without affecting the original—the forked copy of the recipe is yours to save, modify, or discard as you choose.

History

Observable keeps a history of all edits made to a notebook, allowing you to undo (and redo) changes whenever needed. Notebook history lets authors edit fearlessly with the knowledge that they can always go back to a previous version of their notebook. It also allows teams to better understand how their notebooks have changed over time, and who edited them.

Imports

Observable lets you quickly reuse content by importing named cells from other notebooks. Most often you'll import code and functions for reuse, but imports are versatile — you can also import charts, inputs, tables, or text from any named cell. This works with community notebooks, as well as private notebooks within a team. You must have access to a notebook to be able import its cells.

Saving

As Observable keeps a history of all yoru edits to a notebook, it's helpful to understand how saving works with notebooks. Some edits, like in tinker mode, do not trigger a save to the original notebook.

Templates

In addition to forking and importing from notebooks, the Observable team has published dozens of notebook templates to help you get started with common analyses and visualizations. When you create a new notebook, you'll see these templates as boilerplate options. Selecting a template will automatically fork a copy of the template notebook to your space.