Skip to content

Commit 50f2a03

Browse files
committed
Trame v2 - Matplotlib widget
This initial commit gather the first stage of what a Matplotlib widget represent for trame 2.0.0.
0 parents  commit 50f2a03

32 files changed

+20031
-0
lines changed

.gitignore

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# local env files
2+
.env.local
3+
.env.*.local
4+
5+
# OS files
6+
.DS_Store
7+
8+
# Editor directories and files
9+
.idea
10+
.vscode
11+
*.suo
12+
*.ntvs*
13+
*.njsproj
14+
*.sln
15+
*.sw?
16+
17+
# Byte-compiled / optimized / DLL files
18+
__pycache__/
19+
*.py[cod]
20+
*$py.class
21+
22+
# C extensions
23+
*.so
24+
25+
# Distribution / packaging
26+
.Python
27+
build/
28+
dist/
29+
downloads/
30+
eggs/
31+
.eggs/
32+
sdist/
33+
wheels/
34+
*.egg-info/
35+
.installed.cfg
36+
*.egg
37+
MANIFEST
38+
39+
# PyInstaller
40+
# Usually these files are written by a python script from a template
41+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
42+
*.manifest
43+
*.spec
44+
45+
# Installer logs
46+
pip-log.txt
47+
pip-delete-this-directory.txt
48+
49+
# Unit test / coverage reports
50+
htmlcov/
51+
.tox/
52+
.nox/
53+
.coverage
54+
.coverage.*
55+
.cache
56+
nosetests.xml
57+
coverage.xml
58+
*.cover
59+
*.py,cover
60+
.hypothesis/
61+
.pytest_cache/
62+
cover/
63+
64+
# Sphinx documentation
65+
docs/_build/
66+
67+
# PyBuilder
68+
.pybuilder/
69+
target/
70+
71+
# Jupyter Notebook
72+
.ipynb_checkpoints
73+
74+
# IPython
75+
profile_default/
76+
ipython_config.py
77+
78+
# pyenv
79+
.python-version
80+
81+
82+
# pdm
83+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
84+
#pdm.lock
85+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
86+
# in version control.
87+
# https://pdm.fming.dev/#use-with-ide
88+
.pdm.toml
89+
90+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
91+
__pypackages__/
92+
93+
# Environments
94+
.env
95+
.venv
96+
env/
97+
venv/
98+
ENV/
99+
env.bak/
100+
venv.bak/
101+
102+
# Spyder project settings
103+
.spyderproject
104+
.spyproject
105+
106+
# Rope project settings
107+
.ropeproject
108+
109+
# mkdocs documentation
110+
/site
111+
112+
# mypy
113+
.mypy_cache/
114+
.dmypy.json
115+
dmypy.json
116+
117+
# Pyre type checker
118+
.pyre/
119+
120+
# pytype static type analyzer
121+
.pytype/
122+
123+
# Cython debug symbols
124+
cython_debug/
125+
126+
# Log files
127+
node_modules
128+
npm-debug.log*
129+
yarn-debug.log*
130+
yarn-error.log*
131+
pnpm-debug.log*

LICENSE

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

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recursive-include trame_matplotlib/module/serve/ *.umd.min.js
2+
include trame_matplotlib/LICENSE

README.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Matplotlib widget for trame
2+
===========================================================================
3+
4+
trame-matplotlib extend trame **widgets** with a component that is capable of rendering Matplotlib plots.
5+
This library allow you to create rich visualization by leveraging `Matplotlib <https://matplotlib.org/>`__ within trame.
6+
7+
8+
Installing
9+
-----------------------------------------------------------
10+
11+
trame-matplotlib can be installed with `pip <https://pypi.org/project/trame-matplotlib/>`__:
12+
13+
.. code-block:: bash
14+
15+
pip install --upgrade trame-matplotlib
16+
17+
18+
Usage
19+
-----------------------------------------------------------
20+
21+
The `Trame Tutorial <https://kitware.github.io/trame/docs/tutorial.html>`__ is the place to go to learn how to use the library and start building your own application.
22+
23+
The `API Reference <https://trame.readthedocs.io/en/latest/index.html>`__ documentation provides API-level documentation.
24+
25+
26+
License
27+
-----------------------------------------------------------
28+
29+
trame-matplotlib is made available under the BSD-3 License. For more details, see `LICENSE <https://github.com/Kitware/trame-matplotlib/blob/master/LICENSE>`__
30+
This package is under the BSD-3 License as it is compatible with `matplotlib <https://matplotlib.org/stable/users/project/license.html>`__ and `mpld3 <https://github.com/mpld3/mpld3/blob/master/LICENSE>`__ which are used underneath that trame widget.
31+
32+
33+
Community
34+
-----------------------------------------------------------
35+
36+
`Trame <https://kitware.github.io/trame/>`__ | `Discussions <https://github.com/Kitware/trame/discussions>`__ | `Issues <https://github.com/Kitware/trame/issues>`__ | `RoadMap <https://github.com/Kitware/trame/projects/1>`__ | `Contact Us <https://www.kitware.com/contact-us/>`__
37+
38+
.. image:: https://zenodo.org/badge/410108340.svg
39+
:target: https://zenodo.org/badge/latestdoi/410108340
40+
41+
42+
Enjoying trame?
43+
-----------------------------------------------------------
44+
45+
Share your experience `with a testimonial <https://github.com/Kitware/trame/issues/18>`__ or `with a brand approval <https://github.com/Kitware/trame/issues/19>`__.
46+
47+
48+
Code sample
49+
-----------------------------------------------------------
50+
51+
Using the component method
52+
53+
.. code-block:: python
54+
55+
import matplotlib.pyplot as plt
56+
from trame.widgets import matplotlib
57+
58+
fig, ax = plt.subplots(**figure_size)
59+
60+
widget = matplotlib.Figure(figure=None) # could pass fig at constrution
61+
widget.update(fig)

setup.cfg

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[metadata]
2+
name = trame-matplotlib
3+
version = 2.0.0rc2
4+
description = Markdown widget for trame
5+
long_description = file: README.rst
6+
long_description_content_type = text/x-rst
7+
author = Kitware Inc.
8+
license = BSD License
9+
classifiers =
10+
Development Status :: 5 - Production/Stable
11+
Environment :: Web Environment
12+
License :: OSI Approved :: BSD License
13+
Natural Language :: English
14+
Operating System :: OS Independent
15+
Programming Language :: Python :: 3 :: Only
16+
Programming Language :: JavaScript
17+
Topic :: Software Development :: Libraries :: Application Frameworks
18+
Topic :: Software Development :: Libraries :: Python Modules
19+
keywords =
20+
Python
21+
Interactive
22+
Web
23+
Application
24+
Framework
25+
26+
[options]
27+
packages = find:
28+
include_package_data = True
29+
install_requires =
30+
trame-client

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup
2+
3+
setup()

trame/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

trame/modules/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

trame/modules/matplotlib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from trame_matplotlib.module import *

trame/widgets/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

0 commit comments

Comments
 (0)