Skip to content

Commit

Permalink
Merge pull request #11 from jpmorganchase/arrow-input
Browse files Browse the repository at this point in the history
Initial support for loading Apache Arrow data
  • Loading branch information
texodus authored Jan 26, 2018
2 parents 3530e45 + 7abd9f0 commit 2e4640f
Show file tree
Hide file tree
Showing 14 changed files with 456 additions and 47 deletions.
11 changes: 9 additions & 2 deletions packages/perspective-common/common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const plugins = []
if (!process.env.PSP_NO_MINIFY) {
plugins.push(new UglifyJSPlugin({
sourceMap: true,
mangle: false,
output: {
ascii_only: true
}
Expand Down Expand Up @@ -46,9 +47,15 @@ module.exports = function() {
before: ';var window = window || {};exports.load_perspective = function(Module) {',
after: ';return Module;}'
}
}, {
test: /\.(arrow)$/,
use: {
loader: "arraybuffer-loader",
options: {}
}
}, {
test: /\.js$/,
exclude: /node_modules|psp\.js/,
exclude: /node_modules\/(?!\@apache-arrow)|psp\.js/,
loader: "babel-loader",
options: {
presets: ['env'],
Expand All @@ -59,4 +66,4 @@ module.exports = function() {
}]
}
};
}
}
Binary file not shown.
52 changes: 52 additions & 0 deletions packages/perspective-examples/src/html/superstore-arrow.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!--
Copyright (c) 2017, the Perspective Authors.
This file is part of the Perspective library, distributed under the terms of
the Apache License 2.0. The full license can be found in the LICENSE file.
-->

<!DOCTYPE html>
<html>
<head>

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

<script src="mobile_fix.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents.min.js'></script>
<script src="perspective.view.js"></script>
<script src="hypergrid.plugin.js"></script>
<script src="highcharts.plugin.js"></script>

<link rel='stylesheet' href="demo.css">

</head>
<body>

<perspective-viewer
view="vertical"
row-pivots='["Category","Region","Segment"]'
column-pivots='["Sub-Category"]'
columns='["Sales"]'
>

</perspective-viewer>

<script>

window.addEventListener('WebComponentsReady', function () {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'superstore.arrow', true);
xhr.responseType = "arraybuffer"
xhr.onload = function () {
var el = document.getElementsByTagName('perspective-viewer')[0];
el.load(xhr.response);
}
xhr.send(null);
});

</script>

</body>
</html>
1 change: 1 addition & 0 deletions packages/perspective/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(EXTENDED_FLAGS " \
--memory-init-file 1 \
-s NO_EXIT_RUNTIME=1 \
-s NO_FILESYSTEM=1 \
-s NO_DYNAMIC_EXECUTION=1 \
-s EXPORTED_FUNCTIONS=\"['_main']\" \
")

Expand Down
4 changes: 3 additions & 1 deletion packages/perspective/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@
"d3-array": "^1.2.1",
"moment": "^2.19.1",
"papaparse": "^4.3.6",
"underscore": "^1.8.3"
"underscore": "^1.8.3",
"@apache-arrow/es5-esm": "^0.2.0"
},
"devDependencies": {
"@jpmorganchase/perspective-common": "^0.0.2",
"arraybuffer-loader": "^1.0.2",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-async-to-bluebird": "^1.1.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/perspective/src/config/perspective.asmjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const path = require('path');
const common = require('@jpmorganchase/perspective-common/common.config.js');

module.exports = Object.assign({}, common(), {
entry: './src/js/perspective.asmjs.js',
plugins: [],
entry: ["babel-polyfill", './src/js/perspective.asmjs.js'],
output: {
filename: 'perspective.js',
path: path.resolve(__dirname, '../../build/asmjs')
Expand Down
1 change: 0 additions & 1 deletion packages/perspective/src/config/perspective.node.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const common = require('@jpmorganchase/perspective-common/common.config.js');

module.exports = Object.assign({}, common(), {
entry: './src/js/perspective.node.js',
plugins: [],
target: "node",
node: {},
output: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const common = require('@jpmorganchase/perspective-common/common.config.js');

module.exports = Object.assign({}, common(), {
entry: './src/js/perspective.parallel.js',
plugins: [],
output: {
filename: 'perspective.js',
library: "perspective",
Expand Down
Loading

0 comments on commit 2e4640f

Please sign in to comment.