Skip to content

Commit d42eee6

Browse files
committed
First commit
0 parents  commit d42eee6

25 files changed

+6343
-0
lines changed

.gitignore

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
48+
# Translations
49+
*.mo
50+
*.pot
51+
52+
# Django stuff:
53+
*.log
54+
local_settings.py
55+
56+
# Flask instance folder
57+
instance/
58+
59+
# Scrapy stuff:
60+
.scrapy
61+
62+
# Sphinx documentation
63+
docs/_build/
64+
docs/source/_static/embed-bundle.js
65+
docs/source/_static/embed-bundle.js.map
66+
67+
# PyBuilder
68+
target/
69+
70+
# IPython Notebook
71+
.ipynb_checkpoints
72+
73+
# pyenv
74+
.python-version
75+
76+
# celery beat schedule file
77+
celerybeat-schedule
78+
79+
# dotenv
80+
.env
81+
82+
# virtualenv
83+
venv/
84+
ENV/
85+
86+
# Spyder project settings
87+
.spyderproject
88+
89+
# Rope project settings
90+
.ropeproject
91+
92+
# =========================
93+
# Operating System Files
94+
# =========================
95+
96+
# OSX
97+
# =========================
98+
99+
.DS_Store
100+
.AppleDouble
101+
.LSOverride
102+
103+
# Thumbnails
104+
._*
105+
106+
# Files that might appear in the root of a volume
107+
.DocumentRevisions-V100
108+
.fseventsd
109+
.Spotlight-V100
110+
.TemporaryItems
111+
.Trashes
112+
.VolumeIcon.icns
113+
114+
# Directories potentially created on remote AFP share
115+
.AppleDB
116+
.AppleDesktop
117+
Network Trash Folder
118+
Temporary Items
119+
.apdisk
120+
121+
# Windows
122+
# =========================
123+
124+
# Windows image file caches
125+
Thumbs.db
126+
ehthumbs.db
127+
128+
# Folder config file
129+
Desktop.ini
130+
131+
# Recycle Bin used on file shares
132+
$RECYCLE.BIN/
133+
134+
# Windows Installer files
135+
*.cab
136+
*.msi
137+
*.msm
138+
*.msp
139+
140+
# Windows shortcuts
141+
*.lnk
142+
143+
144+
# NPM
145+
# ----
146+
147+
**/node_modules/
148+
ipycanvas/nbextension/static/index.*
149+
ipycanvas/labextension/*.tgz
150+
151+
# Coverage data
152+
# -------------
153+
**/coverage/
154+
155+
# Packed lab extensions
156+
ipycanvas/labextension

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
node_modules/
3+
.jshintrc
4+
# Ignore any build output from python:
5+
dist/*.tar.gz
6+
dist/*.wheel

LICENSE.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2019 Martin Renou
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
2. Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
3. Neither the name of the copyright holder nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
include LICENSE.txt
2+
include README.md
3+
4+
include setupbase.py
5+
6+
include package.json
7+
include webpack.config.js
8+
include ipycanvas/labextension/*.tgz
9+
10+
# Documentation
11+
graft docs
12+
exclude docs/\#*
13+
prune docs/build
14+
prune docs/gh-pages
15+
prune docs/dist
16+
17+
# Examples
18+
graft examples
19+
20+
# Tests
21+
graft tests
22+
prune tests/build
23+
24+
# Javascript files
25+
graft ipycanvas/nbextension
26+
graft src
27+
prune **/node_modules
28+
prune coverage
29+
prune lib
30+
31+
# Patterns to exclude from any directory
32+
global-exclude *~
33+
global-exclude *.pyc
34+
global-exclude *.pyo
35+
global-exclude .git
36+
global-exclude .ipynb_checkpoints

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
# ipycanvas
3+
4+
[![Build Status](https://travis-ci.org/martinRenou/ipycanvas.svg?branch=master)](https://travis-ci.org/martinRenou/ipycanvas)
5+
[![codecov](https://codecov.io/gh/martinRenou/ipycanvas/branch/master/graph/badge.svg)](https://codecov.io/gh/martinRenou/ipycanvas)
6+
7+
8+
Interactive widgets library exposing the browser's Canvas API
9+
10+
## Installation
11+
12+
You can install using `pip`:
13+
14+
```bash
15+
pip install ipycanvas
16+
```
17+
18+
Or if you use jupyterlab:
19+
20+
```bash
21+
pip install ipycanvas
22+
jupyter labextension install @jupyter-widgets/jupyterlab-manager
23+
```
24+
25+
If you are using Jupyter Notebook 5.2 or earlier, you may also need to enable
26+
the nbextension:
27+
```bash
28+
jupyter nbextension enable --py [--sys-prefix|--user|--system] ipycanvas
29+
```

examples/introduction.ipynb

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Introduction"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"import ipycanvas"
17+
]
18+
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": null,
22+
"metadata": {},
23+
"outputs": [],
24+
"source": [
25+
"w = ipycanvas.Canvas()"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"metadata": {},
32+
"outputs": [],
33+
"source": [
34+
"w"
35+
]
36+
}
37+
],
38+
"metadata": {
39+
"kernelspec": {
40+
"display_name": "Python 3",
41+
"language": "python",
42+
"name": "python3"
43+
},
44+
"language_info": {
45+
"codemirror_mode": {
46+
"name": "ipython",
47+
"version": 3
48+
},
49+
"file_extension": ".py",
50+
"mimetype": "text/x-python",
51+
"name": "python",
52+
"nbconvert_exporter": "python",
53+
"pygments_lexer": "ipython3",
54+
"version": "3.7.3"
55+
}
56+
},
57+
"nbformat": 4,
58+
"nbformat_minor": 4
59+
}

ipycanvas.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"load_extensions": {
3+
"ipycanvas/extension": true
4+
}
5+
}

ipycanvas/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
# Copyright (c) Martin Renou.
5+
# Distributed under the terms of the Modified BSD License.
6+
7+
from .canvas import Canvas
8+
from ._version import __version__, version_info
9+
10+
from .nbextension import _jupyter_nbextension_paths

ipycanvas/_frontend.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
# Copyright (c) Martin Renou.
5+
# Distributed under the terms of the Modified BSD License.
6+
7+
"""
8+
Information about the frontend package of the widgets.
9+
"""
10+
11+
module_name = "ipycanvas"
12+
module_version = "^0.1.0"

ipycanvas/_version.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
# Copyright (c) Martin Renou.
5+
# Distributed under the terms of the Modified BSD License.
6+
7+
version_info = (0, 1, 0, 'dev')
8+
__version__ = ".".join(map(str, version_info))

0 commit comments

Comments
 (0)