dash-tree-components 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dash_tree_components-0.0.1/LICENSE +0 -0
- dash_tree_components-0.0.1/MANIFEST.in +11 -0
- dash_tree_components-0.0.1/PKG-INFO +108 -0
- dash_tree_components-0.0.1/README.md +98 -0
- dash_tree_components-0.0.1/dash_tree_components/Tree.py +52 -0
- dash_tree_components-0.0.1/dash_tree_components/__init__.py +87 -0
- dash_tree_components-0.0.1/dash_tree_components/_imports_.py +5 -0
- dash_tree_components-0.0.1/dash_tree_components/dash_tree_components.min.js +3 -0
- dash_tree_components-0.0.1/dash_tree_components/dash_tree_components.min.js.map +1 -0
- dash_tree_components-0.0.1/dash_tree_components/metadata.json +73 -0
- dash_tree_components-0.0.1/dash_tree_components/package-info.json +60 -0
- dash_tree_components-0.0.1/dash_tree_components.egg-info/PKG-INFO +108 -0
- dash_tree_components-0.0.1/dash_tree_components.egg-info/SOURCES.txt +16 -0
- dash_tree_components-0.0.1/dash_tree_components.egg-info/dependency_links.txt +1 -0
- dash_tree_components-0.0.1/dash_tree_components.egg-info/top_level.txt +1 -0
- dash_tree_components-0.0.1/package.json +60 -0
- dash_tree_components-0.0.1/setup.cfg +4 -0
- dash_tree_components-0.0.1/setup.py +26 -0
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
include dash_tree_components/dash_tree_components.min.js
|
|
2
|
+
include dash_tree_components/dash_tree_components.min.js.map
|
|
3
|
+
include dash_tree_components/async-*.js
|
|
4
|
+
include dash_tree_components/async-*.js.map
|
|
5
|
+
include dash_tree_components/*-shared.js
|
|
6
|
+
include dash_tree_components/*-shared.js.map
|
|
7
|
+
include dash_tree_components/metadata.json
|
|
8
|
+
include dash_tree_components/package-info.json
|
|
9
|
+
include README.md
|
|
10
|
+
include LICENSE
|
|
11
|
+
include package.json
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: dash_tree_components
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Tree components for Dash
|
|
5
|
+
Author: Wouter Wakker <wouter.wakker@outlook.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Framework :: Dash
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
|
|
11
|
+
# dash_tree_components
|
|
12
|
+
|
|
13
|
+
dash_tree_components is a Dash component library.
|
|
14
|
+
|
|
15
|
+
Tree components for Dash
|
|
16
|
+
|
|
17
|
+
Get started with:
|
|
18
|
+
1. Install Dash and its dependencies: https://dash.plotly.com/installation
|
|
19
|
+
2. Run `python usage.py`
|
|
20
|
+
3. Visit http://localhost:8050 in your web browser
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
25
|
+
|
|
26
|
+
### Install dependencies
|
|
27
|
+
|
|
28
|
+
If you have selected install_dependencies during the prompt, you can skip this part.
|
|
29
|
+
|
|
30
|
+
1. Install npm packages
|
|
31
|
+
```
|
|
32
|
+
$ npm install
|
|
33
|
+
```
|
|
34
|
+
2. Create a virtual env and activate.
|
|
35
|
+
```
|
|
36
|
+
$ virtualenv venv
|
|
37
|
+
$ . venv/bin/activate
|
|
38
|
+
```
|
|
39
|
+
_Note: venv\Scripts\activate for windows_
|
|
40
|
+
|
|
41
|
+
3. Install python packages required to build components.
|
|
42
|
+
```
|
|
43
|
+
$ pip install -r requirements.txt
|
|
44
|
+
```
|
|
45
|
+
4. Install the python packages for testing (optional)
|
|
46
|
+
```
|
|
47
|
+
$ pip install -r tests/requirements.txt
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Write your component code in `src/lib/components/Tree.react.js`.
|
|
51
|
+
|
|
52
|
+
- The demo app is in `src/demo` and you will import your example component code into your demo app.
|
|
53
|
+
- Test your code in a Python environment:
|
|
54
|
+
1. Build your code
|
|
55
|
+
```
|
|
56
|
+
$ npm run build
|
|
57
|
+
```
|
|
58
|
+
2. Run and modify the `usage.py` sample dash app:
|
|
59
|
+
```
|
|
60
|
+
$ python usage.py
|
|
61
|
+
```
|
|
62
|
+
- Write tests for your component.
|
|
63
|
+
- A sample test is available in `tests/test_usage.py`, it will load `usage.py` and you can then automate interactions with selenium.
|
|
64
|
+
- Run the tests with `$ pytest tests`.
|
|
65
|
+
- The Dash team uses these types of integration tests extensively. Browse the Dash component code on GitHub for more examples of testing (e.g. https://github.com/plotly/dash-core-components)
|
|
66
|
+
- Add custom styles to your component by putting your custom CSS files into your distribution folder (`dash_tree_components`).
|
|
67
|
+
- Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
|
|
68
|
+
- Make sure the stylesheets are added to the `_css_dist` dict in `dash_tree_components/__init__.py` so dash will serve them automatically when the component suite is requested.
|
|
69
|
+
- [Review your code](./review_checklist.md)
|
|
70
|
+
|
|
71
|
+
### Create a production build and publish:
|
|
72
|
+
|
|
73
|
+
1. Build your code:
|
|
74
|
+
```
|
|
75
|
+
$ npm run build
|
|
76
|
+
```
|
|
77
|
+
2. Create a Python distribution
|
|
78
|
+
```
|
|
79
|
+
$ python setup.py sdist bdist_wheel
|
|
80
|
+
```
|
|
81
|
+
This will create source and wheel distribution in the generated the `dist/` folder.
|
|
82
|
+
See [PyPA](https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project)
|
|
83
|
+
for more information.
|
|
84
|
+
|
|
85
|
+
3. Test your tarball by copying it into a new environment and installing it locally:
|
|
86
|
+
```
|
|
87
|
+
$ pip install dash_tree_components-0.0.1.tar.gz
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
4. If it works, then you can publish the component to NPM and PyPI:
|
|
91
|
+
1. Publish on PyPI
|
|
92
|
+
```
|
|
93
|
+
$ twine upload dist/*
|
|
94
|
+
```
|
|
95
|
+
2. Cleanup the dist folder (optional)
|
|
96
|
+
```
|
|
97
|
+
$ rm -rf dist
|
|
98
|
+
```
|
|
99
|
+
3. Publish on NPM (Optional if chosen False in `publish_on_npm`)
|
|
100
|
+
```
|
|
101
|
+
$ npm publish
|
|
102
|
+
```
|
|
103
|
+
_Publishing your component to NPM will make the JavaScript bundles available on the unpkg CDN. By default, Dash serves the component library's CSS and JS locally, but if you choose to publish the package to NPM you can set `serve_locally` to `False` and you may see faster load times._
|
|
104
|
+
|
|
105
|
+
5. Share your component with the community! https://community.plotly.com/c/dash
|
|
106
|
+
1. Publish this repository to GitHub
|
|
107
|
+
2. Tag your GitHub repository with the plotly-dash tag so that it appears here: https://github.com/topics/plotly-dash
|
|
108
|
+
3. Create a post in the Dash community forum: https://community.plotly.com/c/dash
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# dash_tree_components
|
|
2
|
+
|
|
3
|
+
dash_tree_components is a Dash component library.
|
|
4
|
+
|
|
5
|
+
Tree components for Dash
|
|
6
|
+
|
|
7
|
+
Get started with:
|
|
8
|
+
1. Install Dash and its dependencies: https://dash.plotly.com/installation
|
|
9
|
+
2. Run `python usage.py`
|
|
10
|
+
3. Visit http://localhost:8050 in your web browser
|
|
11
|
+
|
|
12
|
+
## Contributing
|
|
13
|
+
|
|
14
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
15
|
+
|
|
16
|
+
### Install dependencies
|
|
17
|
+
|
|
18
|
+
If you have selected install_dependencies during the prompt, you can skip this part.
|
|
19
|
+
|
|
20
|
+
1. Install npm packages
|
|
21
|
+
```
|
|
22
|
+
$ npm install
|
|
23
|
+
```
|
|
24
|
+
2. Create a virtual env and activate.
|
|
25
|
+
```
|
|
26
|
+
$ virtualenv venv
|
|
27
|
+
$ . venv/bin/activate
|
|
28
|
+
```
|
|
29
|
+
_Note: venv\Scripts\activate for windows_
|
|
30
|
+
|
|
31
|
+
3. Install python packages required to build components.
|
|
32
|
+
```
|
|
33
|
+
$ pip install -r requirements.txt
|
|
34
|
+
```
|
|
35
|
+
4. Install the python packages for testing (optional)
|
|
36
|
+
```
|
|
37
|
+
$ pip install -r tests/requirements.txt
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Write your component code in `src/lib/components/Tree.react.js`.
|
|
41
|
+
|
|
42
|
+
- The demo app is in `src/demo` and you will import your example component code into your demo app.
|
|
43
|
+
- Test your code in a Python environment:
|
|
44
|
+
1. Build your code
|
|
45
|
+
```
|
|
46
|
+
$ npm run build
|
|
47
|
+
```
|
|
48
|
+
2. Run and modify the `usage.py` sample dash app:
|
|
49
|
+
```
|
|
50
|
+
$ python usage.py
|
|
51
|
+
```
|
|
52
|
+
- Write tests for your component.
|
|
53
|
+
- A sample test is available in `tests/test_usage.py`, it will load `usage.py` and you can then automate interactions with selenium.
|
|
54
|
+
- Run the tests with `$ pytest tests`.
|
|
55
|
+
- The Dash team uses these types of integration tests extensively. Browse the Dash component code on GitHub for more examples of testing (e.g. https://github.com/plotly/dash-core-components)
|
|
56
|
+
- Add custom styles to your component by putting your custom CSS files into your distribution folder (`dash_tree_components`).
|
|
57
|
+
- Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
|
|
58
|
+
- Make sure the stylesheets are added to the `_css_dist` dict in `dash_tree_components/__init__.py` so dash will serve them automatically when the component suite is requested.
|
|
59
|
+
- [Review your code](./review_checklist.md)
|
|
60
|
+
|
|
61
|
+
### Create a production build and publish:
|
|
62
|
+
|
|
63
|
+
1. Build your code:
|
|
64
|
+
```
|
|
65
|
+
$ npm run build
|
|
66
|
+
```
|
|
67
|
+
2. Create a Python distribution
|
|
68
|
+
```
|
|
69
|
+
$ python setup.py sdist bdist_wheel
|
|
70
|
+
```
|
|
71
|
+
This will create source and wheel distribution in the generated the `dist/` folder.
|
|
72
|
+
See [PyPA](https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project)
|
|
73
|
+
for more information.
|
|
74
|
+
|
|
75
|
+
3. Test your tarball by copying it into a new environment and installing it locally:
|
|
76
|
+
```
|
|
77
|
+
$ pip install dash_tree_components-0.0.1.tar.gz
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
4. If it works, then you can publish the component to NPM and PyPI:
|
|
81
|
+
1. Publish on PyPI
|
|
82
|
+
```
|
|
83
|
+
$ twine upload dist/*
|
|
84
|
+
```
|
|
85
|
+
2. Cleanup the dist folder (optional)
|
|
86
|
+
```
|
|
87
|
+
$ rm -rf dist
|
|
88
|
+
```
|
|
89
|
+
3. Publish on NPM (Optional if chosen False in `publish_on_npm`)
|
|
90
|
+
```
|
|
91
|
+
$ npm publish
|
|
92
|
+
```
|
|
93
|
+
_Publishing your component to NPM will make the JavaScript bundles available on the unpkg CDN. By default, Dash serves the component library's CSS and JS locally, but if you choose to publish the package to NPM you can set `serve_locally` to `False` and you may see faster load times._
|
|
94
|
+
|
|
95
|
+
5. Share your component with the community! https://community.plotly.com/c/dash
|
|
96
|
+
1. Publish this repository to GitHub
|
|
97
|
+
2. Tag your GitHub repository with the plotly-dash tag so that it appears here: https://github.com/topics/plotly-dash
|
|
98
|
+
3. Create a post in the Dash community forum: https://community.plotly.com/c/dash
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# AUTO GENERATED FILE - DO NOT EDIT
|
|
2
|
+
|
|
3
|
+
from dash.development.base_component import Component, _explicitize_args
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Tree(Component):
|
|
7
|
+
"""A Tree component.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Keyword arguments:
|
|
11
|
+
|
|
12
|
+
- id (string; optional):
|
|
13
|
+
The ID used to identify this component in Dash callbacks.
|
|
14
|
+
|
|
15
|
+
- className (string; optional):
|
|
16
|
+
Class name of the tree.
|
|
17
|
+
|
|
18
|
+
- collapse_color (string; default '#bdbcbc'):
|
|
19
|
+
A list of dictionaries that defines the tree structure.
|
|
20
|
+
|
|
21
|
+
- data (list; required):
|
|
22
|
+
A list of dictionaries that defines the tree structure.
|
|
23
|
+
|
|
24
|
+
- height (number; optional):
|
|
25
|
+
A list of dictionaries that defines the tree structure.
|
|
26
|
+
|
|
27
|
+
- open_by_default (boolean; default True):
|
|
28
|
+
A list of dictionaries that defines the tree structure.
|
|
29
|
+
|
|
30
|
+
- width (number; optional):
|
|
31
|
+
A list of dictionaries that defines the tree structure."""
|
|
32
|
+
_children_props = []
|
|
33
|
+
_base_nodes = ['children']
|
|
34
|
+
_namespace = 'dash_tree_components'
|
|
35
|
+
_type = 'Tree'
|
|
36
|
+
@_explicitize_args
|
|
37
|
+
def __init__(self, id=Component.UNDEFINED, data=Component.REQUIRED, width=Component.UNDEFINED, height=Component.UNDEFINED, collapse_color=Component.UNDEFINED, open_by_default=Component.UNDEFINED, className=Component.UNDEFINED, **kwargs):
|
|
38
|
+
self._prop_names = ['id', 'className', 'collapse_color', 'data', 'height', 'open_by_default', 'width']
|
|
39
|
+
self._valid_wildcard_attributes = []
|
|
40
|
+
self.available_properties = ['id', 'className', 'collapse_color', 'data', 'height', 'open_by_default', 'width']
|
|
41
|
+
self.available_wildcard_properties = []
|
|
42
|
+
_explicit_args = kwargs.pop('_explicit_args')
|
|
43
|
+
_locals = locals()
|
|
44
|
+
_locals.update(kwargs) # For wildcard attrs and excess named props
|
|
45
|
+
args = {k: _locals[k] for k in _explicit_args}
|
|
46
|
+
|
|
47
|
+
for k in ['data']:
|
|
48
|
+
if k not in args:
|
|
49
|
+
raise TypeError(
|
|
50
|
+
'Required argument `' + k + '` was not specified.')
|
|
51
|
+
|
|
52
|
+
super(Tree, self).__init__(**args)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
from __future__ import print_function as _
|
|
2
|
+
|
|
3
|
+
import os as _os
|
|
4
|
+
import sys as _sys
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
import dash as _dash
|
|
8
|
+
|
|
9
|
+
# noinspection PyUnresolvedReferences
|
|
10
|
+
from ._imports_ import *
|
|
11
|
+
from ._imports_ import __all__
|
|
12
|
+
|
|
13
|
+
if not hasattr(_dash, '__plotly_dash') and not hasattr(_dash, 'development'):
|
|
14
|
+
print('Dash was not successfully imported. '
|
|
15
|
+
'Make sure you don\'t have a file '
|
|
16
|
+
'named \n"dash.py" in your current directory.', file=_sys.stderr)
|
|
17
|
+
_sys.exit(1)
|
|
18
|
+
|
|
19
|
+
_basepath = _os.path.dirname(__file__)
|
|
20
|
+
_filepath = _os.path.abspath(_os.path.join(_basepath, 'package-info.json'))
|
|
21
|
+
with open(_filepath) as f:
|
|
22
|
+
package = json.load(f)
|
|
23
|
+
|
|
24
|
+
package_name = package['name'].replace(' ', '_').replace('-', '_')
|
|
25
|
+
__version__ = package['version']
|
|
26
|
+
|
|
27
|
+
_current_path = _os.path.dirname(_os.path.abspath(__file__))
|
|
28
|
+
|
|
29
|
+
_this_module = _sys.modules[__name__]
|
|
30
|
+
|
|
31
|
+
async_resources = []
|
|
32
|
+
|
|
33
|
+
_js_dist = []
|
|
34
|
+
|
|
35
|
+
_js_dist.extend(
|
|
36
|
+
[
|
|
37
|
+
{
|
|
38
|
+
"relative_package_path": "async-{}.js".format(async_resource),
|
|
39
|
+
"external_url": (
|
|
40
|
+
"https://unpkg.com/{0}@{2}"
|
|
41
|
+
"/{1}/async-{3}.js"
|
|
42
|
+
).format(package_name, __name__, __version__, async_resource),
|
|
43
|
+
"namespace": package_name,
|
|
44
|
+
"async": True,
|
|
45
|
+
}
|
|
46
|
+
for async_resource in async_resources
|
|
47
|
+
]
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# TODO: Figure out if unpkg link works
|
|
51
|
+
_js_dist.extend(
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
"relative_package_path": "async-{}.js.map".format(async_resource),
|
|
55
|
+
"external_url": (
|
|
56
|
+
"https://unpkg.com/{0}@{2}"
|
|
57
|
+
"/{1}/async-{3}.js.map"
|
|
58
|
+
).format(package_name, __name__, __version__, async_resource),
|
|
59
|
+
"namespace": package_name,
|
|
60
|
+
"dynamic": True,
|
|
61
|
+
}
|
|
62
|
+
for async_resource in async_resources
|
|
63
|
+
]
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
_js_dist.extend(
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
'relative_package_path': 'dash_tree_components.min.js',
|
|
70
|
+
|
|
71
|
+
'namespace': package_name
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
'relative_package_path': 'dash_tree_components.min.js.map',
|
|
75
|
+
|
|
76
|
+
'namespace': package_name,
|
|
77
|
+
'dynamic': True
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
_css_dist = []
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
for _component in __all__:
|
|
86
|
+
setattr(locals()[_component], '_js_dist', _js_dist)
|
|
87
|
+
setattr(locals()[_component], '_css_dist', _css_dist)
|