Skip to content

Commit d29e70f

Browse files
authored
Merge pull request #377 from plotly/minor-fixes
fix: bring `more_examples` up to date and minor formatting fixes in docs
2 parents 5d9a9b5 + 9b1d630 commit d29e70f

File tree

9 files changed

+50
-21
lines changed

9 files changed

+50
-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: 21 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,35 @@ 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

32+
#### The Build Process
33+
34+
Dash AG Grid uses [`dash-generate-components`](https://dash.plotly.com/dash-3-for-component-developers) to read the JavaScript file `src/lib/components/AgGrid.react.js` and generate `dash_ag_grid/AgGrid.py` (along with similar files for R and Julia). `AgGrid.py` only changes when the React component's interface changes, so do not be surprised if internal changes to `AgGrid.react.js` do not result in changes to `AgGrid.py`.
35+
2836
### Versioning
37+
2938
We follow a strict versioning system aligned with the underlying Ag Grid version, but also reserving the
3039
patch number for updates to the Dash grid.
3140

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

4049
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`
4150

42-
### Create a production build
51+
### Create a Production Build
4352

4453
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:
54+
4555
```
4656
npm i
4757
npm run build
4858
```
4959

5060
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:
61+
5162
```
5263
npm run dist
5364
```
5465

55-
### Publish a new release
66+
### Publish a New Release
67+
5668
A Github release with package build files is automatically generated when a new tag starting with `v*` is pushed.
5769

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

6072
Create a git tag:
73+
6174
```
6275
git tag -a 'v31.0,1' -m 'v31.0.1'
6376
git push --tags
6477
```
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!
6678

67-
When the release is published to Github, it's automatically pushed to PyPi as well. You're done 🎉
79+
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.
80+
81+
When the release is published to Github, it's automatically pushed to PyPi as well.
6882

6983
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)