Skip to content

Commit df14dd1

Browse files
committed
update instructions for updateplotlyjs command
1 parent bb7ee52 commit df14dd1

1 file changed

Lines changed: 31 additions & 28 deletions

File tree

CONTRIBUTING.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -264,39 +264,42 @@ Two kinds of Jupyter support are included:
264264

265265
### Updating to a New Version of plotly.js
266266

267-
First, update the version of the `plotly.js` dependency in `js/package.json`.
268-
Once you have done that,
269-
run the `updateplotlyjs` command:
267+
1. Create a new branch off of `main`.
270268

271-
```bash
272-
python commands.py updateplotlyjs
273-
```
274-
275-
This downloads new versions of `plot-schema.json` and `plotly.min.js` from the `plotly/plotly.js` GitHub repository
276-
and places them in `codegen/resources/` and `plotly/package_data/`, respectively.
269+
2. Manually update the version of the `plotly.js` dependency in `js/package.json`.
277270

278-
It then does the following:
279-
- Regenerates all of the `graph_objs` classes based on the new schema
280-
- Runs `npm install` in `js/` to refresh `js/package-lock.json` against the new `plotly.js`
281-
- Runs `npm run build` to rebuild the JupyterLab extension and FigureWidget bundles in `plotly/labextension` and `plotly/package_data/widgetbundle.js`.
271+
3. Run the `updateplotlyjs` command:
282272

283-
Commit the updated files under:
284-
- `codegen/resources/`
285-
- `js/`
286-
- `plotly/graph_objs/`
287-
- `plotly/labextension/`
288-
- `plotly/offline/`
289-
- `plotly/package_data/`
273+
```bash
274+
python commands.py updateplotlyjs
275+
```
290276

291-
If you need to skip the `npm` steps entirely (e.g. `npm` isn't available),
292-
set the `SKIP_NPM=1` environment variable:
277+
This command does the following:
293278

294-
```bash
295-
SKIP_NPM=1 python commands.py updateplotlyjs
296-
```
297-
298-
If you do skip it, you'll need to find a way to manually run `npm install && npm run build` in `js/` before committing,
299-
so that the lockfile and build artifacts stay in sync with `js/package.json`.
279+
- Downloads new versions of `plot-schema.json` and `plotly.min.js` from the [plotly.js GitHub repository](https://github.com/plotly/plotly.js)
280+
and places them in `codegen/resources/` and `plotly/package_data/`, respectively.
281+
- Updates `plotly/offline/_plotlyjs_version.py` with the new version
282+
- Regenerates all of the classes under `graph_objs/` (`go.Figure`, `go.Layout`, etc.), and `plotly/validators/_validators.json`, based on the new schema
283+
- Runs `npm install` in `js/` to update `js/package-lock.json`
284+
- Runs `npm run build` in `js/` to rebuild the JupyterLab extension and FigureWidget bundles, which updates the artifacts in `plotly/labextension` and `plotly/package_data/widgetbundle.js`.
285+
286+
> Note: To skip the `npm` steps entirely (e.g. if `npm` isn't available), you can set the `SKIP_NPM=1` environment variable:
287+
>
288+
> ```bash
289+
> SKIP_NPM=1 python commands.py updateplotlyjs
290+
> ```
291+
>
292+
> However, before proceeding further, you'll still need to somehow run `npm install && npm run build` in `js/` before committing, so that the lockfile and build artifacts stay in sync with `js/package.json`.
293+
294+
4. Commit the updated files under:
295+
- `codegen/resources/`
296+
- `js/`
297+
- `plotly/graph_objs/`
298+
- `plotly/labextension/`
299+
- `plotly/offline/`
300+
- `plotly/package_data/`
301+
302+
5. Open a PR into `main`.
300303

301304
### Using a Development Branch of Plotly.js
302305

0 commit comments

Comments
 (0)