dash-html-components v3.0.0
dash-html-components
Vanilla HTML components for Dash
Install dependencies
Create a virtual env and activate.
$ virtualenv venv $ venv/bin/activateNote: venv\Scripts\activate for Windows
Install Python packages required to build components.
$ pip install -r dev-requirements.txt- Generate components and install npm packages
$ npm ci
Generating HTML Components
The components in src/components, as well as the export index in
src/index.js are programmatically generated from element definitions in
scripts/. To regenerate:
$ npm run generate-componentsThe list of attributes is regenerated by scraping the MDN HTML attribute reference.
Note: This step will have already been done for you when you ran npm install
Development
Testing your components in Dash
Watch for changes
$ npm run build:watchInstall module locally (after every change)
# Generate metadata, and build the JavaScript bundle $ npm run install-local # Now you're done. For subsequent changes, if you've got `npm run build:watch` $ python setup.py installRun the Dash layout you want to test
# Import dash_html_components to your layout, then run it: $ python my_dash_layout.py
Installing Python package locally
Before publishing to PyPi, you can test installing the module locally:
# Install in `site-packages` on your machine
$ npm run install-localUninstalling Python package locally
$ npm run uninstall-localContributing
See the contributing guide for guidelines on contributing to this project.
Create a production build and publish:
- Build your code:
$ npm run build Create a Python tarball
$ python setup.py sdistThis distribution tarball will get generated in the
dist/folderTest your tarball by copying it into a new environment and installing it locally:
$ pip install dash-html-components-<new-version>.tar.gzIf it works, then you can publish the component to NPM and PyPI:
- Publish on PyPI
$ twine upload dist/* - Cleanup the dist folder (optional)
$ rimraf dist - Publish on NPM (Optional if chosen False in
publish_on_npm)
Publishing your component to NPM will make the JavaScript bundles available on the unpkg CDN. By default, Dash servers the component library's CSS and JS from the remote unpkg CDN, so if you haven't published the component package to NPM you'll need to set the$ npm publishserve_locallyflags toTrue(unless you chooseFalseonpublish_on_npm). We will eventually makeserve_locally=Truethe default, follow our progress in this issue.
- Publish on PyPI
11 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago