# Broken notebook

**URL:** <https://talk.observablehq.com/t/broken-notebook/5776>\
**Category:** Help\
**Created:** [November 4, 2021, 10:31am UTC](https://talk.observablehq.com/t/broken-notebook/5776 "2021-11-04T10:31:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![john-b-clarke](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/john-b-clarke/32/5747_2.png) [@john-b-clarke](https://talk.observablehq.com/u/john-b-clarke)\
**Post date:** [November 4, 2021, 10:31am UTC](https://talk.observablehq.com/t/broken-notebook/5776/1 "2021-11-04T10:31:48Z")

</div>

I created these notebooks a while back and it appears to be broken now but with no errors. I have no idea where to start to find the problem. Any hints would be welcome!

> **[Montreal bed bug incidents over time: 2011-2018](https://observablehq.com/@john-clarke/montreal-bed-bug-incidents-over-time-2011-2018)**

> **[Montreal 311 incidents in 2016-2018](https://observablehq.com/@john-clarke/montreal-311-incidents-in-2016-2018/2)**
>
> Montreal is begining to open up its data. In this notebook, I was interested to try out a few techniques. But first I needed an interesting dataset, so I chose the 311 incidents (people can call the city for any complaint, comment, etc.)....

Thanks.

---

<div class="post-metadata">

**Author:** ![tomlarkworthy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tomlarkworthy/32/5940_2.png) [@tomlarkworthy](https://talk.observablehq.com/u/tomlarkworthy)\
**Post date:** [November 4, 2021, 10:42am UTC](https://talk.observablehq.com/t/broken-notebook/5776/2 "2021-11-04T10:42:58Z")

</div>

Do you know the side bar (on right) gives you a window into the dataflow, so you can try and use that to track down cells that are not running (grey bar on left)

For the first one I am suspicious that the current\_date is never set, for instance.

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

---

<div class="post-metadata">

**Author:** ![john-b-clarke](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/john-b-clarke/32/5747_2.png) [@john-b-clarke](https://talk.observablehq.com/u/john-b-clarke)\
**Post date:** [November 4, 2021, 10:49am UTC](https://talk.observablehq.com/t/broken-notebook/5776/3 "2021-11-04T10:49:39Z")

</div>

@tomlarkworthy thanks! Yes, I agree. That value is set in a closed function at the top of the notebook, but for some reason it doesn’t seem to be executing (it used to!) so the question is now, why isn’t it? I’m guessing that something changed in Observable the last year that broke this but not sure what that might be.

---

<div class="post-metadata">

**Author:** ![tomlarkworthy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tomlarkworthy/32/5940_2.png) [@tomlarkworthy](https://talk.observablehq.com/u/tomlarkworthy)\
**Post date:** [November 4, 2021, 11:00am UTC](https://talk.observablehq.com/t/broken-notebook/5776/4 "2021-11-04T11:00:29Z")

</div>

With { console.log(“running”) … } at the top of that cell I see it does not run. Why? with some bisection of deleting code I see the variable “map” is not resolved.

try typing just “map” in a cell

---

<div class="post-metadata">

**Author:** ![tomlarkworthy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tomlarkworthy/32/5940_2.png) [@tomlarkworthy](https://talk.observablehq.com/u/tomlarkworthy)\
**Post date:** [November 4, 2021, 11:06am UTC](https://talk.observablehq.com/t/broken-notebook/5776/5 "2021-11-04T11:06:56Z")

</div>

```auto
viewof map = {
  const container = html`<div style="height:650px;">`;
  
  yield container;

  const map = container.value = ...
}

```

You update the “value” after yielding the container. So when you yield the value is “undefined” which is like it has not run. So if you do another yield as the last statement in the block it will work or you can do

```auto
container.dispatchEvent(new Event('input', {bubbles: true}))

```

to specifically tell the runtime you have updated the ‘value’ and not the container reference

---

<div class="post-metadata">

**Author:** ![john-b-clarke](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/john-b-clarke/32/5747_2.png) [@john-b-clarke](https://talk.observablehq.com/u/john-b-clarke)\
**Post date:** [November 4, 2021, 11:10am UTC](https://talk.observablehq.com/t/broken-notebook/5776/6 "2021-11-04T11:10:57Z")

</div>

That’s it! I would have never seen that without your help. Thanks!

---

<div class="post-metadata">

**Author:** ![john-clarke](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/john-clarke/32/219_2.png) [@john-clarke](https://talk.observablehq.com/u/john-clarke)\
**Post date:** [March 17, 2022, 12:58pm UTC](https://talk.observablehq.com/t/broken-notebook/5776/7 "2022-03-17T12:58:34Z")

</div>

Hi Tom,  
I’m at this problem again – your solution worked fine. However, the “decay” functionality doesn’t work as it used to. The points should remain in the heatmap – IOW, not immediately disappear from the heatmap display. The timeout function with decay used to work well, but now no longer (since the fix). Do you have any ideas?  
FYI, I’m now working in the Humanitarian sector in Burkina Faso, and am trying to use this general map design to eventually map deaths of civilians in conflict areas as well as other events. But I’ve lost some of my agility to figure out the coding for this sort of thing. Any help would be much appreciated.

Ah… noticing some errors with leaflet.js. I’m looking into that. Don’t think that was the issue. Something in the time.scale functionality seems to have changed. If I manually set the duration, it works as expected. I’ll find out now why `delay(incident.treatment_finished) - delay(incident.declared);` is returning an unexpected negative value.

-John

---

<div class="post-metadata">

**Author:** ![tomlarkworthy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tomlarkworthy/32/5940_2.png) [@tomlarkworthy](https://talk.observablehq.com/u/tomlarkworthy)\
**Post date:** [March 21, 2022, 10:15pm UTC](https://talk.observablehq.com/t/broken-notebook/5776/8 "2022-03-21T22:15:33Z")

</div>

Hi sorry. I don’t have any spare cycles at the moment.
