@@ -22,47 +22,51 @@ cd plotly.js
22
22
npm install
23
23
```
24
24
25
- ** Step 2** Build plotly.js
25
+ ** Step 2** Start the test dashboard
26
26
27
27
```
28
- npm run build
28
+ npm run start-test_dashboard
29
29
```
30
30
31
- The build script combines:
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.
32
35
33
- - ` npm run preprocess ` , which converts ` scss ` and ` svg ` assets to ` js ` and
34
- - ` npm run bundle ` , which runs
35
- [ browserify] ( https://github.com/substack/node-browserify ) on the source files
36
+ ** Step 3** Open up the console and start developing
36
37
37
- ** Step 3** Start test dashboard
38
+ Make some modification to the source, refresh the page and check the results
39
+ by for example pasting in the console:
38
40
39
- ```
40
- npm run start-test_dashboard
41
+ ``` js
42
+ Plotly . plot ( Tabs . fresh (), [{x : [ 1 , 2 , 3 ], y : [ 2 , 1 , 2 ]}]);
41
43
```
42
44
43
- This command bundles up the source files with source maps, starts
44
- [ watchify] ( https://github.com/substack/watchify ) file watcher (making the your
45
- dev plotly.js bundle update every time a source file is saved) and opens up
46
- a tab in your browser.
45
+ ** Other npm scripts** :
46
+
47
+ - ` npm run preprocess ` : pre-processes the css and svg source file in js. This
48
+ script is run automatically on ` npm install ` .
49
+ - ` npm run watch ` : starts a watchify file watcher just like the test dashboard but
50
+ without booting up a server.
51
+ - ` npm run lint ` : runs jshint on all source files
47
52
48
53
### Testing
49
54
50
- ```
51
- npm test
52
- ```
55
+ Both jasmine and image test are run on
56
+ [ CircleCI ] ( https://circleci.com/gh/plotly/plotly.js ) on every pushes to this
57
+ repo.
53
58
54
59
Jasmine tests are run in a browser using
55
- [ karma] ( https://github.com/karma-runner/karma )
60
+ [ karma] ( https://github.com/karma-runner/karma ) . To run them locally:
56
61
57
62
```
58
63
npm run test-jasmine
59
64
```
60
65
61
- Image pixel comparison tests are run in a docker container
66
+ Image pixel comparison tests are run in a docker container. For more
67
+ information on how to run them locally, please refer to [ image test
68
+ README] ( https://github.com/plotly/plotly.js/blob/master/test/image/README.md ) .
62
69
63
- ```
64
- npm run test-image
65
- ```
66
70
67
71
### Repo organization
68
72
0 commit comments