Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7ec69ac

Browse files
committed
introduce widget implementation
1 parent 2b81bfb commit 7ec69ac

File tree

20 files changed

+3286
-4091
lines changed

20 files changed

+3286
-4091
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.egg-info/
2+
.ipynb_checkpoints/
23
dist/
34
build/
45
*.py[cod]

‎.pre-commit-config.yaml‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎LICENSE‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎MANIFEST.in‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1-
recursive-include idom_jupyter/nbextension *.*
2-
recursive-include idom_jupyter/labextension *.*
3-
include jupyter-config/**/*.json
1+
graft idom_jupyter/nbextension
2+
graft idom_jupyter/labextension
3+
4+
graft js
5+
graft tests
6+
prune **/node_modules
7+
8+
include idom-client-jupyter.json
9+
10+
include LICENSE
11+
include setup.py
12+
include pyproject.toml
13+
include install.json
14+
15+
# Patterns to exclude from any directory
16+
global-exclude *~
17+
global-exclude *.pyc
18+
global-exclude *.pyo
19+
global-exclude .git
20+
global-exclude .ipynb_checkpoints
21+
global-exclude *.map

‎README.md‎

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# idom-jupyter
22

3-
A client for [IDOM](https://github.com/idom-team/idom) implemented using Jupyter widgets
3+
A client for IDOM implemented using Jupyter widgets
44

55
## Try It Now!
66

@@ -10,9 +10,15 @@ Check out a live example by clicking the badge below:
1010
<img alt="Binder" height="25px" src="https://mybinder.org/badge_logo.svg" />
1111
</a>
1212

13-
## Getting Started
13+
# Getting Started
1414

15-
Before anything else, do one of the following:
15+
To install use pip:
16+
17+
```
18+
$ pip install idom_jupyter
19+
```
20+
21+
Then, before anything else, do one of the following:
1622

1723
1. At the top of your notebook run
1824

@@ -72,39 +78,29 @@ ipywidgets.Box(
7278
)
7379
```
7480

75-
## Installation
81+
#Developer Installation
7682

77-
To install use pip:
83+
For a development installation (requires [Node.js](https://nodejs.org) and [Yarn version 1](https://classic.yarnpkg.com/)),
7884

7985
```
80-
pip install idom_jupyter
86+
$ git clone https://github.com/idom-team/idom-jupyter.git
87+
$ cd idom-jupyter
88+
$ pip install -e .
89+
$ jupyter nbextension install --py --symlink --overwrite --sys-prefix idom_jupyter
90+
$ jupyter nbextension enable --py --sys-prefix idom_jupyter
8191
```
8292

83-
To install for jupyterlab be sure you've got `jupyterlab_widgets` installed
93+
When actively developing your extension for JupyterLab, run the command:
8494

85-
```bash
86-
pip install jupyterlab_widgets
8795
```
88-
89-
For a development installation (requires npm),
90-
91-
```
92-
git clone https://github.com/idom-team/idom-jupyter.git
93-
cd idom-jupyter
94-
pip install -e . -r requirements.txt
95-
jupyter serverextension enable --py idom_jupyter
96-
jupyter nbextension install --py --symlink --overwrite --sys-prefix idom_jupyter
97-
jupyter nbextension enable --py --sys-prefix idom_jupyter
98-
jupyter labextension install js
99-
jupyter lab build
96+
$ jupyter labextension develop --overwrite idom_jupyter
10097
```
10198

102-
When actively developing your extension, build Jupyter Lab with the command:
99+
Then you need to rebuild the JS when you make a code change:
103100

104101
```
105-
jupyter lab --watch
102+
$ cd js
103+
$ yarn run build
106104
```
107105

108-
This takes a minute or so to get started, but then automatically rebuilds JupyterLab when your javascript changes.
109-
110-
Note on first `jupyter lab --watch`, you may need to touch a file to get Jupyter Lab to open.
106+
You then need to refresh the JupyterLab page when your javascript changes.

‎RELEASE.md‎

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
To release a new version of idom-client-jupyter on PyPI:
1+
To release a new version of idom_jupyter on PyPI:
22

3-
- Update `_version.py` (set release version, remove 'dev')
4-
- git add the `_version.py` file and git commit
5-
- ```
6-
python setup.py sdist bdist_wheel
7-
twine upload dist/*
8-
git tag -a X.X.X -m 'comment'
9-
git add and git commit
10-
git push
11-
git push --tags
12-
```
3+
- Update _version.py (set release version, remove 'dev')
4+
- git add the _version.py file and git commit
5+
- `python setup.py sdist upload`
6+
- `python setup.py bdist_wheel upload`
7+
- `git tag -a X.X.X -m 'comment'`
8+
- Update _version.py (add 'dev' and increment minor)
9+
- `git add` and `git commit`
10+
- `git push`
11+
- `git push --tags`
1312

14-
To release a new version of idom-client-jupyter on NPM:
13+
To release a new version of idom-client-jupyter on NPM update `js/package.json` with a
14+
new npm package version:
1515

16-
- Update `js/package.json` with new npm package version
17-
- ```
18-
# clean out the `dist` and `node_modules` directories
19-
git clean -fdx
20-
npm install
21-
npm publish
22-
```
16+
```
17+
# clean out the `dist` and `node_modules` directories
18+
git clean -fdx
19+
npm install
20+
npm publish
21+
```

‎idom_jupyter/example.py‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎js/lib/embed.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
// already be loaded by the notebook otherwise.
66

77
// Export widget models and views, and the npm package version number.
8-
module.exports = require("./widget.js");
9-
module.exports["version"] = require("../package.json").version;
8+
module.exports = require('./widget.js');
9+
module.exports['version'] = require('../package.json').version;

‎js/lib/example.js‎

Lines changed: 0 additions & 55 deletions
This file was deleted.

‎js/lib/extension.js‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
// Some static assets may be required by the custom widget javascript. The base
66
// url for the notebook is not known at build time and is therefore computed
77
// dynamically.
8-
__webpack_public_path__ =
9-
document.querySelector("body").getAttribute("data-base-url") +
10-
"nbextensions/idom-client-jupyter";
8+
__webpack_public_path__ = document.querySelector('body').getAttribute('data-base-url') + 'nbextensions/idom-client-jupyter';
9+
1110

1211
// Configure requirejs
1312
if (window.require) {
14-
window.require.config({
15-
map: {
16-
"*": {
17-
"idom-client-jupyter": "nbextensions/idom-client-jupyter/index",
18-
},
19-
},
20-
});
13+
window.require.config({
14+
map: {
15+
"*": {
16+
"idom-client-jupyter": "nbextensions/idom-client-jupyter/index",
17+
}
18+
}
19+
});
2120
}
2221

2322
// Export the required load_ipython_extension
2423
module.exports = {
25-
load_ipython_extension: function() {},
24+
load_ipython_extension: function() {}
2625
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /