# composing multiple notebooks

**URL:** <https://talk.observablehq.com/t/composing-multiple-notebooks/1708>\
**Category:** Help\
**Created:** [February 28, 2019, 7:11pm UTC](https://talk.observablehq.com/t/composing-multiple-notebooks/1708 "2019-02-28T19:11:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgits](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bgits/32/1707_2.png) [@bgits](https://talk.observablehq.com/u/bgits)\
**Post date:** [February 28, 2019, 7:11pm UTC](https://talk.observablehq.com/t/composing-multiple-notebooks/1708/1 "2019-02-28T19:11:41Z")

</div>

I’m wondering if observable supports interactive composing between multiple notebooks or is on the roadmap?

I have started creating multiple notebooks and then composing them into a larger notebook. Now I want some key values set in the master notebook which the children will use as defaults and would be nice to see an updated representation of the data in all notebooks as the data changes in the master notebook.

I will give an example:

I have a master notebook: [https://observablehq.com/@bgits/status-network-combined-utility-values](https://observablehq.com/@bgits/status-network-combined-utility-values)

that combines values from multiple notebooks. In it I have created a variable `numberStatusUsers` which is used as a default value for: [https://observablehq.com/@bgits/status-teller-network-utility-value-exploration](https://observablehq.com/@bgits/status-teller-network-utility-value-exploration) in its `numberStatusUsers`. It’s used for some calculations and then the variable `currentUtilityValue` is imported by the master notebook and used part of the calculations for display. The problem is that changing the slider or even saving an updated value does not automatically adjust the values in the master notebook. Seems I would have to save the master and then refresh the children which looses the whole interactive playground experience of observable and combing them all into one large notebook could get messy.

Wondering if there is currently a way to do this or if something is planned on the roadmap?

---

<div class="post-metadata">

**Author:** ![bgchen](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bgchen/32/784_2.png) [@bgchen](https://talk.observablehq.com/u/bgchen)\
**Post date:** [February 28, 2019, 7:55pm UTC](https://talk.observablehq.com/t/composing-multiple-notebooks/1708/2 "2019-02-28T19:55:36Z")

</div>

If I understand what you’re asking for, you can use the `import ... with ...` syntax for this. Here’s a quick fork of your master notebook which is more interactive:

> **[Status Network Combined Utility Values](https://observablehq.com/d/e7e12562cc4df9a1)**
>
> An Observable notebook by Bryan Gin-ge Chen.

See also this nice demo by @mbostock (made in response to [another post](https://talk.observablehq.com/t/am-i-missing-the-interactions-in-mikes-dashboard/1582/4) on the forums):

> **[Coordinated Imports](https://observablehq.com/@mbostock/coordinated-imports)**
>
> An Observable notebook by Mike Bostock.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [February 28, 2019, 7:57pm UTC](https://talk.observablehq.com/t/composing-multiple-notebooks/1708/3 "2019-02-28T19:57:08Z")

</div>

Interesting application. To echo @bgchen, I would use import-with if it suits your needs.

That said, another option is to use the Broadcast Channel API to synchronize values across windows and even across different notebooks.

> **[Broadcast Channel](https://observablehq.com/@mbostock/broadcast-channel)**
>
> An Observable notebook by Mike Bostock.

You could also use localStorage to persist values.

But, both broadcast channels and local storage are local to your browser—they wouldn’t be visible to other people reading your notebook. For synchronization and persistence across browsers you’d need web sockets and some server-side storage. It’s a pretty interesting application, though. We might offer some API like this in the future.
