Skip to content

Commit 0db24af

Browse files
committed
fix: bring more_examples up to date and minor formatting fixes in docs
1. Minor typography fixes in `CHANGELOG.md`, `CODE_OF_CONDUCT.md`, and `CONTRIBUTING.md`. 1. Switch from `app.run_server` to `app.run` in `more_examples/*/*.py`. 1. Update use of Dash Mantine Compnents in `more_examples/demo_stock_portfolio_dmc/app.py`. 1. Add `README.md` in `docs` to explain that this copy of the docs is no longer maintained. 1. Add `README.md` in `more_examples` to explain how to set up and run the examples. 1. Rename custom tooltip example to `app.py` for consistency.
1 parent 5d9a9b5 commit 0db24af

File tree

9 files changed

+46
-21
lines changed

9 files changed

+46
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D
1010
- [#328](https://github.com/plotly/dash-ag-grid/pull/328) fixed issue where `getRowStyle` wast able to be passed as a complete function
1111

1212
### Changed
13-
- [#328](https://github.com/plotly/dash-ag-grid/pull/328)
13+
- [#328](https://github.com/plotly/dash-ag-grid/pull/328)
1414
- bumping to v`32.3` for the grid
1515
- the grid checks if updates are from an internal source (3.0.2 dash) and will selectively rerender if so
1616

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributor Covenant Code of Conduct
1+
# Code of Conduct
22

33
## Our Pledge
44

CONTRIBUTING.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Dash AG Grid Contributing Guide
32

43
Dash AG Grid welcomes community contributions!
@@ -7,25 +6,31 @@ If you have identified a bug or have an idea for a new feature, it's best to sta
76

87
If you have questions, please ask on the [Dash Community Forum](https://community.plotly.com/). rather than using GitHub issues.
98

10-
11-
### Developing in this repo
9+
### Developing in This Repo
1210

1311
Make sure you have Dash installed with dev and testing extras:
12+
1413
```
1514
pip install dash[dev,testing]
1615
```
16+
1717
Build the component (from the root of this repo):
18+
1819
```
1920
npm i
2021
npm run build
2122
```
23+
2224
Now install the component in development mode:
25+
2326
```
2427
$ pip install -e .
2528
```
29+
2630
In development mode, Python uses the files in this directory when you import the package. So you can write a testing app in another folder, and whenever you change some code and rebuild the component here it will update in your testing app.
2731

2832
### Versioning
33+
2934
We follow a strict versioning system aligned with the underlying Ag Grid version, but also reserving the
3035
patch number for updates to the Dash grid.
3136

@@ -39,31 +44,36 @@ As a user, you can always check the underlying Ag Grid version with `dash_ag_gri
3944

4045
For maintainers, when issuing new releases ensure that the version bump of Dash Ag Grid follows this convention. This can be verified after a build by using `npm run pre-flight-dag-version` or `python test_versioning.py`. This is validated during the `npm run dist`
4146

42-
### Create a production build
47+
### Create a Production Build
4348

4449
Update the package version in `package.json` and `CHANGELOG.md` and ensure the changelog lists all the important updates. Then reinstall (so `package-lock.json` gets the new version) and rebuild:
50+
4551
```
4652
npm i
4753
npm run build
4854
```
4955

5056
Commit this - either via a PR or directly to the main branch. Then you can create source and wheel distributions in the generated `dist/` folder, after emptying out any previous builds:
57+
5158
```
5259
npm run dist
5360
```
5461

55-
### Publish a new release
62+
### Publish a New Release
63+
5664
A Github release with package build files is automatically generated when a new tag starting with `v*` is pushed.
5765

5866
Once a Github release is published, the build is re-generated and pushed to PyPi.
5967

6068
Create a git tag:
69+
6170
```
6271
git tag -a 'v31.0,1' -m 'v31.0.1'
6372
git push --tags
6473
```
65-
Wait for the "Generate release" CI job to complete, then check the releases tab to move the release from "Draft" to "Published". Make sure to copy in the Changelog!
6674

67-
When the release is published to Github, it's automatically pushed to PyPi as well. You're done 🎉
75+
Wait for the "Generate release" CI job to complete, then check the releases tab to move the release from "Draft" to "Published". Make sure to copy in the Changelog.
76+
77+
When the release is published to Github, it's automatically pushed to PyPi as well.
6878

6979
Finally, announce the release in Slack, in both the `#dash-product` and `#community-ag-grid` channels. You're done!

docs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Dash AG Grid Documentation
2+
3+
The documentation for this package has been incorporated into [the Dash documentation](https://dash.plotly.com/).
4+
This material is retained for historical reference only;
5+
please do not update it.

more_examples/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dash AG Grid Examples
2+
3+
The examples for this package have been incorporated into [the Dash documentation](https://dash.plotly.com/).
4+
These examples are retained for historical reference only;
5+
please do not update them.
6+
Please note that the stock portfolio example is referenced in
7+
[this Medium article](https://medium.com/plotly/announcing-dash-ag-grid-fbb4a1c83e62).
8+
9+
To run these examples:
10+
11+
1. Set up a development environment as described in [CONTRIBUTING.md](../CONTRIBUTING.md).
12+
1. Install the dependencies in [requires-docs.txt](../requires-docs.txt)
13+
(e.g., using `pip install -r requires-docs.txt`).
14+
1. Run the application you are interested in
15+
(e.g., `python more_examples/demo_stock_portfolio_dmc/app.py`).

more_examples/convert_units/app.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
"""
22
This app is an example of a custom number filter
33
https://www.ag-grid.com/react-data-grid/filter-number/#custom-number-support
4-
54
"""
65

7-
8-
9-
106
import dash_ag_grid as dag
117
from dash import Dash, html
128
import pandas as pd
@@ -49,4 +45,4 @@
4945
)
5046

5147
if __name__ == "__main__":
52-
app.run_server(debug=True)
48+
app.run(debug=True)

more_examples/demo_stock_portfolio_dmc/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,15 @@ def make_sparkline(ticker):
162162

163163
candlestick = dmc.Card(dcc.Graph(id="candlestick"), withBorder=True)
164164
pie = dmc.Card(dcc.Graph(id="asset-allocation"), withBorder=True)
165-
header = dmc.Title("My Portfolio", order=1, align="center", p="xl", color="blue")
165+
header = dmc.Title("My Portfolio", order=1, ta="center", p="xl", c="blue")
166166

167167
app.layout = dmc.MantineProvider(
168168
theme={"colorScheme": "dark"},
169-
withGlobalStyles=True,
169+
withGlobalClasses=True,
170170
children=html.Div(
171171
[
172172
header,
173-
dmc.Grid([dmc.Col(candlestick, span=6), dmc.Col(pie, span=6)]),
173+
dmc.Grid([dmc.GridCol(candlestick, span=6), dmc.GridCol(pie, span=6)]),
174174
html.Div(grid),
175175
], style={"padding":12}
176176
)
@@ -227,7 +227,7 @@ def update_portfolio_stats(_, data):
227227

228228

229229
if __name__ == "__main__":
230-
app.run_server(debug=False)
230+
app.run(debug=False)
231231

232232

233233
"""

more_examples/figure_with_tooltip/custom_tooltip_with_figure.py renamed to more_examples/figure_with_tooltip/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
)])
102102

103103
if __name__ == "__main__":
104-
app.run_server(debug=True)
104+
app.run(debug=True)
105105

106106
"""
107107
Add the following to the dashAgGridComponents.js file in the /assets folder:
@@ -203,4 +203,4 @@
203203
}
204204
))
205205
};
206-
"""
206+
"""

requires-docs.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ dash-mantine-components
88
dash-iconify
99
colorlover
1010
statsmodels
11-

0 commit comments

Comments
 (0)