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:
conf
from Kepler.gl website from Share>Share Map> Map Config.conf
conf = {. . .} # copied from the website after setting the correct visualization
from keplergl import KeplerGl
import json
map1 = KeplerGl()
map1.add_data(data=gpd.read_file('my.geojson'), name='name1')
map1.config = conf
conf
so that it would be equal to the name property inside the add_data
functionFinally 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 the
map1.add_data()
to the dataId
property (instead of the label
) of your config.
So in your exapmpe:
"dataId": ["name1"]
💡Important: Depending on your style settings the field "dataId"
might exist more than once. You need to replace the value of all instances.