-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add scroll zoom section, adjust top-level section levels (#7563)
* add scroll zoom section, adjust top-level section levels * fix section levels
- Loading branch information
1 parent
137f101
commit 1fd1a8c
Showing
2 changed files
with
172 additions
and
20 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
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,138 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Scroll and Zoom\n", | ||
"\n", | ||
"BeakerX's table and plot widgets both support the scroll wheel.\n", | ||
"For tables, the scroll wheel scrolls vertically.\n", | ||
"For plots, the scroll wheel zooms.\n", | ||
"However, for the notebook as a whole, the scroll wheel also has a meaning, to scroll the notebook.\n", | ||
"So there's an ambiguity, and the UI needs a way to resolve it and decide where the scroll events go.\n", | ||
"\n", | ||
"BeakerX's approach starts with idea of *focus*, a widget that would be the target of any user commands.\n", | ||
"And indeed, in BeakerX when you click on a table or a plot, it gets the focus.\n", | ||
"This is represented by a green outline around the widget.\n", | ||
"The outline is styled to match the blue one that Jupyter uses to indicate the current cell.\n", | ||
"\n", | ||
"The widget will keep the focus as long as the mouse remains over it. Feel free to interact with the widget, clicking, scrolling, and zooming away. When you are done and move the mouse elsewhere, the green outline will vanish. Focus as returned to the notebook, and the next scroll event will go to the page, and not to a widget.\n", | ||
"\n", | ||
"This **keyless blur** is a BeakerX innovation.\n", | ||
"\n", | ||
"Try it with the widgets below:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"from beakerx import *" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "741ea1cb230c45ebb009ec5a32adac0a", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"TableDisplay([{'y1':4, 'm3':2, 'z2':1}, {'m3':4, 'z2':2}])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "f819252f96964dff8e12f5c49a247926", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"pd.read_csv('../resources/data/interest-rates.csv')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "3ecf806f0084493dbd2de1354a3f748e", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"rng = pd.date_range('1/1/2011', periods=1000, freq='H')\n", | ||
"ts = pd.Series(np.random.randn(len(rng)), index=rng)\n", | ||
"df = pd.DataFrame(ts, columns=['mV'])\n", | ||
"SimpleTimePlot(df, ['mV'])" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.5" | ||
}, | ||
"toc": { | ||
"base_numbering": 1, | ||
"nav_menu": {}, | ||
"number_sections": false, | ||
"sideBar": false, | ||
"skip_h1_title": false, | ||
"title_cell": "Table of Contents", | ||
"title_sidebar": "Contents", | ||
"toc_cell": false, | ||
"toc_position": {}, | ||
"toc_section_display": false, | ||
"toc_window_display": false | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |