keplergl / keplergl/kepler.gl

[Bug][Jupyter Widget]

Open
#2,971 0 comments 0 reactions 1 assignee Claimed by @heshan0131 View on GitHub
jupyter
Dominant language
TypeScript
Stars
12k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
66

Description

Config on jupiter notebook doesnt work corectly for all parametrs,especially for "colorField"
Only works for "fields to show parametr"

config={
"version": "v1",
"config": {
"visState": {
"filters": [],
"layers": [
{
"id": "data_1",
"type": "geojson",
"config": {
"dataId": ["data_1"],
"columnMode": "geojson",
"label": "data_1",
"color": [
248,
149,
112
],
"highlightColor": [
252,
242,
26,
255
],
"columns": {
"geojson": "_geojson"
},
"isVisible": True,
"visConfig": {
"opacity": 0.8,
"strokeOpacity": 0.8,
"thickness": 0.5,
"strokeColor": [
130,
154,
227
],
"colorRange": {
"name": "Global Warming",
"type": "sequential",
"category": "Uber",
"colors": [
"#4C0035",
"#880030",
"#B72F15",
"#D6610A",
"#EF9100",
"#FFC300"
]
},
"strokeColorRange": {
"name": "Global Warming",
"type": "sequential",
"category": "Uber",
"colors": [
"#4C0035",
"#880030",
"#B72F15",
"#D6610A",
"#EF9100",
"#FFC300"
]
},
"radius": 10,
"sizeRange": [
0,
10
],
"radiusRange": [
0,
50
],
"heightRange": [
0,
500
],
"elevationScale": 5,
"stroked": True,
"filled": True,
"enable3d": False,
"wireframe": False,
"fixedHeight": False
},
"hidden": False,
"textLabel": [
{
"field": None,
"color": [
255,
255,
255
],
"size": 18,
"offset": [
0,
0
],
"anchor": "start",
"alignment": "center",
"outlineWidth": 0,
"outlineColor": [
255,
0,
0,
255
],
"background": False,
"backgroundColor": [
0,
0,
200,
255
]
}
]
},
"visualChannels": {
"colorField": {
"name": "value_air",
"type": "integer"
},
"colorScale": "quantile",
"strokeColorField": None,
"strokeColorScale": "quantile",
"sizeField": None,
"sizeScale": "linear",
"heightField": None,
"heightScale": "linear",
"radiusField": None,
"radiusScale": "linear"
}
}
],
"effects": [],
"interactionConfig": {
"tooltip": {
"fieldsToShow": {
"data_1": [
{
"name": "name:ru",
"format": None
},
{
"name": "value_air",
"format": None
}
]
},
"compareMode": False,
"compareType": "absolute",
"enabled": True
},
"brush": {
"size": 0.5,
"enabled": False
},
"geocoder": {
"enabled": False
},
"coordinate": {
"enabled": False
}
},
"layerBlending": "normal",
"overlayBlending": "normal",
"splitMaps": [],
"animationConfig": {
"currentTime": None,
"speed": 1
},
"editor": {
"features": [],
"visible": True
}
},
"mapState": {
"bearing": 0,
"dragRotate": False,
"latitude": 43.222016880910616,
"longitude": 76.86878275993097,
"pitch": 0,
"zoom": 9.533473729586555,
"isSplit": False,
"isViewportSynced": True,
"isZoomLocked": False,
"splitMapViewports": []
},
"mapStyle": {
"styleType": "dark-matter",
"topLayerGroups": {},
"visibleLayerGroups": {
"label": True,
"road": True,
"border": False,
"building": True,
"water": True,
"land": True,
"3d building": False
},
"threeDBuildingColor": [
15.035172933000911,
15.035172933000911,
15.035172933000911
],
"backgroundColor": [
0,
0,
0
],
"mapStyles": {}
},
"uiState": {
"mapControls": {
"mapLegend": {
"active": False
}
}
}
}
}


# pip install keplergl

# pip install geopandas

import geopandas as gpd

# Чтение GeoJSON файла
df = gpd.read_file('алмата-сегодня.geojson')

# Load a map with data and config and height
from keplergl import KeplerGl
map_1 = KeplerGl(height=600, data={'data_1': df}, name='data_1', config=config)
# map_2 = KeplerGl(height=400, data={"data_2": df2})

# map_2

# Добавление данных
# map_1.add_data(data=df, name='data_1')
# map_1.config=config
# map_1.add_data(data=df2, name='data_2')

# Применение конфигурации
# map_1.config = config
# map_2.config = config

# Отображение карты
map_1.config
map_1
# map_2

**Expected behavior**
Map must show different colors depending on value_air parametr
However it stays same color

**Screenshots**

![Image](https://github.com/user-attachments/assets/5c502d1a-5014-4580-8704-c0ae61e25ea1)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.