I'm using kepler.gl to create some geographical plots.
I want to create some setting for the plot and than set these as default for when I run the cell containing that plot.
These are the steps:
- I copied the
conf
from Kepler.gl website from Share>Share Map> Map Config. - I pasted the copied text to my python notebook cell in the variable
conf
conf = {. . .} # copied from the website after setting the correct visualization
- I replaced all true with True, false with False etc.
- In the notebook I created a map and set the config
from keplergl import KeplerGl
import json
map1 = KeplerGl()
map1.add_data(data=gpd.read_file('my.geojson'), name='name1')
map1.config = conf
- I modified the label property in
conf
so that it would be equal to the name property inside theadd_data
function
Finally when I show the plot using
map1
It shows a basic plot of my geojson without any of the configurations in conf
.
NB.
The geojson file I uploaded in Kepler.gl is the same file I used in KeplerGL() python function
I read online that it can be due to the IDs of the datasets but I don't understand how to make those IDs the same since I'm using the same dataset.
Here's the documentation, personally I didn't manage to find the answer to my question in there but maybe there is and I didn't understand it.
You need to pass the value of the
name
that you define in themap1.add_data()
to thedataId
property (instead of thelabel
) of your config.So in your exapmpe:
Important: Depending on your style settings the field
"dataId"
might exist more than once. You need to replace the value of all instances.