File tree 1 file changed +7
-9
lines changed 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -16,20 +16,18 @@ document.addEventListener('DOMContentLoaded', async function () {
16
16
} ) ;
17
17
18
18
window . addEventListener ( 'load' , async function ( ) {
19
- // create mock data
20
- const data = {
21
- Sales : [ 500 , 1000 , 1500 ] ,
22
- Profit : [ 100.25 , 200.5 , 300.75 ] ,
23
- } ;
19
+ // get sample arrow data
20
+ const dataRequest = fetch ( 'https://cdn.jsdelivr.net/npm/superstore-arrow/superstore.arrow' ) ;
24
21
25
- // create worker for data loading
22
+ // create worker for table data loading
26
23
const worker = perspective . worker ( ) ;
24
+ const dataResponse = await dataRequest ;
25
+ const arrowData = await dataResponse . arrayBuffer ( ) ;
27
26
28
27
// create sample data table
29
- table = worker . table ( data ) ;
30
- // table = perspective.table(data);
28
+ table = worker . table ( arrowData ) ;
31
29
32
- // Note: perspective viewer element exposes data table loading API
30
+ // load sample data and toggle perspective grid view config
33
31
viewer . load ( table ) ;
34
32
viewer . toggleConfig ( ) ;
35
33
} ) ;
You can’t perform that action at this time.
0 commit comments