observablehq / examples

Examples of using Observable in a variety of contexts
106 stars 33 forks source link

render new data #15

Closed tomosnam closed 3 years ago

tomosnam commented 3 years ago

For dynamic data (api) the sunburst does not show the new data.

mbostock commented 3 years ago

Hi @tomosnam. When you say that the sunburst does not show the new data, do you mean that you reload the page and you’re seeing stale data, or that you want to stream live data into the sunburst?

If you’re seeing stale data after changing the contents of flare.json, it’s likely because your browser has the old data cached. A shift-reload or clearing your browser cache should fix this problem. If you’d like to point the sunburst at a different dataset, you can either edit the downloaded fileAttachments map, or see the custom-data example.

If you’d like to stream live data into your chart, see the custom-live-data example for how to define your data as a generator. Alternatively, you can call module.redefine repeatedly to change the data shown in the chart as shown in the react-dataflow example. Good luck and let us know if you have more questions!