Skip to content

Commit

Permalink
chore: Upgrade anywidget version (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt authored Feb 21, 2024
1 parent 80034e2 commit 50f941b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
24 changes: 12 additions & 12 deletions examples/Plugin.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@
"\n",
"class PileupTrack(hg.PluginTrack):\n",
" type: Literal[\"pileup\"]\n",
" plugin_url: ClassVar[\n",
" str\n",
" ] = \"https://unpkg.com/higlass-pileup/dist/higlass-pileup.min.js\"\n",
" plugin_url: ClassVar[str] = (\n",
" \"https://unpkg.com/higlass-pileup/dist/higlass-pileup.min.js\"\n",
" )\n",
"\n",
"\n",
"hg.Viewconf[Union[PileupTrack, hg.Track]](**config) # works!"
Expand Down Expand Up @@ -217,9 +217,9 @@
" \"horizontal-stacked-bar\",\n",
" \"basic-multiple-bar-chart\",\n",
" ]\n",
" plugin_url: ClassVar[\n",
" str\n",
" ] = \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\""
" plugin_url: ClassVar[str] = (\n",
" \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\"\n",
" )"
]
},
{
Expand Down Expand Up @@ -279,9 +279,9 @@
" \"horizontal-stacked-bar\",\n",
" \"basic-multiple-bar-chart\",\n",
" ]\n",
" plugin_url: ClassVar[\n",
" str\n",
" ] = \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\"\n",
" plugin_url: ClassVar[str] = (\n",
" \"https://unpkg.com/higlass-multivec/dist/higlass-multivec.min.js\"\n",
" )\n",
"\n",
"\n",
"track = MultivecTrack(\n",
Expand Down Expand Up @@ -360,9 +360,9 @@
"class SequenceTrack(hg.PluginTrack):\n",
" type: Literal[\"horizontal-sequence\"]\n",
" data: Optional[SeqeuenceTrackData] = None\n",
" plugin_url: ClassVar[\n",
" str\n",
" ] = \"https://unpkg.com/higlass-sequence/dist/higlass-sequence.js\"\n",
" plugin_url: ClassVar[str] = (\n",
" \"https://unpkg.com/higlass-sequence/dist/higlass-sequence.js\"\n",
" )\n",
"\n",
"\n",
"track = SequenceTrack(\n",
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ readme = "README.md"
dependencies = [
"servir>=0.0.5",
"higlass-schema>=0.0.6",
"anywidget>=0.6.3",
"anywidget>=0.9.0",
"jinja2",
"jupyter-server-proxy>=3.0",
"typing-extensions ; python_version<'3.9'",
Expand Down Expand Up @@ -74,6 +74,7 @@ test = "pytest ."

[tool.hatch.envs.docs]
features = ["docs"]
python = "3.11"

[tool.hatch.envs.docs.scripts]
build = "sphinx-build -b html ./docs ./docs/_build/html"
Expand Down
11 changes: 5 additions & 6 deletions src/higlass/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,18 +649,17 @@ class _TrackCreator(BaseModel):


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


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


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


def track(
Expand Down
4 changes: 3 additions & 1 deletion src/higlass/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function toPts({ xDomain, yDomain }) {
return [x, xe, y, ye];
}

export async function render({ model, el }) {
async function render({ model, el }) {
let viewconf = model.get("_viewconf");
let options = model.get("_options") ?? {};
let api = await hglib.viewer(el, viewconf, options);
Expand All @@ -39,3 +39,5 @@ export async function render({ model, el }) {
});
}
}

export default { render };

0 comments on commit 50f941b

Please sign in to comment.