Skip to content

Commit

Permalink
Merge pull request #639 from finos/moa-refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
texodus authored Jul 1, 2019
2 parents 1e456d0 + 79406c4 commit a912c9f
Show file tree
Hide file tree
Showing 84 changed files with 582 additions and 1,285 deletions.
7 changes: 4 additions & 3 deletions cpp/perspective/src/cpp/emscripten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ namespace binding {

template <typename T, typename F = T, typename O = T>
val
col_to_typed_array(std::vector<t_tscalar> data) {
col_to_typed_array(std::vector<t_tscalar> const& data) {
int data_size = data.size();
std::vector<T> vals;
vals.reserve(data.size());
Expand Down Expand Up @@ -593,7 +593,7 @@ namespace binding {

template <>
val
col_to_typed_array<bool>(std::vector<t_tscalar> data) {
col_to_typed_array<bool>(std::vector<t_tscalar> const& data) {
int data_size = data.size();

std::vector<std::int8_t> vals;
Expand Down Expand Up @@ -631,7 +631,7 @@ namespace binding {

template <>
val
col_to_typed_array<std::string>(std::vector<t_tscalar> data) {
col_to_typed_array<std::string>(std::vector<t_tscalar> const& data) {
int data_size = data.size();

t_vocab vocab;
Expand Down Expand Up @@ -690,6 +690,7 @@ namespace binding {
case DTYPE_INT16: {
return col_to_typed_array<std::int16_t>(data);
} break;
case DTYPE_DATE:
case DTYPE_TIME: {
return col_to_typed_array<double, t_date, std::int32_t>(data);
} break;
Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"md/usage": {
"title": "User Guide"
},
"obj/perspective-viewer": {
"title": "`perspective-viewer` API"
},
"obj/perspective": {
"title": "`perspective` API"
},
"README": {
"title": "README"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/md/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cp -r node_modules/@finos/perspective/build my_build/assets/

By far the easiest way to get started with Perspective in the browser, the full
library can be used directly from
[unpkg.com](https://unpkg.com/@finos/perspective-examples/build/perspective.view.js)
[unpkg.com](https://unpkg.com/@finos/perspective-examples/build/perspective-viewer.js)
CDN by simply adding these scripts to your `.html`'s `<head>` section:

```html
Expand Down
6 changes: 3 additions & 3 deletions docs/md/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ you can just import the pre-bundled assets from their respective modules, which
export their default visualizations.

```html
<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<!-- Theme available separately if you are so inclined -->
<link rel='stylesheet' href='material.css'>
Expand Down
8 changes: 4 additions & 4 deletions docs/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const siteConfig = {

scripts: [
"https://buttons.github.io/buttons.js",
"https://unpkg.com/@finos/perspective/build/perspective.js",
"https://unpkg.com/@finos/perspective-viewer/build/perspective.view.js",
"https://unpkg.com/@finos/perspective-viewer-hypergrid/build/hypergrid.plugin.js",
"https://unpkg.com/@finos/perspective-viewer-d3fc/build/d3fc.plugin.js",
"https://unpkg.com/@finos/perspective",
"https://unpkg.com/@finos/perspective-viewer",
"https://unpkg.com/@finos/perspective-viewer-hypergrid",
"https://unpkg.com/@finos/perspective-viewer-d3fc",
"js/animation.js"
],

Expand Down
8 changes: 4 additions & 4 deletions examples/git_history/chained.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>

Expand All @@ -29,7 +29,7 @@

<perspective-viewer
id="view1"
view="d3_y_area"
plugin="d3_y_area"
row-pivots='["week_bucket(Date)"]'
column-pivots='["Email"]'
columns='["Hash"]'
Expand Down
8 changes: 4 additions & 4 deletions examples/git_history/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>

Expand All @@ -29,7 +29,7 @@

<perspective-viewer
id="view1"
view="d3_y_area"
plugin="d3_y_area"
row-pivots='["week_bucket(Date)"]'
column-pivots='["Email"]'
columns='["Hash"]'
Expand Down
8 changes: 4 additions & 4 deletions examples/remote/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>

Expand All @@ -29,7 +29,7 @@

<perspective-viewer
id="view1"
view="d3_heatmap"
plugin="d3_heatmap"
row-pivots='["client"]'
columns='["chg"]'
column-pivots='["name"]'>
Expand Down
8 changes: 4 additions & 4 deletions examples/simple/citibike.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.js"></script>
<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>

Expand Down Expand Up @@ -73,7 +73,7 @@
sort='[["num_bikes_available","desc"]]'>
</perspective-viewer>
<perspective-viewer
view='d3_xy_scatter'
plugin='d3_xy_scatter'
row-pivots='["name"]'
columns='["lon","lat","num_bikes_available"]'
sort='[["num_bikes_available","asc"]]'>
Expand Down
6 changes: 3 additions & 3 deletions examples/simple/csv.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>
<script src="csv.js"></script>
Expand Down
8 changes: 4 additions & 4 deletions examples/simple/investing.ohlc.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="../perspective.view.js"></script>
<script src="../hypergrid.plugin.js"></script>
<script src="../d3fc.plugin.js"></script>
<script src="../perspective-viewer.js"></script>
<script src="../perspective-viewer-hypergrid.js"></script>
<script src="../perspective-viewer-d3fc.js"></script>

<script src="../perspective.js"></script>

Expand All @@ -29,7 +29,7 @@

<div id="container">

<perspective-viewer class="example-chart" view="d3_ohlc" row-pivots='["Date"]' column-pivots='[]' filters='[]'
<perspective-viewer class="example-chart" plugin="d3_ohlc" row-pivots='["Date"]' column-pivots='[]' filters='[]'
sort='[]' columns='["Open","Price","High","Low"]'
aggregates='{"Date":"distinct count","Change%":"sum","High":"sum","Low":"sum","Open":"sum","Price":"sum","Vol.":"sum"}'>

Expand Down
8 changes: 4 additions & 4 deletions examples/simple/linked.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>

Expand Down Expand Up @@ -54,7 +54,7 @@

</perspective-viewer>

<perspective-viewer view="d3_sunburst" row-pivots='["Sub-Category","Region","Segment"]' sort='[["Profit","desc"]]' columns='["Sales", "Profit"]'>
<perspective-viewer plugin="d3_sunburst" row-pivots='["Sub-Category","Region","Segment"]' sort='[["Profit","desc"]]' columns='["Sales", "Profit"]'>

</perspective-viewer>

Expand Down
6 changes: 3 additions & 3 deletions examples/simple/streaming.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>
<script src="streaming.js"></script>
Expand Down
8 changes: 4 additions & 4 deletions examples/simple/superstore-arrow.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

<script src="perspective.js"></script>

Expand All @@ -28,7 +28,7 @@

<body>

<perspective-viewer view="d3_sunburst" row-pivots='["Sub-Category","Region","Segment"]' sort='[["Profit","desc"]]' columns='["Sales", "Profit"]'>
<perspective-viewer plugin="d3_sunburst" row-pivots='["Sub-Category","Region","Segment"]' sort='[["Profit","desc"]]' columns='["Sales", "Profit"]'>

</perspective-viewer>

Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,18 @@
"jsdoc-babel": "^0.5.0",
"jsdoc-to-markdown": "^4.0.1",
"lerna": "^2.11.0",
"mini-css-extract-plugin": "^0.6.0",
"mini-css-extract-plugin": "^0.7.0",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"npm-run-all": "^4.1.3",
"on-build-webpack": "^0.1.0",
"pre-commit": "^1.2.2",
"prettier": "^1.14.2",
"rimraf": "^2.6.2",
"sinon": "^7.3.1",
"ts-loader": "^3.5.0",
"ts-loader": "^6.0.4",
"typescript": "~2.9.2",
"webpack": "^4.31.0",
"webpack-cli": "^3.3.2"

},
"pre-commit": [
"precommit"
Expand Down
6 changes: 3 additions & 3 deletions packages/perspective-bench/bench/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ const JPMC_VERSIONS = [
const FINOS_VERSIONS = ["0.3.0-rc.3", "0.3.0-rc.2", "0.3.0-rc.1"];

async function run() {
await PerspectiveBench.run("master", "bench/perspective.benchmark.js", `http://host.docker.internal:8080/perspective.js`, {output: "build/benchmark", puppeteer: true});
await PerspectiveBench.run("master", "bench/perspective.benchmark.js", `http://host.docker.internal:8080/perspective.js`, {output: "dist/benchmark", puppeteer: true});

for (const version of FINOS_VERSIONS) {
const url = `https://unpkg.com/@finos/perspective@${version}/build/perspective.js`;
await PerspectiveBench.run(version, "bench/perspective.benchmark.js", url, {
output: "build/benchmark",
output: "dist/benchmark",
read: true,
puppeteer: true
});
Expand All @@ -49,7 +49,7 @@ async function run() {
for (const version of JPMC_VERSIONS) {
const url = `https://unpkg.com/@jpmorganchase/perspective@${version}/build/perspective.js`;
await PerspectiveBench.run(version, "bench/perspective.benchmark.js", url, {
output: "build/benchmark",
output: "dist/benchmark",
read: true,
puppeteer: true
});
Expand Down
6 changes: 3 additions & 3 deletions packages/perspective-bench/src/html/benchmark.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-highcharts.js"></script>

<link rel='stylesheet' href="index.css">
<link rel='stylesheet' href="material.css" is="custom-style">
Expand Down
6 changes: 3 additions & 3 deletions packages/perspective-cli/src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="d3fc.plugin.js"></script>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>
<script src="perspective.js"></script>
<link rel='stylesheet' href="material.css">

Expand Down
2 changes: 1 addition & 1 deletion packages/perspective-cli/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
*/

const {WebSocketServer, table} = require("@finos/perspective/build/perspective.node.js");
const {WebSocketServer, table} = require("@finos/perspective");
const {read_stdin, open_browser} = require("./utils.js");
const fs = require("fs");
const path = require("path");
Expand Down
7 changes: 1 addition & 6 deletions packages/perspective-jupyterlab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,13 @@
"@finos/perspective-webpack-plugin": "^0.3.1",
"@types/jest": "^23.3.9",
"@types/node": "^11.11.0",
"css-loader": "^0.26.1",
"file-loader": "^0.11.1",
"identity-obj-proxy": "^3.0.0",
"isomorphic-fetch": "^2.2.1",
"jest": "^23.6.0",
"jest-transform-css": "^2.0.0",
"rimraf": "^2.5.2",
"source-map-support": "^0.5.9",
"style-loader": "^0.13.1",
"ts-jest": "^23.10.4",
"typescript": "^3.2.4",
"webpack": "^2.2.1"
"typescript": "^3.2.4"
},
"jupyterlab": {
"extension": "dist/index.js"
Expand Down
Loading

0 comments on commit a912c9f

Please sign in to comment.