Skip to content

Commit ebf00cb

Browse files
authored
[GH-2002] Add params to KeplerGl constructor (#2003)
1 parent 41dedfc commit ebf00cb

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

python/sedona/spark/maps/SedonaKepler.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,25 @@
2222
class SedonaKepler:
2323

2424
@classmethod
25-
def create_map(cls, df=None, name="unnamed", config=None):
25+
def create_map(
26+
cls,
27+
df=None,
28+
name="unnamed",
29+
config=None,
30+
height=600,
31+
use_arrow=False,
32+
show_docs=False,
33+
):
2634
"""
2735
Creates a map visualization using kepler, optionally taking a sedona dataFrame as data input
2836
:param df: [Optional] SedonaDataFrame to plot on the map
2937
:param name: [Optional] Name to be associated with the given
3038
dataframe, if a df is passed with no name, a default name of 'unnamed' is set for it.
31-
param config: [Optional] A map config to be applied to the rendered map :return: A map object
39+
param config: [Optional] A map config to be applied to the rendered map
40+
param height: [Optional] Height of the map in pixels, default is 600
41+
param use_arrow: [Optional] Whether to use arrow for data transfer, default is False
42+
param show_docs: [Optional] Whether to show the documentation, default is False
43+
:return: A map object
3244
"""
3345

3446
try:
@@ -37,7 +49,7 @@ def create_map(cls, df=None, name="unnamed", config=None):
3749
msg = "Install apache-sedona[kepler-map] to convert sedona dataframes to kepler maps."
3850
raise ImportError(msg) from None
3951

40-
kepler_map = KeplerGl()
52+
kepler_map = KeplerGl(height=height, use_arrow=use_arrow, show_docs=show_docs)
4153
if df is not None:
4254
SedonaKepler.add_df(kepler_map, df, name)
4355

0 commit comments

Comments
 (0)