# Using d3-selection-multi

**URL:** <https://talk.observablehq.com/t/using-d3-selection-multi/2068>\
**Category:** Uncategorized\
**Created:** [June 19, 2019, 5:29pm UTC](https://talk.observablehq.com/t/using-d3-selection-multi/2068 "2019-06-19T17:29:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yurivish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/yurivish/32/198_2.png) [@yurivish](https://talk.observablehq.com/u/yurivish)\
**Post date:** [June 19, 2019, 5:29pm UTC](https://talk.observablehq.com/t/using-d3-selection-multi/2068/1 "2019-06-19T17:29:12Z")

</div>

I’d like to use [https://github.com/d3/d3-selection-multi](https://github.com/d3/d3-selection-multi) within Observable notebooks. Is there a way to import the standard `d3` bundle together with `d3-selection-multi`?

The advice in [this thread](https://talk.observablehq.com/t/how-to-import-d3-selection-and-d3-selection-multi/967/2) works for requiring d3-selection and d3-selection-multi, but `require('d3', 'd3-selection-multi')` doesn’t seem to work even though `require('d3-selection', 'd3-selection-multi')` does.

Test notebook: [https://observablehq.com/d/0d730877fb8fac98](https://observablehq.com/d/0d730877fb8fac98)

I tried using the [require debugger](https://observablehq.com/@tmcw/module-require-debugger) but it doesn’t look like the issue is with importing the module.

---

<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:** [June 19, 2019, 5:49pm UTC](https://talk.observablehq.com/t/using-d3-selection-multi/2068/2 "2019-06-19T17:49:47Z")

</div>

You need to tell require where to find d3-selection (and d3-transition). Without that, it doesn’t realize that the `d3` module defines `d3-selection` and `d3-transition`, and so you get duplicate copies of the modules. I sent you a suggestion:

```auto
d3 = require.alias({
  'd3-selection': 'd3',
  'd3-transition': 'd3'
})('d3', 'd3-selection-multi')

```

---

<div class="post-metadata">

**Author:** ![yurivish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/yurivish/32/198_2.png) [@yurivish](https://talk.observablehq.com/u/yurivish)\
**Post date:** [June 19, 2019, 5:55pm UTC](https://talk.observablehq.com/t/using-d3-selection-multi/2068/3 "2019-06-19T17:55:34Z")

</div>

Awesome, thanks Mike!

For future readers, [this guide](https://observablehq.com/@observablehq/introduction-to-require) is a great introduction to the basics of `require`, and here’s the [full documentation](https://github.com/d3/d3-require) for the d3-require module.
