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

Better usage instructions and less build requirements (rm+cp instead of rsync) #1444

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,26 @@ You can reset the Vega Editor by going to https://vega.github.io/editor/#/reset

## Usage Instructions

To run the editor locally, you must first install the dependencies and then launch a local web server. We assume you have [yarn](https://yarnpkg.com/) installed.
### Run Vega-Editor With Docker
```bash
sudo docker run -it --rm -p 1234:1234 node:21 bash -xc 'mkdir -p vega/editor && git clone --depth=1 https://github.com/vega/editor.git vega/editor && cd vega/editor && yarn && yarn start'
```

1. Install the dependencies:
### Development Setup
We assume you have [yarn](https://yarnpkg.com/), `bash`, `curl`, and `tar` installed.

```
$ yarn
```
Your working copy of this git repository must be located at least two levels below the system root `/`.
E.g. `/home/user/editor` or `/vega/editor`, but not `/editor`.

2. Start the server:
Inside your working copy ...

```
$ yarn start
```
1. Install the dependencies:
`$ yarn`

2. Launch the local web server:
`$ yarn start`

3. The local web server will be accessible from [http://localhost:8080](http://localhost:8080).
3. The local web server will be accessible via [http://localhost:1234](http://localhost:1234).

## Local Testing & Debugging

Expand Down
29 changes: 10 additions & 19 deletions scripts/vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,28 @@ set -e

DATA=public/data
SPEC=public/spec
SCHEMA=schema

CWD=$(pwd)

echo "Copying data to '$DATA'."

if [ ! -d "$DATA" ]; then
mkdir $DATA
fi

eval rsync -r "$CWD/node_modules/vega-datasets/data/*" $DATA
rm -rf "$DATA"
cp -R node_modules/vega-datasets/data/ "$DATA"

echo "Copy examples to '$SPEC'."

if [ ! -d "$SPEC" ]; then
mkdir $SPEC
fi

# without v!
VEGA_VERSION=$(scripts/version.sh vega)
VEGA_LITE_VERSION=$(scripts/version.sh vega-lite)

pushd /tmp
curl https://github.com/vega/vega/archive/refs/tags/v$VEGA_VERSION.tar.gz -L -o vega.tar.gz
curl https://github.com/vega/vega-lite/archive/refs/tags/v$VEGA_LITE_VERSION.tar.gz -L -o vl.tar.gz
tar xzf vega.tar.gz vega-$VEGA_VERSION/docs
tar xzf vl.tar.gz vega-lite-$VEGA_LITE_VERSION/examples vega-lite-$VEGA_LITE_VERSION/site/_data
curl "https://github.com/vega/vega/archive/refs/tags/v$VEGA_VERSION.tar.gz" -L -o vega.tar.gz
curl "https://github.com/vega/vega-lite/archive/refs/tags/v$VEGA_LITE_VERSION.tar.gz" -L -o vl.tar.gz
tar xzf vega.tar.gz "vega-$VEGA_VERSION/docs"
tar xzf vl.tar.gz "vega-lite-$VEGA_LITE_VERSION/examples" "vega-lite-$VEGA_LITE_VERSION/site/_data"
popd

eval rsync -r "/tmp/vega-$VEGA_VERSION/docs/examples/*.vg.json" "$SPEC/vega"
eval rsync -r "/tmp/vega-lite-$VEGA_LITE_VERSION/examples/specs/*.vl.json" "$SPEC/vega-lite/"
rm -rf "$SPEC"
mkdir -p "$SPEC/vega" "$SPEC/vega-lite"
cp "/tmp/vega-$VEGA_VERSION/docs/examples/"*.vg.json "$SPEC/vega"
cp "/tmp/vega-lite-$VEGA_LITE_VERSION/examples/specs/"*.vl.json "$SPEC/vega-lite/"

cp "/tmp/vega-lite-$VEGA_LITE_VERSION/site/_data/examples.json" "$SPEC/vega-lite/index.json"
cp "/tmp/vega-$VEGA_VERSION/docs/_data/examples.json" "$SPEC/vega/index.json"
Loading