Skip to content

Commit

Permalink
Fix Chartlets version and test
Browse files Browse the repository at this point in the history
  • Loading branch information
b-yogesh committed Jan 21, 2025
1 parent f1b3c3d commit c9e534b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 61 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [
"cftime>=1.6.3",
"click>=8.0",
"cmocean>=2.0",
"chartlets>=0.0.28,<0.1.0",
"chartlets>=0.1.0",
"dask>=2021.6",
"dask-image>=0.6",
"deprecated>=1.2",
Expand Down
114 changes: 54 additions & 60 deletions test/webapi/viewer/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,147 +187,141 @@ def test_viewer_ext_callback(self):
}

expected_contributions_result = {
"extensions": [{"name": "my_ext", "version": "0.0.0", "contributes": ["panels"]}],
"contributions": {
"panels": [
{
"name": "my_ext.my_panel_a",
"initialState": {"visible": False, "title": "Panel A"},
"extension": "my_ext",
"layout": {
"function": {
"name": "render_panel",
"parameters": [
{
"name": "dataset_id",
"schema": {"type": "string"},
"default": "",
}
],
"return": {"schema": {"type": "object", "class": "Component"}},
},
"inputs": [
{
"id": "@app",
"property": "selectedDatasetId",
"noTrigger": True,
}
],
},
"callbacks": [
{
"function": {
"name": "update_info_text",
"parameters": [
{
"default": "",
"name": "dataset_id",
"type": {"type": "string"},
"schema": {"type": "string"},
"default": "",
},
{
"default": False,
"name": "opaque",
"type": {"type": "boolean"},
"schema": {"type": "boolean"},
"default": False,
},
{
"default": 0,
"name": "color",
"type": {"type": "integer"},
"schema": {"type": "integer"},
"default": 0,
},
{
"default": "",
"name": "info_text",
"type": {"type": "string"},
"schema": {"type": "string"},
"default": "",
},
],
"returnType": {"type": "string"},
"return": {"schema": {"type": "string"}},
},
"inputs": [
{
"id": "@app",
"property": "selectedDatasetId",
},
{"id": "@app", "property": "selectedDatasetId"},
{"id": "opaque", "property": "value"},
{"id": "color", "property": "value"},
{
"id": "info_text",
"noTrigger": True,
"property": "text",
"noTrigger": True,
},
],
"outputs": [{"id": "info_text", "property": "text"}],
}
],
},
{
"name": "my_ext.my_panel_b",
"initialState": {"visible": False, "title": "Panel B"},
"extension": "my_ext",
"initialState": {"title": "Panel A", "visible": False},
"layout": {
"function": {
"name": "render_panel",
"parameters": [
{
"default": "",
"name": "dataset_id",
"type": {"type": "string"},
"schema": {"type": "string"},
"default": "",
}
],
"returnType": {"class": "Component", "type": "object"},
"return": {"schema": {"type": "object", "class": "Component"}},
},
"inputs": [
{
"id": "@app",
"noTrigger": True,
"property": "selectedDatasetId",
"noTrigger": True,
}
],
},
"name": "my_ext.my_panel_a",
},
{
"callbacks": [
{
"function": {
"name": "update_info_text",
"parameters": [
{
"default": "",
"name": "dataset_id",
"type": {"type": "string"},
"schema": {"type": "string"},
"default": "",
},
{
"default": False,
"name": "opaque",
"type": {"type": "boolean"},
"schema": {"type": "boolean"},
"default": False,
},
{
"default": 0,
"name": "color",
"type": {"type": "integer"},
"schema": {"type": "integer"},
"default": 0,
},
{
"default": "",
"name": "info_text",
"type": {"type": "string"},
"schema": {"type": "string"},
"default": "",
},
],
"returnType": {"type": "string"},
"return": {"schema": {"type": "string"}},
},
"inputs": [
{
"id": "@app",
"property": "selectedDatasetId",
},
{"id": "@app", "property": "selectedDatasetId"},
{"id": "opaque", "property": "value"},
{"id": "color", "property": "value"},
{
"id": "info_text",
"noTrigger": True,
"property": "text",
"noTrigger": True,
},
],
"outputs": [{"id": "info_text", "property": "text"}],
}
],
"extension": "my_ext",
"initialState": {"title": "Panel B", "visible": False},
"layout": {
"function": {
"name": "render_panel",
"parameters": [
{
"default": "",
"name": "dataset_id",
"type": {"type": "string"},
}
],
"returnType": {"class": "Component", "type": "object"},
},
"inputs": [
{
"id": "@app",
"noTrigger": True,
"property": "selectedDatasetId",
}
],
},
"name": "my_ext.my_panel_b",
},
]
},
"extensions": [{"contributes": ["panels"], "name": "my_ext", "version": "0.0.0"}],
}

0 comments on commit c9e534b

Please sign in to comment.