-
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 #990 from finos/workspace-fixes
perspective-workspace fixes
- Loading branch information
Showing
14 changed files
with
177 additions
and
149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "remote-workspace", | ||
"private": true, | ||
"version": "0.4.6", | ||
"description": "An example app built using `@finos/perspective-workspace`.", | ||
"scripts": { | ||
"start:server": "webpack-dev-server --open", | ||
"start:client": "node server.js", | ||
"start": "npm-run-all -p start:server start:client" | ||
}, | ||
"keywords": [], | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@finos/perspective": "^0.4.6", | ||
"@finos/perspective-viewer": "^0.4.6", | ||
"@finos/perspective-viewer-d3fc": "^0.4.6", | ||
"@finos/perspective-viewer-datagrid": "^0.4.6", | ||
"@finos/perspective-workspace": "^0.4.6" | ||
}, | ||
"devDependencies": { | ||
"@finos/perspective-webpack-plugin": "^0.4.6", | ||
"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,5 @@ | ||
const perspective = require("@finos/perspective"); | ||
const {securities} = require("../datasources"); | ||
|
||
const host = new perspective.WebSocketServer(); | ||
securities().then(table => host.host_table("securities", table)); |
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,53 @@ | ||
/****************************************************************************** | ||
* | ||
* 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 "@finos/perspective-viewer-datagrid"; | ||
import "@finos/perspective-viewer-d3fc"; | ||
import "@finos/perspective-workspace"; | ||
|
||
import "./index.less"; | ||
|
||
window.addEventListener("load", () => { | ||
const websocket = perspective.websocket("ws://localhost:8080"); | ||
const table = websocket.open_table("securities"); | ||
|
||
const workspace = document.createElement("perspective-workspace"); | ||
document.body.appendChild(workspace); | ||
|
||
workspace.tables.set("superstore", table); | ||
|
||
workspace.restore({ | ||
detail: { | ||
main: { | ||
type: "split-area", | ||
orientation: "horizontal", | ||
children: [ | ||
{ | ||
type: "tab-area", | ||
widgets: ["One"], | ||
currentIndex: 0 | ||
}, | ||
{ | ||
type: "tab-area", | ||
widgets: ["Two"], | ||
currentIndex: 0 | ||
} | ||
], | ||
sizes: [0.5, 0.5] | ||
} | ||
}, | ||
viewers: { | ||
One: {table: "superstore", name: "Heat Map", plugin: "heatmap", "row-pivots": ["client"], columns: ["chg"], "column-pivots": '["name"]'}, | ||
Two: {table: "superstore", name: "Bar Chart", plugin: "x_bar", "row-pivots": ["client"], columns: ["chg"]} | ||
} | ||
}); | ||
|
||
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,24 @@ | ||
/****************************************************************************** | ||
* | ||
* 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 "~@finos/perspective-workspace/dist/theme/material.less"; | ||
|
||
body { | ||
display: flex; | ||
flex-direction: column; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
|
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,34 @@ | ||
/****************************************************************************** | ||
* | ||
* 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"); | ||
|
||
module.exports = { | ||
mode: process.env.NODE_ENV || "development", | ||
entry: "./src/index.js", | ||
output: { | ||
filename: "index.js" | ||
}, | ||
plugins: [ | ||
new HtmlWebPackPlugin({ | ||
title: "Workspace Example" | ||
}), | ||
new PerspectivePlugin({}) | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.less$/, | ||
use: [{loader: "style-loader"}, {loader: "css-loader"}, {loader: "less-loader"}] | ||
} | ||
] | ||
}, | ||
devtool: "source-map" | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.