-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #782 from finos/workspace
`PerspectiveDockPanel` and `PerspectiveWorkspace` components
- Loading branch information
Showing
55 changed files
with
2,978 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "phosphor", | ||
"private": true, | ||
"version": "0.3.9", | ||
"description": "An example app built using `@finos/perspective-phosphor`.", | ||
"scripts": { | ||
"start": "webpack-dev-server --open", | ||
"webpack": "webpack --colour" | ||
}, | ||
"keywords": [], | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@finos/perspective": "^0.3.9", | ||
"@finos/perspective-viewer": "^0.3.9", | ||
"@finos/perspective-viewer-d3fc": "^0.3.9", | ||
"@finos/perspective-viewer-hypergrid": "^0.3.9", | ||
"@finos/perspective-phosphor": "^0.3.9" | ||
}, | ||
"devDependencies": { | ||
"@finos/perspective-webpack-plugin": "^0.3.8", | ||
"css-loader": "^0.28.7", | ||
"file-loader": "^4.2.0", | ||
"html-webpack-plugin": "^3.2.0", | ||
"http-server": "^0.11.1", | ||
"less-loader": "^4.0.5", | ||
"npm-run-all": "^4.1.3", | ||
"rimraf": "^2.5.2", | ||
"style-loader": "^0.18.2", | ||
"webpack-cli": "^3.3.7", | ||
"webpack-dev-server": "^3.8.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2018, 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. | ||
* | ||
*/ | ||
|
||
import perspective from "@finos/perspective"; | ||
import {PerspectiveWorkspace, PerspectiveWidget} from "@finos/perspective-phosphor"; | ||
import {Widget} from "@phosphor/widgets"; | ||
import "@finos/perspective-phosphor/src/theme/vaporwave/index.less"; | ||
|
||
import "@finos/perspective-viewer-hypergrid"; | ||
import "@finos/perspective-viewer-d3fc"; | ||
|
||
import "./style/index.less"; | ||
|
||
const worker = perspective.shared_worker(); | ||
const req = fetch("./superstore.arrow"); | ||
|
||
window.addEventListener("load", async () => { | ||
const resp = await req; | ||
const buffer = await resp.arrayBuffer(); | ||
const table = worker.table(buffer); | ||
|
||
const workspace = new PerspectiveWorkspace(); | ||
|
||
const widget1 = new PerspectiveWidget("One", { | ||
"row-pivots": ["Sub-Category"], | ||
columns: ["Profit", "Sales"] | ||
}); | ||
|
||
const widget2 = new PerspectiveWidget("Two", { | ||
plugin: "d3_x_bar", | ||
"row-pivots": ["Region"], | ||
columns: ["Region"] | ||
}); | ||
|
||
const widget3 = new PerspectiveWidget("Three"); | ||
const widget4 = new PerspectiveWidget("Four"); | ||
|
||
workspace.addViewer(widget1); | ||
workspace.addViewer(widget2, {mode: "split-bottom", ref: widget1}); | ||
workspace.addViewer(widget3, {mode: "split-right", ref: widget1}); | ||
workspace.addViewer(widget4, {mode: "split-right", ref: widget2}); | ||
|
||
Widget.attach(workspace, document.body); | ||
|
||
widget1.load(table); | ||
widget2.load(table); | ||
widget3.load(table); | ||
widget4.load(table); | ||
|
||
window.onresize = () => { | ||
workspace.update(); | ||
}; | ||
|
||
window.workspace = workspace; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2018, 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. | ||
* | ||
*/ | ||
|
||
body { | ||
display: flex; | ||
flex-direction: column; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
|
||
#menuBar { | ||
flex: 0 0 auto; | ||
} | ||
|
||
|
||
#main { | ||
flex: 1 1 auto; | ||
} | ||
|
||
|
||
#palette { | ||
min-width: 300px; | ||
border-right: 1px solid #DDDDDD; | ||
} | ||
|
||
|
||
#dock { | ||
padding: 4px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/****************************************************************************** | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
const PerspectivePlugin = require("@finos/perspective-webpack-plugin"); | ||
const HtmlWebPackPlugin = require("html-webpack-plugin"); | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
mode: process.env.NODE_ENV || "development", | ||
entry: "./src/index.js", | ||
output: { | ||
filename: "index.js" | ||
}, | ||
plugins: [ | ||
new HtmlWebPackPlugin({ | ||
title: "Phosphor Example" | ||
}), | ||
new PerspectivePlugin({}) | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.less$/, | ||
use: [{loader: "style-loader"}, {loader: "css-loader"}, {loader: "less-loader"}] | ||
}, | ||
{ | ||
test: /\.(png|jpe?g|gif)$/i, | ||
use: [ | ||
{ | ||
loader: "file-loader" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
devServer: { | ||
contentBase: [path.join(__dirname, "dist"), path.join(__dirname, "../simple")] | ||
}, | ||
devtool: "source-map" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"plugins": [ | ||
"prettier", | ||
"@typescript-eslint/eslint-plugin" | ||
], | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true, | ||
"jasmine": true, | ||
"jest": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2017, | ||
"ecmaFeatures": {}, | ||
"sourceType": "module", | ||
"experimentalObjectRestSpread": true | ||
}, | ||
"rules": { | ||
"prettier/prettier": ["error", { | ||
"printWidth": 200, | ||
"tabWidth": 4, | ||
"bracketSpacing": false | ||
}], | ||
"no-const-assign": "error", | ||
"no-this-before-super": "error", | ||
"no-undef": "error", | ||
"no-unreachable": "error", | ||
"no-unused-vars": "error", | ||
"constructor-super": "error", | ||
"valid-typeof": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.