You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`Tabs.fresh()` creates a fresh graph div and return it and
73
-
-`Tabs.getGraph()` returns the current graph div.
95
+
| Method/Property | Description |
96
+
|------------------------|-------------|
97
+
|`Tabs.fresh([id])`| Creates a fresh graph div and returns it (default id of `graph`). |
98
+
|`Tabs.getGraph([id])`| Returns the default or specified graph div. |
99
+
|`Tabs.plotMock(mock, [id])`| Plots the specified mock (`.json` extension is not required). |
100
+
|`Tabs.snapshot([id])`| Creates a png snapshot of the plot and places it below. |
101
+
|`Tabs.reload()`| Reloads the plotly.js script and will execute `Tabs.onReload` once completed. |
102
+
|`Tabs.onReload()`| By default, set to `noop` but you may set `Tabs.onReload` to any function you wish. This is useful for replotting a mock or test every time you reload the plotly.js script. |
103
+
|`Tabs.purge()`| Destroys all plots. |
104
+
105
+
View [the source](https://github.com/plotly/plotly.js/blob/master/devtools/test_dashboard/devtools.js) for more info.
106
+
107
+
Three additional helpers exist that are refreshed every second:
74
108
75
-
**Other npm scripts**:
109
+
*`gd` - this is the default plot div
110
+
*`fullData` - shortcut to `gd._fullData`
111
+
*`fullLayout` - shortcut to `gd._fullLayout`
112
+
113
+
There is also a search bar in the top right of the dashboard. This fuzzy-searches
114
+
image mocks based on their file name and trace type.
115
+
116
+
#### Other npm scripts
76
117
77
118
-`npm run preprocess`: pre-processes the css and svg source file in js. This
78
119
script must be run manually when updating the css and svg source files.
79
120
-`npm run watch`: starts a watchify file watcher just like the test dashboard but
80
121
without booting up a server.
81
122
82
-
###Testing
123
+
## Testing
83
124
84
125
Both jasmine and image tests are run on
85
126
[CircleCI](https://circleci.com/gh/plotly/plotly.js) on every push to this
@@ -92,6 +133,15 @@ Jasmine tests are run in a browser using
92
133
npm run test-jasmine
93
134
```
94
135
136
+
To run a specific suite, use:
137
+
138
+
```
139
+
npm run test-jasmine -- tests/<suite>.js
140
+
```
141
+
142
+
where the `<suite>` corresponds to the suite's file name as found in [`test/jasmine/tests/`](https://github.com/plotly/plotly.js/tree/master/test/jasmine/tests).
143
+
144
+
95
145
Image pixel comparison tests are run in a docker container. For more
96
146
information on how to run them locally, please refer to [image test
@@ -108,7 +158,7 @@ which shows the baseline image, the generated image, the diff and the json mocks
108
158
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`.
109
159
110
160
111
-
###Repo organization
161
+
## Repo organization
112
162
113
163
- Distributed files are in `dist/`
114
164
- CommonJS require-able modules are in `lib/`
@@ -120,7 +170,7 @@ To view the results of a run on CircleCI, download the `build/test_images/` and
120
170
- Non-distributed, built files are in `build/` (most files in here are git-ignored, the css and font built files are exceptions)
0 commit comments