Skip to content

Commit

Permalink
Notebook API (#38)
Browse files Browse the repository at this point in the history
* Notebook API

* Make CSS part of the package exposed styling

* Update test

* Make the JSON path relative to the jGIS file

* Fix example accordingly

* Fix test

* Iterate

* Iterate

* Iterate

* Add comment

* Fix initial map rendering in the case of the notebook renderer

* Update notebook

* Remove logs

* Update Playwright Snapshots

* Sleep a bit

* Linter

* Debug

* Update Playwright Snapshots

* Apply suggestions from code review

Co-authored-by: David Brochart <david.brochart@gmail.com>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Brochart <david.brochart@gmail.com>
  • Loading branch information
3 people authored Jul 12, 2024
1 parent 9d538db commit 49ede6e
Show file tree
Hide file tree
Showing 19 changed files with 6,433 additions and 205 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ jobs:
- name: Execute integration tests
shell: bash -l {0}
working-directory: ui-tests
run: |
npx playwright test
run: npx playwright test

- name: Upload Playwright Test report
if: always()
Expand Down
31 changes: 28 additions & 3 deletions examples/Notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,43 @@
"metadata": {},
"outputs": [],
"source": [
"doc = GISDocument()"
"doc = GISDocument(\"france_hiking.jGIS\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a0314dc6-9d79-4361-8b86-60b84f543cf9",
"id": "f4a7000c-1bfc-4d41-8a0b-5c82c6e67716",
"metadata": {},
"outputs": [],
"source": [
"doc"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5938ba70-36d7-4af3-b877-815464ef6d1a",
"metadata": {},
"outputs": [],
"source": [
"doc.add_raster_layer(\n",
" url=\"https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}\",\n",
" name=\"Google Satellite\",\n",
" attribution=\"Google\",\n",
" opacity=0.6\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "69ac2a9a-d9a9-4170-b1f5-451b9fd5780e",
"metadata": {},
"outputs": [],
"source": [
"doc.add_geojson_layer(path=\"france_regions.json\")"
]
}
],
"metadata": {
Expand All @@ -63,7 +88,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/test.jGIS
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"7d082e75-69d5-447a-82d8-b05cca5945ba": {
"name": "france_regions",
"parameters": {
"path": "examples/france_regions.json",
"path": "france_regions.json",
"valid": true
},
"type": "GeoJSONSource"
Expand Down Expand Up @@ -76,4 +76,4 @@
]
}
]
}
}
Loading

0 comments on commit 49ede6e

Please sign in to comment.