Skip to content

Commit

Permalink
change test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nour-Cheour10 committed Jun 21, 2024
1 parent bb984f4 commit 5014d8d
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 43 deletions.
5 changes: 2 additions & 3 deletions css/widget.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.ol-container {
width: 656px;
height: 501px;
height: 100%;
width: 100%;
}


.lm-Widget.lm-Panel.jp-OutputArea-child.jp-OutputArea-executeResult{
height: 100%;
overflow: hidden;
Expand Down
87 changes: 57 additions & 30 deletions examples/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -27,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -36,21 +36,21 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b1420e7257914c8fbed42bf08d8a271c",
"model_id": "dc3736c5c5a74c328c5cef67d731c118",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[0.0, 0.0], zoom=4.0)"
]
},
"execution_count": 26,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -61,16 +61,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"4.0"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m.zoom"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -80,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -91,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -100,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -112,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -124,7 +135,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -135,16 +146,32 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3151fa5f451f47a091eef3837b111bbe",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[0.0, 0.0], controls=[ZoomSlider(), ScaleLine(), MousePosition(), FullScreen()], layers=[TileLayer(…"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -153,7 +180,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -162,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -173,7 +200,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -182,7 +209,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -193,7 +220,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -203,7 +230,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -212,7 +239,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -223,7 +250,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -232,7 +259,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -243,7 +270,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -252,7 +279,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -261,7 +288,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -297,7 +324,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
Expand Down
7 changes: 0 additions & 7 deletions src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ export class MapView extends DOMWidgetView {
this.mapContainer = document.createElement('div');
this.mapContainer.className = 'ol-container';
this.el.appendChild(this.mapContainer);
requestAnimationFrame(() => {
console.log(
'Map container dimensions after render:',
this.mapContainer.offsetWidth,
this.mapContainer.offsetHeight,
);
});
this.layerViews = new ViewList(
this.addLayerModel,
this.removeLayerView,
Expand Down
10 changes: 7 additions & 3 deletions ui-tests/tests/ipyopenlayers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ const testPlotUpdates = async (page: IJupyterLabPageFixture, tmpPath: string, th
await page.notebook.runCellByCell({
onAfterCellRun: async (cellIndex: number) => {
await page.waitForTimeout(1000); // Ajouter un délai pour la stabilisation du rendu
// Always get first cell output which must contain the plot

// Capturer toujours la première sortie de cellule qui doit contenir le graphique
const cell = await page.notebook.getCellOutput(0);
if (cell) {
results.push(await cell.screenshot());
cellCount++;
const box = await cell.boundingBox(); // Obtenir la boîte englobante de la cellule
if (box) {
results.push(await page.screenshot({ clip: box })); // Capturer l'écran avec clip: box
cellCount++;
}
}
}
});
Expand Down

0 comments on commit 5014d8d

Please sign in to comment.