Broken notebook

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!

Thanks.

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.

@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.

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

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

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

to specifically tell the runtime you have updated the ā€˜valueā€™ and not the container reference

1 Like

Thatā€™s it! I would have never seen that without your help. Thanks!

1 Like

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

Hi sorry. I donā€™t have any spare cycles at the moment.