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

Add new package @finos/perspective-workspace #874

Merged
merged 5 commits into from
Jan 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
61 changes: 0 additions & 61 deletions examples/phosphor/src/index.js

This file was deleted.

35 changes: 35 additions & 0 deletions examples/simple/workspace.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--

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, user-scalable=no">

<!-- <script src="perspective-viewer.js"></script> -->
<script src="perspective-workspace.js"></script>
<script src="perspective-viewer-hypergrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>

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

<link rel='stylesheet' href="index.css">
<link rel='stylesheet' href="material.css" is="custom-style">

</head>

<body>

<perspective-workspace></perspective-workspace>

</body>

</html>
31 changes: 31 additions & 0 deletions examples/simple/workspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/******************************************************************************
*
* 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 datasource = async () => {
const req = fetch("./superstore.arrow");
const resp = await req;
const buffer = await resp.arrayBuffer();
const worker = window.perspective.shared_worker();
return worker.table(buffer);
};

window.addEventListener("WebComponentsReady", async function() {
const workspace = document.getElementsByTagName("perspective-workspace")[0];
workspace.addTable("superstore", await datasource());

const config = {
detail: {
main: {
currentIndex: 0,
type: "tab-area",
widgets: [{table: "superstore"}]
}
}
};
workspace.restore(config);
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "phosphor",
"name": "workspace",
"private": true,
"version": "0.4.1",
"description": "An example app built using `@finos/perspective-phosphor`.",
Expand Down
52 changes: 52 additions & 0 deletions examples/workspace/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/******************************************************************************
*
* 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-workspace";

import "@finos/perspective-viewer-hypergrid";
import "@finos/perspective-viewer-d3fc";

import "./index.less";

const datasource = async () => {
const req = fetch("./superstore.arrow");
const resp = await req;
const buffer = await resp.arrayBuffer();
const worker = perspective.shared_worker();
return worker.table(buffer);
};

window.addEventListener("load", async () => {
const workspace = document.createElement("perspective-workspace");
document.body.append(workspace);
workspace.addTable("superstore", await datasource());

const config = {
master: {
widgets: [
{table: "superstore", name: "Three", "row-pivots": ["State"], columns: ["Sales", "Profit"]},
{table: "superstore", name: "Four", "row-pivots": ["Category", "Sub-Category"], columns: ["Sales", "Profit"]}
]
},
detail: {
main: {
currentIndex: 0,
type: "tab-area",
widgets: [
{table: "superstore", name: "One"},
{table: "superstore", name: "Two"}
]
}
}
};

workspace.restore(config);
window.workspace = workspace;
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* 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;
Expand All @@ -20,21 +22,3 @@ body {
overflow: hidden;
}

#menuBar {
flex: 0 0 auto;
}

#main {
flex: 1 1 auto;
}


#palette {
min-width: 300px;
border-right: 1px solid #DDDDDD;
}


#dock {
padding: 4px;
}
9 changes: 2 additions & 7 deletions packages/perspective-phosphor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@
"bench": "npm-run-all bench:build bench:run",
"bench:build": "echo \"No Benchmarks\"",
"bench:run": "echo \"No Benchmarks\"",
"build": "npm-run-all build:esm build:cjs build:styles build:umd",
"build": "npm-run-all build:esm build:cjs build:umd",
"build:esm": "tsc --p ./config --outDir dist/esm",
"build:cjs": "webpack --color --config config/webpack.config.js",
"build:styles": "webpack --color --config config/webpack.theme.config.js",
"build:umd": "webpack --color --config config/webpack.umd.config.js",
"clean": "rimraf dist",
"clean:screenshots": "rimraf \"screenshots/**/*.@(failed|diff).png\"",
"test": "yarn test:run",
"test:run": "npm-run-all test:unit test:integration",
"test:unit": "jest --color --silent --config=./config/jest.unit.config.js 2>&1",
"test:integration": "jest --color --silent --noStackTrace --config=./config/jest.integration.config.js 2>&1"
"test": "echo \"No Tests\""
},
"dependencies": {
"@finos/perspective": "^0.4.1",
Expand Down
17 changes: 0 additions & 17 deletions packages/perspective-phosphor/src/theme/default/index.less

This file was deleted.

33 changes: 0 additions & 33 deletions packages/perspective-phosphor/src/theme/default/tabbar.less

This file was deleted.

11 changes: 0 additions & 11 deletions packages/perspective-phosphor/src/theme/material/index.less

This file was deleted.

This file was deleted.

43 changes: 0 additions & 43 deletions packages/perspective-phosphor/src/theme/material/widget.less

This file was deleted.

Loading