8000 README and CONTRIBUTING updates by etpinard · Pull Request #3 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

README and CONTRIBUTING updates #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 17, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update CONTRIBUTING and image-test README
  • Loading branch information
etpinard committed Nov 17, 2015
commit d4efd4ea78706f94d7568c91f69014f1b6b81eb9
46 changes: 25 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,51 @@ cd plotly.js
npm install
```

**Step 2** Build plotly.js
**Step 2** Start the test dashboard

```
npm run build
npm run start-test_dashboard
```

The build script combines:
This command bundles up the source files with source maps, starts
a [watchify](https://github.com/substack/watchify) file watcher (making the your
dev plotly.js bundle update every time a source file is saved) and opens up
a tab in your browser.

- `npm run preprocess`, which converts `scss` and `svg` assets to `js` and
- `npm run bundle`, which runs
[browserify](https://github.com/substack/node-browserify) on the source files
**Step 3** Open up the console and start developing

**Step 3** Start test dashboard
Make some modification to the source, refresh the page and check the results
by for example pasting in the console:

```
npm run start-test_dashboard
```js
Plotly.plot(Tabs.fresh(), [{x:[1,2,3], y:[2,1,2]}]);
```

This command bundles up the source files with source maps, starts
[watchify](https://github.com/substack/watchify) file watcher (making the your
dev plotly.js bundle update every time a source file is saved) and opens up
a tab in your browser.
**Other npm scripts**:

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

### Testing

```
npm test
```
Both jasmine and image test are run on
[CircleCI](https://circleci.com/gh/plotly/plotly.js) on every pushes to this
repo.

Jasmine tests are run in a browser using
[karma](https://github.com/karma-runner/karma)
[karma](https://github.com/karma-runner/karma). To run them locally:

```
npm run test-jasmine
```

Image pixel comparison tests are run in a docker container
Image pixel comparison tests are run in a docker container. For more
information on how to run them locally, please refer to [image test
README](https://github.com/plotly/plotly.js/blob/master/test/image/README.md).

```
npm run test-image
```

### Repo organization

Expand Down
11 changes: 6 additions & 5 deletions test/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,28 @@ Test plotly.js with Plotly Image-Server docker container.
Under your `plotly.js` folder, run

```bash
$ docker run -d --name imagetest \
docker run -d --name imagetest \
-v $PWD:/var/www/streambed/image_server/plotly.js \
-p 9010:9010 -p 2022:22 plotly/imageserver:[version]
```

where `[version]` is the latest Plotly Image-Server docker container version
as listed on
[hub.docker.com](https://hub.docker.com/r/plotly/imageserver/tags/).
[hub.docker.com](https://hub.docker.com/r/plotly/imageserver/tags/) and
`imagetest` is the name of the docker container.

### Run the tests

Under your `plotly.js` folder, run

```bash
$ npm run test-image
npm run test-image
```

### SSH into docker

```bash
$ ssh -p 2022 root@localhost # with password `root`
ssh -p 2022 root@localhost # with password `root`
```

If you got this error:
Expand All @@ -52,7 +53,7 @@ Host key verification failed.
simply run

```bash
$ ssh-keygen -f "${HOME}/.ssh/known_hosts" -R [localhost]:2022
ssh-keygen -f "${HOME}/.ssh/known_hosts" -R [localhost]:2022
```

to remove host information.
Expand Down
0