Open digitalkoine opened 1 year ago
Hey friend,
Try to use fastapi.
` from fastapi import FastAPI from fastapi.responses import HTMLResponse
kepler_map = KeplerGl(config=shared.config, data={"[your_data_ID]": df}) kepler_html = kepler_map._reprhtml()
`
Good evening,
Thank you for you quick answer. I never used FastAPI and I don't really know how to use it.
I used to work with the online version of Kepler, which is awesome for bachelor's students. Before when you exported a map in html to save it it worked, since some few months it doesn't work anymore. Do you have any tutorial or suggestion in order to solve this? Kepler was a big part of my teaching for students are not able to manage coding.
Best, Giovanni
Hey no problem at all.
Check this link. https://betterprogramming.pub/geo-data-visualization-with-kepler-gl-fbc15debbca4
You want to install some kind of python environment, like anaconda, and them you will do $ pip install keplergl
If you follow the instructions on the article I shared you will have a web service (fastapi) with the rendered html. Double check if your json config is working fine. Anything, just reach me here or via email: fillfeitosa@gmail.com
By the way. What is the bachelor you lecture? Urban planning, GIS?
It seems that Kepler.gl/demo is exporting the HTML with @3.0.0-alpha version of kepler which is not available on the CDN.
Changing to the last available version (2.5.5) did not work.
https://unpkg.com/kepler.gl@3.0.0-alpha.0/umd/keplergl.min.js
Hi everyone, I am experiencing the same problem as the exported html file of a map created with kelper.gl is not visible even locally in the browser. I have also tried to use the required token, but it does not feel like anything has changed at all. Any idea why?
Hi, I'm also having this issue.
I'm using the desktop version, when I try to export my map to html it downloads an html file (which is not empty) but when opening up the file it is blank (just a white screen).
I tried this and experienced the same issue. Looking at the html, it looks like there is a placeholder where there should be code, namely:
div id="app" !-- Kepler.gl map will be placed here-- /div
I removed the < and > so this would display properly.
I also see the following errors on the console: Failed to load resource: the server responded with a status of 404 () kepler.gl.html:1 Refused to execute script from 'https://unpkg.com/kepler.gl@3.0.0-alpha.0/umd/keplergl.min.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled. kepler.gl..html:99 Uncaught ReferenceError: KeplerGl is not defined at TAC.html:99:20 kepler.gl..html:225 Uncaught ReferenceError: KeplerGl is not defined at TAC.html:225:13
Going to the unpkg url, I see: Cannot find package kepler.gl@3.0.0-alpha.0
A quick fix is to change that link to the last stable version. So open the html in an editor like vi and change the link as follows.
Thanks @philipm9 that did the trick.
Hi @AlbertoMCS , I changed the suggested script, but still it doesn't work. Did you change anything else, especially in the following part?
div id="app" !-- Kepler.gl map will be placed here-- /div
Thanks in advance.
Hi @oltipreka I exported as html from Kepler and the only thing I changed was the link it had by this one: "https://unpkg.com/kepler.gl@2.4.0/umd/keplergl.min.js" No more changes
Thanks a lot. Unfortunately, I have tried this change in the html, but still it doesn't work. It only shows kepler.gl logo at the top left of the page.
@oltipreka This is the file that works on my end following the changes I mentioned. Try to open it and if it works have a look at it and see how this differs from your html files. index.zip
Hey @AlbertoMCS, very kind of you. Actually, the issue is with my mapbox token Thanks a lot !!!!
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.