4

I'm trying to figure out why my map can't be rendered on nbviewer

e.g. https://nbviewer.jupyter.org/github/zyxue/scratch/blob/master/display-kepler.ipynb?flush_cache=true

I've compared the network activities between nbviewer (left) and jupyter notebook environment (right), still can't figure out why

enter image description here

reference: https://github.com/keplergl/kepler.gl/blob/master/docs/keplergl-jupyter/user-guide.md

zyxue
  • 7,904
  • 5
  • 48
  • 74

1 Answers1

0

It is because nbviewer can't render dynamic js or css. The same is with github.
You can visit issues and see the trail comments for dynamic support. As of writing this answer this has not been solved.

If you want to show the dynamic graphs, then you can save notebook widget state (as in the picture) and then save it as markdown. Then you can render it in github. Here is another example uncertainty quantification.

enter image description here

ASHu2
  • 2,027
  • 15
  • 29
  • 2
    why plotly works interactively then as in this [example notebook](https://nbviewer.jupyter.org/github/zyxue/scratch/blob/master/display-plotly.ipynb)? – zyxue Sep 17 '19 at 16:20
  • I tried "Save Notebook Widget State", it does save some [new stuff](https://github.com/zyxue/scratch/commit/c255893579ba78c02737f6f0f48f5cab1b0e5098?diff=split#diff-c91f44fd5244f8cd54bf6a977b844f0eR120-R194), but still doesn't appear to work. Also tried converting to [markdown](https://github.com/zyxue/scratch/blob/master/display-kepler.md), but it doesn't seem to work. – zyxue Sep 17 '19 at 16:23
  • you can see in the `view page source` in your browser this is not dynamic. The values are stored. – ASHu2 Sep 18 '19 at 03:50
  • save widget state wont also render the graphs. You need to use markdown to render it in github.io. – ASHu2 Sep 18 '19 at 03:52
  • what do you mean by `dynamic`? could you show me an example of making the kepler map show up? – zyxue Sep 18 '19 at 04:59
  • nope! go to [this](https://kepler.gl/demo/movement_pittsburgh) link and download the html. Turn your internet off and try opening the html, it won't load. This is dynamic. The json in the html will need to get data in real time. This is what github or nbviewer can't do. There are many reasons...it would consume lots of resources and also for security reasons, they won't know what the code is doing. Atleast right now we don't have that option. – ASHu2 Sep 20 '19 at 04:25