This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
177 additions
and
18,001 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
Lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
- name: Check formatting with Black | ||
run: black --check . | ||
|
||
- name: Check linting with Ruff | ||
run: ruff . | ||
|
||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build | ||
run: python -m build . |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
Release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build | ||
run: python -m build . | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TWINE_API_KEY }} | ||
|
||
- run: npx changelogithub@0.12 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,8 @@ | ||
import sys | ||
|
||
from ._version import __version__ | ||
from .widget import HiGlassWidget | ||
import importlib.metadata | ||
|
||
try: | ||
if "google.colab" in sys.modules: | ||
from google.colab import output | ||
|
||
output.enable_custom_widget_manager() | ||
except ImportError: | ||
pass | ||
|
||
|
||
def _jupyter_labextension_paths(): | ||
return [{"src": "labextension", "dest": "higlass-widget"}] | ||
|
||
__version__ = importlib.metadata.version("higlass-widget") | ||
except importlib.metadata.PackageNotFoundError: | ||
__version__ = "unknown" | ||
|
||
def _jupyter_nbextension_paths(): | ||
return [ | ||
{ | ||
"section": "notebook", | ||
"src": "nbextension", | ||
"dest": "higlass-widget", | ||
"require": "higlass-widget/extension", | ||
} | ||
] | ||
from .widget import HiGlassWidget # noqa |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import hglib from "https://esm.sh/higlass@1.12?deps=react@17,react-dom@17,pixi.js@6" | ||
|
||
/** | ||
* @param {{ | ||
* xDomain: [number, number], | ||
* yDomain: [number, number], | ||
* }} location | ||
*/ | ||
function toPts({ xDomain, yDomain }) { | ||
let [x, xe] = xDomain; | ||
let [y, ye] = yDomain; | ||
return [x, xe, y, ye]; | ||
} | ||
|
||
export async function render(view) { | ||
let viewconf = JSON.parse(view.model.get("_viewconf")); | ||
let api = await hglib.viewer(view.el, viewconf); | ||
|
||
view.model.on("msg:custom", (msg) => { | ||
msg = JSON.parse(msg); | ||
let [fn, ...args] = msg; | ||
api[fn](...args); | ||
}); | ||
|
||
if (viewconf.views.length === 1) { | ||
api.on("location", (loc) => { | ||
view.model.set("location", toPts(loc)); | ||
view.model.save_changes(); | ||
}, viewconf.views[0].uid); | ||
} else { | ||
viewconf.views.forEach((view, idx) => { | ||
api.on("location", (loc) => { | ||
let copy = view.model.get("location").slice(); | ||
copy[idx] = toPts(loc); | ||
view.model.set("location", copy); | ||
view.model.save_changes(); | ||
}, view.uid); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.