Skip to content

Commit

Permalink
Merge pull request #2 from fhstp/stethoscope_demo
Browse files Browse the repository at this point in the history
Stethoscope demo
  • Loading branch information
alex-rind committed Sep 14, 2023
2 parents dff8d41 + 2a482c1 commit 21871d9
Show file tree
Hide file tree
Showing 10 changed files with 487 additions and 570 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,20 @@ Run all cells from top to "Ploting the user interface".

Create a dev environment:
```bash
conda create -n soniscope_jupyter-dev -c conda-forge nodejs yarn python jupyterlab
conda create -n soniscope_jupyter-dev -c conda-forge nodejs python jupyterlab
conda activate soniscope_jupyter-dev
```
or
```bash
python -m venv venv
source venv/Scripts/activate
python -m pip install -U pip setuptools
pip install nodejs jupyterlab jupyter-packaging
pip install nodejs 'jupyterlab==3.6.5' jupyter-packaging
```

For a development installation the version of the python package `jupyterlab`
and the npm package `@jupyterlab/builder` need to match.

Install the python. This will also build the TS package.
```bash
pip install -e ".[test, examples]"
Expand Down
10 changes: 9 additions & 1 deletion dev-logbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ twine check dist/soniscope_jupyter-0.1.5*
twine upload dist/soniscope_jupyter-0.1.5*
```

Automated tests (cp. Github build)

```
npm run lint:check # wrong TypeScript version? does not matter?
npm run test
pytest
```

## Step 12: feature requests

- [X] include distance in triggered event
Expand All @@ -227,7 +235,7 @@ twine upload dist/soniscope_jupyter-0.1.5*

Bugfixes

- [ ] bei touch auch die Linsenposition setzen ODER linsen verschiebung auch bei touch move
- [X] bei touch auch die Linsenposition setzen (ODER linsen verschiebung auch bei touch move)
- [ ] mousewheel triggers scroll on Firefox

## Step ...: continuous events using dragging
Expand Down
28 changes: 28 additions & 0 deletions docs/source/stethoscope-demo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SoniScope Demo for ERN 2023 using Touch with a Stethoscope

Interactions are captured on `rect.overlay` as defined in `lensCursor.ts`.

## Classical Interactions

* mouseenter --> lens opacity = default
* mouseleave --> lens opacity = 0
* wheel --> resize lens
* mousemove --> set lens coords
* mousedown --> send event (play sonification)

## Stethoscope Touch Interactions

* touchstart --> send event (play sonification)
set lens coords
lens opacity = default
* touchend --> lens opacity transitions to 0
* wheel --> resize lens

## Windows Settings

* disable integrated touch feedback:
* Erleichterte Bedienung > Mauszeiger > Touchfeedback ändern
<https://www.randombrick.de/windows-10-visuelles-feedback-fuer-touchscreen-deaktivieren/>
* disable long touch as right click
* Search "Finger" and open "Fingereingabeeinstellungen" in search results
* Firefox Web Browser also translates a long touch to a right click independently from Windows.
16 changes: 15 additions & 1 deletion examples/SoniScope.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,19 @@
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b576bb3e-dd28-4cbb-89d5-e72ea69304ad",
"metadata": {},
"outputs": [],
"source": [
"def on_lens_released(widget): \n",
" # what should be done when the touch has ended or the mouse button is released \n",
" # (e.g., stop the sonification)\n",
" print(\"lens released\")"
]
},
{
"cell_type": "markdown",
"id": "90fe8f87-04d6-4108-b1ab-0a58f0ce9423",
Expand Down Expand Up @@ -542,7 +555,8 @@
"\n",
"#----------------------------------------------------\n",
"# You can use the SoniScpoe now :)\n",
"plotBike.on_lens_click(on_lens_clicked)\n"
"plotBike.on_lens_click(on_lens_clicked)\n",
"plotBike.on_lens_release(on_lens_released)"
]
},
{
Expand Down
Loading

0 comments on commit 21871d9

Please sign in to comment.