Skip to content
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

EMF file support #152

Merged
merged 24 commits into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5666916
initial support for EMF file format thanks to Inkscape
antoinerg Nov 27, 2018
e823274
remove PATCH version from docker image name to get updates
antoinerg Nov 27, 2018
035ed22
fix regular expression to match svg attributes with dash
antoinerg Nov 27, 2018
40437c4
circleci: debian-jessie -> debien-strecth to get inkscape 0.9x
antoinerg Nov 27, 2018
25f0bb6
properly check test-mock.emf size and fix lint
antoinerg Nov 27, 2018
e2f2be7
missing deps, need to update package lists
antoinerg Nov 27, 2018
5ed1198
minor code style fix
antoinerg Nov 29, 2018
fc8c755
check Inkscape's version, provide meaning error message when --verbose
antoinerg Nov 30, 2018
1ecb2f4
parse SVG using jsdom instead of regexes
antoinerg Dec 3, 2018
7dddce5
jsdom 13.0.0 -> 11.12.0 to support node.js v6
antoinerg Dec 3, 2018
6b1a1fc
find image elements using jsdom
antoinerg Dec 4, 2018
d4a1bfa
gl3d: use bg color from figure.layout if provided
antoinerg Dec 4, 2018
5432b59
fix lint
antoinerg Dec 4, 2018
212ed21
fix Inkscape unit test
antoinerg Dec 4, 2018
37747b1
relax constraint for Inkscape's version: now requires gte 0.92.x
antoinerg Dec 5, 2018
315a7d6
use different port for orca_serve_graph-only_test.js
antoinerg Dec 5, 2018
48e1e11
npm install with latest npm version
antoinerg Dec 5, 2018
c1822e2
teardown server last, orca should reply 404 instead of ECONNREFUSED
antoinerg Dec 6, 2018
ffc9bfd
cache node_modules only if package-lock.json didn't change
antoinerg Dec 6, 2018
e24f167
install Inkscape in deployment container
antoinerg Dec 6, 2018
e76c52b
improve code readability and style
antoinerg Dec 6, 2018
e4ab53d
safer code which ensures there is a figure.layout object
antoinerg Dec 6, 2018
b6daae1
revert to ubuntu:xenial, install latest Inkscape from a PPA
antoinerg Dec 6, 2018
f117d36
run `apt-get update` prior to installing Inkscape to get latest version
antoinerg Dec 6, 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
11 changes: 6 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
name: Install deps
command: |
npm install
sudo apt-get install poppler-utils libgconf-2-4
sudo apt-get update
sudo apt-get install inkscape poppler-utils libgconf-2-4
- run:
name: List deps
command: |
Expand All @@ -83,16 +84,16 @@ jobs:
test-node-v6:
<<: *base
docker:
- image: circleci/node:6.14.1-browsers
- image: circleci/node:6.14-stretch-browsers

test-node-v8:
<<: *base
docker:
- image: circleci/node:8.11.1-browsers
- image: circleci/node:8.11-stretch-browsers

docker-build-and-push:
docker:
- image: circleci/node:8.11.1-browsers
- image: circleci/node:8.11-stretch-browsers
steps:
- setup_remote_docker:
reusable: true
Expand Down Expand Up @@ -138,7 +139,7 @@ jobs:

electron-pack-and-release:
docker:
- image: circleci/node:8.11.1-browsers
- image: circleci/node:8.11-stretch-browsers
steps:
- restore_cache:
key: v1-source-{{ .Branch }}-{{ .Revision }}
Expand Down
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ npm install -g [email protected] orca

which makes the `orca` executable available in your path.

### Method 3: Standalone binaries
### Method 3: Standalone binaries

Alternatively, you can download the standalone Orca binaries corresponding to
your operating system from the
Expand All @@ -52,7 +52,7 @@ your operating system from the
- A password dialog will appear asking for permission to add orca to your system `PATH`.
- Enter you password and click _OK_.
- This should open an _Installation Succeeded_ window.
- Open a new terminal and verify that the orca executable is available on your `PATH`.
- Open a new terminal and verify that the orca executable is available on your `PATH`.

```
$ which orca
Expand Down Expand Up @@ -100,7 +100,7 @@ to the AppImage.
$ ln -s /path/to/orca-X.Y.Z-x86_64.AppImage /somewhere/on/PATH/orca
```

- Open a new terminal and verify that the orca executable is available on your `PATH`.
- Open a new terminal and verify that the orca executable is available on your `PATH`.

```
$ which orca
Expand All @@ -112,7 +112,7 @@ Plotly's image-exporting utilities
Usage: orca [--version] [--help] <command> [<args>]
...
```

##### Linux Troubleshooting: Cannot open shared object
The Electron runtime depends a several common system libraries. These
libraries are pre-installed in most desktop Linux distributions
Expand Down Expand Up @@ -157,7 +157,7 @@ Name this shell script `orca` and place it somewhere or your system `PATH`.
- How to add directory to system path in Linux: https://www.computerhope.com/issues/ch001647.htm
- AppImage: https://appimage.org/
- Xvfb: https://en.wikipedia.org/wiki/Xvfb

## Quick start

From the command line:
Expand Down Expand Up @@ -286,14 +286,14 @@ Plotly's image server is dockerized and deployed here. See the `deployment/`

## System dependencies

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

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

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

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

#### Poppler installation via Homebrew (third-party package manager for Mac OS X)
Expand All @@ -302,6 +302,17 @@ $ apt-get poppler-utils (requires `sudo` or root privileges)
$ brew install poppler
```

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

```
$ apt-get install inkscape (requires `sudo` or root privileges)
```

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

```
$ brew install inkscape
```
## Contributing

See
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ platform:
#services:

cache:
- node_modules
- node_modules -> package-lock.json
- '%LOCALAPPDATA%\electron\Cache'
- '%LOCALAPPDATA%\electron-builder\cache'

Expand Down
6 changes: 6 additions & 0 deletions bin/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ exports.PLOTLYJS_OPTS_META = [{
alias: ['MathJax'],
dflt: '',
description: `Sets path to MathJax files. Required to export LaTeX characters.`
}, {
name: 'inkscape',
type: 'string',
alias: ['Inkscape'],
dflt: '',
description: `Sets path to Inkscape executable. Required to export WMF and EMF formats.`
}, {
name: 'safe-mode',
type: 'boolean',
Expand Down
3 changes: 2 additions & 1 deletion bin/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ function main (args) {
scale: opts.scale,
width: opts.width,
height: opts.height,
safeMode: opts.safeMode
safeMode: opts.safeMode,
inkscape: opts.inkscape
}
}
})
Expand Down
3 changes: 2 additions & 1 deletion bin/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ function main (args) {
mapboxAccessToken: opts['mapbox-access-token'],
mathjax: opts.mathjax,
topojson: opts.topojson,
safeMode: opts.safeMode
safeMode: opts.safeMode,
inkscape: opts.inkscape
}

function launch () {
Expand Down
Loading