# Noob question about data for the new "Package Dependencies"

**URL:** <https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098>\
**Category:** Help\
**Created:** [August 16, 2018, 8:44pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098 "2018-08-16T20:44:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![owendall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/owendall/32/921_2.png) [@owendall](https://talk.observablehq.com/u/owendall)\
**Post date:** [August 16, 2018, 8:44pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098/1 "2018-08-16T20:44:37Z")

</div>

![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/1X/0ece725c0203bb7efe221cb3f47e8358cb32f51d.png)

Just starting to prototype a few viz, and am obviously missing some fundamentals. 🙂

I read the introduction to data, but don’t see something equivalent to the usage as per this new observable “Package Dependenices”

[[https://beta.observablehq.com/@mbostock/package-dependencies](https://beta.observablehq.com/@mbostock/package-dependencies)]

How do I replace this object with one of my own?

Thanks,

Owen

---

<div class="post-metadata">

**Author:** ![owendall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/owendall/32/921_2.png) [@owendall](https://talk.observablehq.com/u/owendall)\
**Post date:** [August 16, 2018, 8:54pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098/2 "2018-08-16T20:54:43Z")

</div>

OK, now I see pulling package.json for every module from [unpkg.com](http://unpkg.com), starting with the [name] variable set at the top of the workbook;

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/1X/1dc9332a25c50abdcbc056b8ed1cebfddcfc9a6b.png)

---

<div class="post-metadata">

**Author:** ![owendall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/owendall/32/921_2.png) [@owendall](https://talk.observablehq.com/u/owendall)\
**Post date:** [August 16, 2018, 9:02pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098/3 "2018-08-16T21:02:24Z")

</div>

Since we are still using d3 v4, this is very helpful:

> **[Package Dependencies: D3v4](https://observablehq.com/@owendall/package-dependencies-d3v4)**
>
> An Observable notebook by Owen Dall Sotomayor.

---

<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:** [August 16, 2018, 9:49pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098/4 "2018-08-16T21:49:19Z")

</div>

To visualize the dependencies of D3 v4, type `d3@4` into the box, and click Submit. You’ll see this:

 ![d3%404](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/1X/9653e4e0d251a188de3dd02a11de36c8c9ba0739.png)

---

<div class="post-metadata">

**Author:** ![owendall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/owendall/32/921_2.png) [@owendall](https://talk.observablehq.com/u/owendall)\
**Post date:** [August 16, 2018, 10:33pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098/5 "2018-08-16T22:33:01Z")

</div>

Thanks, Mike, the only thing I am missing now is s where you set the Url prefix to ‘[unpkg.com](http://unpkg.com)’ in the code?

Must be right in front of me, but don’t see it. 🙂

-Owen

---

<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:** [August 16, 2018, 11:25pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098/6 "2018-08-16T23:25:33Z")

</div>

That’s in [require.resolve](https://github.com/observablehq/notebook-stdlib/blob/master/README.md#require_resolve).

If you want this to visualize dependencies of a package that’s _not_ on npm, I suspect you’ll need to edit the notebook and replace the calls to require.resolve with something else that points to your package.json.

---

<div class="post-metadata">

**Author:** ![owendall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/owendall/32/921_2.png) [@owendall](https://talk.observablehq.com/u/owendall)\
**Post date:** [August 16, 2018, 11:34pm UTC](https://talk.observablehq.com/t/noob-question-about-data-for-the-new-package-dependencies/1098/7 "2018-08-16T23:34:25Z")

</div>

Ah–got it! Thanks, Mike

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/1X/f9dc7bcb8842eff49122a2515c1541269f5ce17c.png)
