KeplerLayer#

Configuration class for Kepler.gl visualization layers.

class graphistry.kepler.KeplerLayer(raw_dict)#

Bases: object

Configure a Kepler.gl visualization layer.

Creates a layer configuration using native Kepler.gl format. Layers define how datasets are visualized on the map (points, arcs, hexbins, etc.). This class accepts only raw dictionary format for now.

Parameters:

raw_dict (Dict[str, Any]) – Native Kepler.gl layer configuration dictionary

Example: Point layer
from graphistry import KeplerLayer

layer = KeplerLayer({
    "id": "cities",
    "type": "point",
    "config": {
        "dataId": "companies",
        "label": "Company Locations",
        "columns": {"lat": "latitude", "lng": "longitude"},
        "color": [255, 140, 0],
        "visConfig": {"radius": 10, "opacity": 0.8}
    }
})
Example: Arc layer for connections
layer = KeplerLayer({
    "id": "connections",
    "type": "arc",
    "config": {
        "dataId": "relationships",
        "columns": {
            "lat0": "edgeSourceLatitude",
            "lng0": "edgeSourceLongitude",
            "lat1": "edgeTargetLatitude",
            "lng1": "edgeTargetLongitude"
        },
        "color": [0, 200, 255],
        "visConfig": {"opacity": 0.3, "thickness": 2}
    }
})
Example: Hexagon aggregation
layer = KeplerLayer({
    "id": "density",
    "type": "hexagon",
    "config": {
        "dataId": "events",
        "columns": {"lat": "latitude", "lng": "longitude"},
        "visConfig": {
            "worldUnitSize": 1,
            "elevationScale": 5,
            "enable3d": True
        }
    }
})
to_dict()#

Serialize to dictionary format for Kepler.gl.

Return type:

Dict[str, Any]

Note

KeplerLayer accepts only native Kepler.gl layer dictionaries via the raw_dict parameter. For the complete layer format reference including all layer types and configuration options, see Kepler.gl Layer Format.

See Also#