Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4ec1c8e
Updated CircleCI badge
JamesCropcho Apr 25, 2018
164c60f
Initial pass over README, to update name(s)
JamesCropcho Apr 25, 2018
2b1087b
Let's at least be consistent with our heading capitalization
JamesCropcho Apr 25, 2018
2e8334b
Updating code to use `orca` as name of npm `const`
JamesCropcho Apr 25, 2018
6bc94a8
Update contributing instructions
JamesCropcho Apr 25, 2018
03bcd9f
Basic comprehensive overhaul of naming to Orca
JamesCropcho Apr 25, 2018
6b6a149
More careful combing-pass, for renaming to Orca
JamesCropcho Apr 25, 2018
4117415
Fixed Orca renaming issue in /bin/orca.js
JamesCropcho Apr 25, 2018
8c4ed93
Fixing CircleCI and electron-build configurations as related to renam…
JamesCropcho Apr 25, 2018
d16349c
Fixing Travis-CI path configuration as related to renaming to Orca
JamesCropcho Apr 25, 2018
a84c1b2
Reverting Docker image name
JamesCropcho Apr 25, 2018
ac7f956
Continuted reversion of Docker image name
JamesCropcho Apr 25, 2018
ec5929b
Fixing Quay issue regarding Orca vs Image-Exporter
JamesCropcho Apr 25, 2018
b57bfc8
"Not sure we want that Open-source Report Creator App bit in our titl…
JamesCropcho Apr 25, 2018
9aefae3
Trying to add libgtk2.0-0 installation as a means to fix Docker smoke…
JamesCropcho Apr 25, 2018
2293649
Triggering a build due to nondeterministic (?) CircleCI failure
JamesCropcho Apr 25, 2018
d12cc3e
"test/integration/orca_test.js would be best."
JamesCropcho May 1, 2018
94d1e96
"let's go with orca-build"
JamesCropcho May 1, 2018
42b097e
"same here orca-build"
JamesCropcho May 1, 2018
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ jobs:
- node_modules
- run: mkdir artifacts
- run: mv release/*.yml artifacts || true
- run: mv release/plotly-image-exporter* artifacts
- run: mv release/orca* artifacts
- store_artifacts:
path: artifacts
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install:

script:
- npm run pack
- zip mac-release.zip release/Plotly\ Graph\ Exporter*
- zip mac-release.zip release/Plotly\ Orca*

before_cache:
- rm -rf $HOME/.cache/electron-builder/wine
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing to Plotly Image Exporter
# Contributing to Orca

Note that this section targets contributors. If you're interested in using the
standalone app, [download the latest
release.](https://github.com/plotly/image-exporter/releases).
release.](https://github.com/plotly/orca/releases).

## Dev Installation

Expand Down Expand Up @@ -73,7 +73,7 @@ npm run test:integration
## Packaging

We use [`electron-builder`](https://github.com/electron-userland/electron-builder) to pack up
the `plotly-graph-exporter` executable. To do so locally, run:
the `orca` executable. To do so locally, run:

```
npm run pack
Expand All @@ -98,7 +98,7 @@ _pure_ Node.js and are tested in `test/unit/` using
[TAP](http://www.node-tap.org/). The Electron logic is itself tested using
[Spectron](https://github.com/electron/spectron) which is much slower.

### Anatomy of an image-exporter component
### Anatomy of an Orca component

Along with a `name` field, each component has a `ping`, an `inject`, a `parse`,
a `render` and a `convert` method:
Expand All @@ -121,7 +121,7 @@ main and renderer process at once.

### Nomenclature for IPC callbacks

Image exporter is a heavy user of Electron's IPC (inter-process-communication)
Orca is a heavy user of Electron's IPC (inter-process-communication)
which in turn is callback heavy. To help us stay out of _callback hell_, we use
the following terms to designates callbacks:

Expand All @@ -141,7 +141,7 @@ the following terms to designates callbacks:

### What happened to `nw.js`?

Older plotly devs might remember our old `nw.js` image server, but yeah
Older Plotly devs might remember our old `nw.js` image server, but yeah
Electron is way better than `nw.js` and a lot more people are using it. Using
it for this project was a no-brainier.

Expand Down
68 changes: 34 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# Plotly Image Exporter
# Plotly Orca

[![CircleCI](https://circleci.com/gh/plotly/image-exporter.svg?style=svg)](https://circleci.com/gh/plotly/image-exporter)
[![CircleCI](https://circleci.com/gh/plotly/orca.svg?style=svg)](https://circleci.com/gh/plotly/orca)

This repo contains source code for:

- `plotly-graph-exporter` standalone app,
- `plotly-image-exporter` npm package, and
- `orca` standalone app,
- `orca` npm package, and
- Plotly's image server

## `plotly-graph-exporter` standalone app
## `orca` standalone app

### Install

To start using the `plotly-graph-exporter` standalone app, simply download the
To start using the `orca` standalone app, simply download the
binaries corresponding to your operating system from the
[release](https://github.com/plotly/image-exporter/releases) page.
[release](https://github.com/plotly/orca/releases) page.

### Usage

From the command line:

```
$ plotly-graph-exporter '{ "data": ["y": [1,2,3]] }' -o fig.png
$ orca '{ "data": ["y": [1,2,3]] }' -o fig.png
```

generates a PNG from the inputted plotly.js JSON attributes. To print info
about the supported arguments:

```
$ plotly-graph-exporter --help
$ orca --help
```

From a Python script:
Expand All @@ -38,7 +38,7 @@ from subprocess import call
import json

fig = {"data": [{"y": [1,2,1]}]}
call(['plotly-graph-exporter', json.dumps(fig)])
call(['orca', json.dumps(fig)])
```

From an R script:
Expand All @@ -48,38 +48,38 @@ library(plotly)
p <- plot_ly(x = 1:10, y = 1:10, color = 1:10)
b <- plotly_build(p)$x[c("data", "layout")]
json <- plotly:::to_JSON(b)
cmd <- sprintf("plotly-graph-exporter '%s' -o r-export-test.png", json)
cmd <- sprintf("orca '%s' -o r-export-test.png", json)
system(cmd)
```

## `plotly-image-exporter` npm package
## `orca` npm package

### Install

With Node.js (v6.x or v8.x) and npm installed:

```
$ npm install -g electron plotly-image-exporter
$ npm install -g electron orca
```

which installs two executables `plotly-graph-exporter` and `plotly-export-server`
which installs two executables `orca` and `plotly-export-server`

### CLI Usage
### CLI usage

The `plotly-graph-exporter` executable works the same as the
`plotly-graph-exporter` standalone app except that it uses the Node.js and
The `orca` executable works the same as the
`orca` standalone app except that it uses the Node.js and
Electron versions that are installed locally. For example,

```
$ plotly-graph-exporter https://plot.ly/~empet/14324.json --format svg
$ orca https://plot.ly/~empet/14324.json --format svg
```

generates an SVG from a plotly.js JSON hosted on [plot.ly](https://plot.ly/).

In turn, the `plotly-export-server`executable work similarly to plotly's own
image server where not only plotly.js graphs can be exported, but also plotly
dashboards, thumbnails and dash reports (see full list
[here](https://github.com/plotly/image-exporter/tree/master/src/component)).
In turn, the `orca`executable work similarly to Plotly's own
image server where not only plotly.js graphs can be exported, but also Plotly
dashboards, thumbnails and Dash reports (see full list
[here](https://github.com/plotly/orca/tree/master/src/component)).

Boot up the server with:

Expand All @@ -94,10 +94,10 @@ $ curl localhost:9090/plotly-graph/ <payload>
$ curl localhost:9090/plotly-dashboard/ <payload>
```

### API Usage
### API usage

Using the `plotly-image-exporter` module allows developers to build their own
plotly exporting tool. We export two Electron app creator methods `run` and
Using the `orca` module allows developers to build their own
Plotly exporting tool. We export two Electron app creator methods `run` and
`server`. Both methods return an Electron `app` object (which is an event
listener/emitter).

Expand All @@ -106,9 +106,9 @@ To create a _runner_ app:
```js
// main.js

var plotlyExporter = require('plotly-exporter')
var orca = require('orca')

var app = plotlyExporter.run({
var app = orca.run({
component: 'plotly-graph',
input: 'path-to-file' || 'glob*' || url || '{data: [], layout: {}}' || [/* array of those */],
debug: true
Expand All @@ -131,9 +131,9 @@ Or to create a _server_ app:
```js
// main.js

var plotlyExporter = require('plotly-exporter')
var orca = require('orca')

var app = plotlyExporter.serve({
var app = orca.serve({
port: 9090,
component: 'component name ' || [{
name: 'plotly-graph',
Expand Down Expand Up @@ -171,21 +171,21 @@ then launch it with `electron main.js`
## Plotly's image server

Plotly's image server is dockerized and deployed here. See the `deployment/`
[README](https://github.com/plotly/image-exporter/tree/master/deployment) for more info.
[README](https://github.com/plotly/orca/tree/master/deployment) for more info.

## System dependencies

**If you don't care about exporting EPS you can skip this section.**

The environment you're installing this into may require Poppler for EPS exports.

#### Poppler Installation via Aptitude (used by some \*nix/BSD, e.g. Ubuntu)
#### Poppler installation via Aptitude (used by some \*nix/BSD, e.g. Ubuntu)

```
$ apt-get poppler-utils (requires `sudo` or root privileges)
```

#### Poppler Installation via Homebrew (third-party package manager for Mac OS X)
#### Poppler installation via Homebrew (third-party package manager for Mac OS X)

```
$ brew install poppler
Expand All @@ -194,11 +194,11 @@ $ brew install poppler
## Contributing

