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

Run ESLint on documentation + minor documentation improvements #1069

Merged
merged 6 commits into from
May 28, 2020
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
9 changes: 9 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"parser": "babel-eslint",
"plugins": [
"markdown",
"prettier"
],
"env": {
Expand Down Expand Up @@ -42,6 +43,14 @@
"ignoreTrailingComments": true
}]
}
}, {
"files": ["**/*.md"],
"rules": {
"no-undef": "off",
"no-unused-vars": "off",
"no-console": "off",
"padded-blocks": "off"
}
}],
"rules": {
"prettier/prettier": ["error", {
Expand Down
6 changes: 3 additions & 3 deletions docs/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"blog/2018-10-01-v0.2.0-release": {
"title": "0.2.0 Release"
},
"blog/2018-10-08-nyc-citibike-analysis-1": {
"title": "NYC Citibike Analytics in Real-Time, Part 1"
},
"blog/2019-06-10-v0.3.0-release": {
"title": "0.3.0 Release"
},
Expand All @@ -35,6 +32,9 @@
"md/styles": {
"title": "CSS Styles"
},
"node_modules/react/README": {
"title": "node_modules/react/README"
},
"obj/perspective-python": {
"title": "perspective-python API"
},
Expand Down
43 changes: 26 additions & 17 deletions docs/md/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const schema = {
d: "datetime",
e: "boolean",
f: "string"
}
};
```

Because Perspective is built in multiple languages, data types are
Expand Down Expand Up @@ -123,7 +123,7 @@ To create a `Table` with a `limit`, provide the `limit` property with an integer
indicating the `limit`:

```javascript
const table = perspective.table(data, {limit: 1000})
const table = perspective.table(data, {limit: 1000});
```

`limit` cannot be used in conjunction with `index`.
Expand All @@ -140,7 +140,7 @@ To create an indexed `Table`, provide the `index` property with a string column
name to be used as an index:

```javascript
const table = perspective.table(data, {index: "a"})
const table = perspective.table(data, {index: "a"});
```

An indexed `Table` allows for in-place _updates_ whenever a new rows shares an
Expand Down Expand Up @@ -171,15 +171,18 @@ using the `index` to determine which rows to update:

```javascript
// Create an indexed table
const table = perspective.table({
"id": [1, 2, 3, 4],
"name": ["a", "b", "c", "d"]
}, {index: "id"});
const table = perspective.table(
{
id: [1, 2, 3, 4],
name: ["a", "b", "c", "d"]
},
{index: "id"}
);

// Update rows with primary key `1` and `4`
table.update({
"id": [1, 4],
"name": ["x", "y"]
id: [1, 4],
name: ["x", "y"]
});
```

Expand All @@ -195,10 +198,13 @@ An indexed `Table` can also have rows removed by primary key:

```javascript
// Create an indexed table
const table = perspective.table({
"id": [1, 2, 3, 4],
"name": ["a", "b", "c", "d"]
}, {index: "id"});
const table = perspective.table(
{
id: [1, 2, 3, 4],
name: ["a", "b", "c", "d"]
},
{index: "id"}
);

// Remove rows with primary key `1` and `4`
table.remove([1, 4]);
Expand Down Expand Up @@ -240,17 +246,20 @@ instance via the `view()` method with a set of

```javascript
const table = perspective.table({
"id": [1, 2, 3, 4],
"name": ["a", "b", "c", "d"]
id: [1, 2, 3, 4],
name: ["a", "b", "c", "d"]
});

// Create a view showing just the `name` column.
const view = table.view({
columns: ["name"]
});

// Now you have a `View`! Get your data!
const json = await view.to_json();
// Now you have a `View`! Get your data using ES6 async/await:
const json = async () => await view.to_json();

// or using the Promise API
view.to_arrow().then(arrow => console.log(arrow));

// Delete the Query!
view.delete();
Expand Down
2 changes: 1 addition & 1 deletion docs/md/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ the `build/` directory of every package which supports benchmarks, as well as a
`results.json` file in the `bench/results/`, which can be checked in to GIT with
your changes to preserve them for future comparison.

```javascript
```bash
yarn bench
```

Expand Down
16 changes: 8 additions & 8 deletions docs/md/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ Perspective's additional assets, and is easy to set up in your `webpack.config`:
const PerspectivePlugin = require("@finos/perspective-webpack-plugin");

module.exports = {
entry: "./in.js",
output: {
filename: "out.js",
path: "build"
},
plugins: [new PerspectivePlugin()]
entry: "./in.js",
output: {
filename: "out.js",
path: "build"
},
plugins: [new PerspectivePlugin()]
};
```

Expand All @@ -74,8 +74,8 @@ Once added to your page, you can access the Javascript API through the

```javascript
const worker = perspective.worker();
const table = worker.table({ A: [1, 2, 3] });
const view = table.view({ sort: [["A", "desc"]] });
const table = worker.table({A: [1, 2, 3]});
const view = table.view({sort: [["A", "desc"]]});
```

Or create a `<perspective-viewer>` in HTML:
Expand Down
Loading