From the course: Data Analytics with Observable

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Importing from existing notebooks

Importing from existing notebooks - Observable Tutorial

From the course: Data Analytics with Observable

Importing from existing notebooks

- One of the many nice things about Observable is it lets you reuse code in myriad ways. As we've already seen and done many times, you can fork a notebook and copy the whole thing and you can just copy-paste code from one notebook into another, of course. Another way you can reuse things is by importing cells from existing notebooks. So here we have our Customize charts with Plot notebook, with my nice fancy chart in it. And let's say I wanted to bring this into a new notebook that's going to be a nice fancy report for users to look at. And I don't want 'em to look at all this junk down here. So what I need to do is two things while I'm in here. Number one, my visual. Right now, if I open up the code, it is not a named cell, right? There's no name down here and it doesn't say name equals anything up here. So I'm going to name it. I'm going to name this one happiness_visual. That's what I'm going to refer to it as later…

Contents