See
[CONTRIBUTING.md](https://github.com/plotly/image-exporter/blob/master/CONTRIBUTING.md).
[CONTRIBUTING.md](https://github.com/plotly/orca/blob/master/CONTRIBUTING.md).
You can also [contact us](https://plot.ly/products/consulting-and-oem/) if you
would like a specific feature added.

## License

Code released under the MIT ©
[License](https://github.com/plotly/image-exporter/blob/master/LICENSE).
[License](https://github.com/plotly/orca/blob/master/LICENSE).
6 changes: 3 additions & 3 deletions bin/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ const makeFormatAliases = (config) => {
exports.getExporterHelpMsg = function () {
const formatAliases = makeFormatAliases(EXPORTER_MINIMIST_CONFIG)

return `plotly-graph-exporter
return `orca

Usage:

$ plotly-graph-exporter [path/to/json/file(s), URL(s), glob(s), '{"data":[],"layout":{}}'] {options}
$ orca [path/to/json/file(s), URL(s), glob(s), '{"data":[],"layout":{}}'] {options}

$ cat plot.json | plotly-graph-exporter {options} > plot.png
$ cat plot.json | orca {options} > plot.png

Options:

Expand Down
3 changes: 3 additions & 0 deletions bin/orca.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node

require('./spawn-electron')('orca_electron.js')
3 changes: 0 additions & 3 deletions bin/plotly-graph-exporter.js

This file was deleted.

4 changes: 2 additions & 2 deletions deployment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM ubuntu:xenial
# From: https://github.com/nodejs/docker-node/blob/master/6.11/Dockerfile

RUN apt-get update && apt-get install -y --no-install-recommends \
gnupg curl ca-certificates xz-utils wget libgconf-2-4 \
gnupg curl ca-certificates xz-utils wget libgtk2.0-0 libgconf-2-4 \
&& rm -rf /var/lib/apt/lists/* && apt-get clean

RUN groupadd --gid 1000 node \
Expand Down Expand Up @@ -85,7 +85,7 @@ RUN apt-get update -y && apt-get install -y subversion && \
apt-get --auto-remove -y remove subversion

####################
# Copy and set up image-exporter
# Copy and set up Orca

RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' && \
Expand Down
Loading