File tree Expand file tree Collapse file tree 10 files changed +67
-77
lines changed Expand file tree Collapse file tree 10 files changed +67
-77
lines changed Original file line number Diff line number Diff line change 1
- const {
2
- NodeModulesExternal,
3
- } = require ( "@finos/perspective-esbuild-plugin/external" ) ;
4
- const { build } = require ( "@finos/perspective-esbuild-plugin/build" ) ;
5
1
const { BuildCss } = require ( "@prospective.co/procss/target/cjs/procss.js" ) ;
6
2
const fs = require ( "fs" ) ;
7
3
const path_mod = require ( "path" ) ;
4
+ const esbuild = require ( "esbuild" ) ;
5
+
6
+ const DEFAULT_BUILD = {
7
+ target : [ "es2022" ] ,
8
+ bundle : true ,
9
+ minify : ! process . env . PSP_DEBUG ,
10
+ sourcemap : true ,
11
+ metafile : true ,
12
+ entryNames : "[name]" ,
13
+ chunkNames : "[name]" ,
14
+ assetNames : "[name]" ,
15
+ } ;
16
+
17
+ /**
18
+ * An `esbuild` plugin to mark `node_modules` dependencies as external.
19
+ * @returns
20
+ */
21
+ function NodeModulesExternal ( whitelist ) {
22
+ function setup ( build ) {
23
+ build . onResolve ( { filter : / ^ [ A - Z a - z 0 - 9 \@ ] / } , ( args ) => {
24
+ return {
25
+ path : args . path ,
26
+ external : true ,
27
+ namespace : "skip-node-modules" ,
28
+ } ;
29
+ } ) ;
30
+ }
31
+
32
+ return {
33
+ name : "node_modules_external" ,
34
+ setup,
35
+ } ;
36
+ }
37
+
38
+ /**
39
+ * A build convenienve wrapper.
40
+ * @param {any } config An `esbuild.build` config.
41
+ */
42
+ async function build ( config ) {
43
+ await esbuild . build ( {
44
+ ...DEFAULT_BUILD ,
45
+ ...config ,
46
+ } ) ;
47
+ }
8
48
9
49
const BUILD = [
10
50
{
Original file line number Diff line number Diff line change 1
1
<!doctype html>
2
2
< html >
3
3
< head >
4
- < script
5
- type ="module "
6
- src ="../node_modules/@finos/perspective/dist/cdn/perspective.js "
7
- > </ script >
8
- < script
9
- type ="module "
10
- src ="../node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js "
11
- > </ script >
12
- < script
13
- type ="module "
14
- src ="../dist/cdn/perspective-viewer-summary.js "
15
- > </ script >
16
4
< link
17
5
rel ="stylesheet "
18
6
href ="../node_modules/@finos/perspective-viewer/dist/css/themes.css "
Original file line number Diff line number Diff line change 1
1
<!doctype html>
2
2
< html >
3
3
< head >
4
- < script
5
- type ="module "
6
- src ="../node_modules/@finos/perspective/dist/cdn/perspective.js "
7
- > </ script >
8
- < script
9
- type ="module "
10
- src ="../node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js "
11
- > </ script >
12
- < script
13
- type ="module "
14
- src ="../dist/cdn/perspective-viewer-summary.js "
15
- > </ script >
16
4
< link
17
5
rel ="stylesheet "
18
6
href ="../node_modules/@finos/perspective-viewer/dist/css/themes.css "
Original file line number Diff line number Diff line change 1
1
<!doctype html>
2
2
< html >
3
3
< head >
4
- < script
5
- type ="module "
6
- src ="../node_modules/@finos/perspective/dist/cdn/perspective.js "
7
- > </ script >
8
- < script
9
- type ="module "
10
- src ="../node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js "
11
- > </ script >
12
- < script
13
- type ="module "
14
- src ="../dist/cdn/perspective-viewer-summary.js "
15
- > </ script >
16
4
< link
17
5
rel ="stylesheet "
18
6
href ="../node_modules/@finos/perspective-viewer/dist/css/themes.css "
Original file line number Diff line number Diff line change
1
+ import "../node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js" ;
2
+ import "../dist/cdn/perspective-viewer-summary.js" ;
1
3
import * as perspective from "../node_modules/@finos/perspective/dist/cdn/perspective.js" ;
2
4
3
5
async function load ( ) {
4
6
let resp = await fetch ( "superstore.csv" ) ;
5
7
let csv = await resp . text ( ) ;
6
- const worker = perspective . worker ( ) ;
8
+ const worker = await perspective . worker ( ) ;
7
9
const table = worker . table ( csv ) ;
8
10
const viewers = document . querySelectorAll ( "perspective-viewer" ) ;
9
11
viewers . forEach ( async ( viewer ) => {
Original file line number Diff line number Diff line change
1
+ import "../node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js" ;
2
+ import "../node_modules/@finos/perspective-workspace/dist/cdn/perspective-workspace.js" ;
3
+ import "../dist/cdn/perspective-viewer-summary.js" ;
1
4
import * as perspective from "../node_modules/@finos/perspective/dist/cdn/perspective.js" ;
2
5
3
6
const workspace = document . getElementById ( "workspace" ) ;
@@ -134,8 +137,8 @@ const DEFAULT_LAYOUT = {
134
137
async function load ( ) {
135
138
let resp = await fetch ( "superstore.csv" ) ;
136
139
let csv = await resp . text ( ) ;
137
- const worker = perspective . shared_worker ( ) ;
138
- workspace . tables . set ( "superstore" , await worker . table ( csv ) ) ;
140
+ const worker = await perspective . worker ( ) ;
141
+ workspace . addTable ( "superstore" , worker . table ( csv ) ) ;
139
142
workspace . restore ( DEFAULT_LAYOUT ) ;
140
143
}
141
144
Original file line number Diff line number Diff line change 1
1
<!doctype html>
2
2
< html >
3
3
< head >
4
- < script
5
- type ="module "
6
- src ="../node_modules/@finos/perspective/dist/cdn/perspective.js "
7
- > </ script >
8
- < script
9
- type ="module "
10
- src ="../node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js "
11
- > </ script >
12
- < script
13
- type ="module "
14
- src ="../dist/cdn/perspective-viewer-summary.js "
15
- > </ script >
16
4
< link
17
5
rel ="stylesheet "
18
6
href ="../node_modules/@finos/perspective-viewer/dist/css/themes.css "
Original file line number Diff line number Diff line change 1
1
<!doctype html>
2
2
< html >
3
3
< head >
4
- < script
5
- type ="module "
6
- src ="../node_modules/@finos/perspective/dist/cdn/perspective.js "
7
- > </ script >
8
- < script
9
- type ="module "
10
- src ="../node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js "
11
- > </ script >
12
- < script
13
- type ="module "
14
- src ="../node_modules/@finos/perspective-workspace/dist/cdn/perspective-workspace.js "
15
- > </ script >
16
- < script
17
- type ="module "
18
- src ="../dist/cdn/perspective-viewer-summary.js "
19
- > </ script >
20
4
< link
21
5
rel ="stylesheet "
22
- href ="../node_modules/@finos/perspective-viewer/dist/css/themes .css "
6
+ href ="../node_modules/@finos/perspective-viewer/dist/css/pro-dark .css "
23
7
/>
24
8
< link
25
9
rel ="stylesheet "
Original file line number Diff line number Diff line change 31
31
"access" : " public"
32
32
},
33
33
"dependencies" : {
34
- "@finos/perspective" : " ^2.2.0" ,
35
- "@finos/perspective-viewer" : " ^2.1.2" ,
36
34
"dayjs" : " ^1.11.8"
37
35
},
36
+ "peerDependencies" : {
37
+ "@finos/perspective" : " ^3.8.0" ,
38
+ "@finos/perspective-viewer" : " ^3.8.0"
39
+ },
38
40
"devDependencies" : {
39
- "@finos/perspective-esbuild-plugin" : " ^3.2.1" ,
40
- "@finos/perspective-workspace" : " ^2.1.2" ,
41
+ "@finos/perspective" : " ^3.8.0" ,
42
+ "@finos/perspective-viewer" : " ^3.8.0" ,
43
+ "@finos/perspective-workspace" : " ^3.8.0" ,
41
44
"@playwright/test" : " ^1.36.2" ,
42
45
"@prospective.co/procss" : " ^0.1.13" ,
43
46
"esbuild" : " ^0.25.0" ,
Original file line number Diff line number Diff line change @@ -112,7 +112,13 @@ export class PerspectiveViewerSummaryPluginElement extends HTMLElement {
112
112
113
113
async render ( view ) {
114
114
// pull config
115
- const config = await view . get_config ( ) ;
115
+
116
+ // TODO(texodus): This is a bug in Perspective 3.x, fixed
117
+ // [here](https://github.com/finos/perspective/pull/3053). This can be
118
+ // be changed back by updating the bounds to 3.8.1
119
+
120
+ // const config = await view.get_config();
121
+ const config = await this . parentElement . save ( ) ;
116
122
117
123
this . _config = {
118
124
...this . _config ,
You can’t perform that action at this time.
0 commit comments