# D3.js: Not resizing in Browser

**URL:** https://talk.observablehq.com/t/d3-js-not-resizing-in-browser/8581
**Category:** Help
**Created:** [December 8, 2023, 1:35pm UTC](https://talk.observablehq.com/t/d3-js-not-resizing-in-browser/8581 "2023-12-08T13:35:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TDd](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@TDd](https://talk.observablehq.com/u/TDd)
#### Post date: [December 8, 2023, 1:35pm UTC](https://talk.observablehq.com/t/d3-js-not-resizing-in-browser/8581/1 "2023-12-08T13:35:53Z")

</div>

Hi,

I’m new to D3 and started with the example “Zoomable-Sunburst” which is fiting perfect. The only issue I’ve got right now is the resizing in the browser. Even without any customization and implementation of the plain example the chart is not scaling while zooming in or out.  
Is there an easy way to implement this function or am I missing something?

Kind regards!

---

<div class="post-metadata">

### Author: ![mcmcclur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mcmcclur/32/2364_2.png) [@mcmcclur](https://talk.observablehq.com/u/mcmcclur)
#### Post date: [December 8, 2023, 1:56pm UTC](https://talk.observablehq.com/t/d3-js-not-resizing-in-browser/8581/2 "2023-12-08T13:56:34Z")

</div>

Perhaps you’re talking about this:

> **[Zoomable sunburst](https://observablehq.com/@d3/zoomable-sunburst)**
>
> This variant of a sunburst diagram shows only two layers of the hierarchy at a time. Click a node to zoom in, or the center to zoom out. Compare to an icicle.

That seems to scale quite well with browser resize. If you’ve forked that notebook and made some changes or if you’re working from a different example, then perhaps you could share your code?

---

<div class="post-metadata">

### Author: ![TDd](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@TDd](https://talk.observablehq.com/u/TDd)
#### Post date: [December 11, 2023, 8:04am UTC](https://talk.observablehq.com/t/d3-js-not-resizing-in-browser/8581/3 "2023-12-11T08:04:10Z")

</div>

Hi mcmcclur,

You’re totally right about “zoomable sunburst”. The example isn’t even resizing without any customization (download including the runnable). Maybe it is an issue about my browser (I tried Google Chrome and Firefox) or my webserver (Apache)?

Kind regards

---

<div class="post-metadata">

### Author: ![TDd](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@TDd](https://talk.observablehq.com/u/TDd)
#### Post date: [December 12, 2023, 11:33am UTC](https://talk.observablehq.com/t/d3-js-not-resizing-in-browser/8581/4 "2023-12-12T11:33:50Z")

</div>

Maybe it is because the example chart isn’t embedded into a certain html element like a div container?  
I already saw implementations which use d3.selected, but I don’t now how to make use of it in this example.
