Skip to content

Commit 50f941b

Browse files
authored
chore: Upgrade anywidget version (#143)
1 parent 80034e2 commit 50f941b

4 files changed

Lines changed: 22 additions & 20 deletions

File tree

examples/Plugin.ipynb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@
163163
"\n",
164164
"class PileupTrack(hg.PluginTrack):\n",
165165
" type: Literal[\"pileup\"]\n",
166-
" plugin_url: ClassVar[\n",
167-
" str\n",
168-
" ] = \"https://unpkg.com/higlass-pileup/dist/higlass-pileup.min.js\"\n",
166+
" plugin_url: ClassVar[str] = (\n",
167+
" \"https://unpkg.com/higlass-pileup/dist/higlass-pileup.min.js\"\n",
168+
" )\n",
169169
"\n",
170170
"\n",
171171
"hg.Viewconf[Union[PileupTrack, hg.Track]](**config) # works!"
@@ -217,9 +217,9 @@
217217
" \"horizontal-stacked-bar\",\n",
218218
" \"basic-multiple-bar-chart\",\n",
219219
" ]\n",
220-
" plugin_url: ClassVar[\n",
221-
" str\n",
222-
" ] = \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\""
220+
" plugin_url: ClassVar[str] = (\n",
221+
" \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\"\n",
222+
" )"
223223
]
224224
},
225225
{
@@ -279,9 +279,9 @@
279279
" \"horizontal-stacked-bar\",\n",
280280
" \"basic-multiple-bar-chart\",\n",
281281
" ]\n",
282-
" plugin_url: ClassVar[\n",
283-
" str\n",
284-
" ] = \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\"\n",
282+
" plugin_url: ClassVar[str] = (\n",
283+
" \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\"\n",
284+
" )\n",
285285
"\n",
286286
"\n",
287287
"track = MultivecTrack(\n",
@@ -360,9 +360,9 @@
360360
"class SequenceTrack(hg.PluginTrack):\n",
361361
" type: Literal[\"horizontal-sequence\"]\n",
362362
" data: Optional[SeqeuenceTrackData] = None\n",
363-
" plugin_url: ClassVar[\n",
364-
" str\n",
365-
" ] = \"https://unpkg.com/higlass-sequence/dist/higlass-sequence.js\"\n",
363+
" plugin_url: ClassVar[str] = (\n",
364+
" \"https://unpkg.com/higlass-sequence/dist/higlass-sequence.js\"\n",
365+
" )\n",
366366
"\n",
367367
"\n",
368368
"track = SequenceTrack(\n",

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ readme = "README.md"
2828
dependencies = [
2929
"servir>=0.0.5",
3030
"higlass-schema>=0.0.6",
31-
"anywidget>=0.6.3",
31+
"anywidget>=0.9.0",
3232
"jinja2",
3333
"jupyter-server-proxy>=3.0",
3434
"typing-extensions ; python_version<'3.9'",
@@ -74,6 +74,7 @@ test = "pytest ."
7474

7575
[tool.hatch.envs.docs]
7676
features = ["docs"]
77+
python = "3.11"
7778

7879
[tool.hatch.envs.docs.scripts]
7980
build = "sphinx-build -b html ./docs ./docs/_build/html"

src/higlass/api.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -649,18 +649,17 @@ class _TrackCreator(BaseModel):
649649

650650

651651
@overload
652-
def track(type_: hgs.EnumTrackType, uid: str | None = None, **kwargs) -> EnumTrack:
653-
...
652+
def track(type_: hgs.EnumTrackType, uid: str | None = None, **kwargs) -> EnumTrack: ...
654653

655654

656655
@overload
657-
def track(type_: Literal["heatmap"], uid: str | None = None, **kwargs) -> HeatmapTrack:
658-
...
656+
def track(
657+
type_: Literal["heatmap"], uid: str | None = None, **kwargs
658+
) -> HeatmapTrack: ...
659659

660660

661661
@overload
662-
def track(type_: str, uid: str | None = None, **kwargs) -> PluginTrack:
663-
...
662+
def track(type_: str, uid: str | None = None, **kwargs) -> PluginTrack: ...
664663

665664

666665
def track(

src/higlass/widget.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function toPts({ xDomain, yDomain }) {
1212
return [x, xe, y, ye];
1313
}
1414

15-
export async function render({ model, el }) {
15+
async function render({ model, el }) {
1616
let viewconf = model.get("_viewconf");
1717
let options = model.get("_options") ?? {};
1818
let api = await hglib.viewer(el, viewconf, options);
@@ -39,3 +39,5 @@ export async function render({ model, el }) {
3939
});
4040
}
4141
}
42+
43+
export default { render };

0 commit comments

Comments
 (0)