Skip to content

Commit

Permalink
[Jupyter] Make showing User Guide link optional for jupyter widget (#…
Browse files Browse the repository at this point in the history
…1559)

* Make show User Guide link optional for jupyter
* Updated README with shows_docs parameter

Signed-off-by: Qiusheng Wu <giswqs@gmail.com>
  • Loading branch information
giswqs committed Jul 29, 2021
1 parent 5985d20 commit 089bb7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bindings/kepler.gl-jupyter/keplergl/keplergl.py
Expand Up @@ -100,8 +100,12 @@ class KeplerGl(widgets.DOMWidget):
height = Int(400).tag(sync=True)

def __init__(self, **kwargs):
if 'show_docs' not in kwargs:
kwargs['show_docs'] = True
if kwargs['show_docs']:
print('User Guide: {}'.format(documentation))
kwargs.pop('show_docs')
super(KeplerGl, self).__init__(**kwargs)
print('User Guide: {}'.format(documentation))

@validate('data')
def _validate_data(self, proposal):
Expand Down
6 changes: 6 additions & 0 deletions docs/keplergl-jupyter/README.md
Expand Up @@ -75,8 +75,13 @@ $ jupyter labextension install @jupyter-widgets/jupyterlab-manager keplergl-jupy
Datasets as a dictionary, key is the name of the dataset. Read more on [Accepted data format][data_format]

- __`config`__ `dict` _optional_

Map config as a dictionary. The `dataId` in the layer and filter settings should match the `name` of the dataset they are created under

- __`show_docs`__ `bool` _optional_

By default, the User Guide URL (<https://docs.kepler.gl/docs/keplergl-jupyter>) will be printed when a map is created. To hide the User Guide URL, set `show_docs=False`.

The following command will load kepler.gl widget below a cell.
**The map object created here is `map_1` it will be used throughout the code example in this doc.**

Expand All @@ -90,6 +95,7 @@ map_1

![empty map][empty_map]


You can also create the map and pass in the data or data and config at the same time. Follow the instruction to [match config with data][match-config-w-data]

```python
Expand Down

0 comments on commit 089bb7a

Please sign in to comment.