Skip to content

Commit 6e28aeb

Browse files
committed
Merge pull request #33 from plotly/some-docs-updates
Some docs updates
2 parents 2165998 + 6fa52c1 commit 6e28aeb

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ npm install
2828
npm run start-test_dashboard
2929
```
3030

31-
This command bundles up the source files with source maps, starts
32-
a [watchify](https://github.com/substack/watchify) file watcher (making the your
33-
dev plotly.js bundle update every time a source file is saved) and opens up
34-
a tab in your browser.
31+
This command bundles up the source files with source maps using
32+
[browserify](https://github.com/substack/node-browserify), starts a
33+
[watchify](https://github.com/substack/watchify) file watcher (making the your
34+
dev plotly.js bundle update every time a source file is saved) and opens up a
35+
tab in your browser.
3536

3637
**Step 3** Open up the console and start developing
3738

@@ -42,13 +43,15 @@ by for example pasting in the console:
4243
Plotly.plot(Tabs.fresh(), [{x:[1,2,3], y:[2,1,2]}]);
4344
```
4445

46+
- `Tabs.fresh()` creates a fresh graph div and return it and
47+
- `Tabs.getGraph()` returns the current graph div.
48+
4549
**Other npm scripts**:
4650

4751
- `npm run preprocess`: pre-processes the css and svg source file in js. This
4852
script is run automatically on `npm install`.
4953
- `npm run watch`: starts a watchify file watcher just like the test dashboard but
5054
without booting up a server.
51-
- `npm run lint`: runs jshint on all source files
5255

5356
### Testing
5457

@@ -67,7 +70,33 @@ Image pixel comparison tests are run in a docker container. For more
6770
information on how to run them locally, please refer to [image test
6871
README](https://github.com/plotly/plotly.js/blob/master/test/image/README.md).
6972

73+
Running the test locally outputs the generated png images in `build/test_images/` and the png diffs in `build/test_images_diff/` (two git-ignored directories).
74+
75+
To view the image pixel comparison test results, run
76+
77+
```
78+
npm run start-image_viewer
79+
```
80+
which shows the baseline image, the generated image, the diff and the json mocks of test cases that failed.
81+
82+
To view the results of a run on CircleCI, download the `build/test_images/` and `build/test_images_diff/` artifacts into your local repo and then run `npm run start-image_viewer`.
83+
7084

7185
### Repo organization
7286

87+
- Distributed files are in `dist/`
88+
- Sources files are in `src/`, including the index.
89+
- Build and repo management scripts are in `./tasks/`
90+
- All tasks can be run using [`npm run-srcript`](https://docs.npmjs.com/cli/run-script)
91+
- Tests are `test/`, they are partitioned into `image` and `jasmine` tests
92+
- Test dashboard and image viewer code is in `devtools/`
93+
- Non-distributed, git-ignored built files are in `build/`
94+
95+
7396
### Coding style
97+
98+
- 4-space indentation
99+
- semi-colons are required
100+
- trailing commas
101+
102+
Check if ok, with `npm run lint`

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ plotly.js charts can also be created and saved online for free at [plot.ly/plot]
9898
|**Ben Postlethwaite**| [@bpostlethwaite](https://github.com/bpostlethwaite) | |
9999
|**Chris Parmer**| [@chriddyp](https://github.com/chriddyp) | |
100100
|**Chelsea Douglas**| [@cldougl](https://github.com/cldougl) | |
101+
|**Alex Vados**| [@alexander-daniel](https://github.com/alexander-daniel) | |
101102
102103
## Copyright and license
103104

0 commit comments

Comments
 (0)