forked from finos/perspective
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
431 additions
and
642 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 |
---|---|---|
|
@@ -4,7 +4,8 @@ | |
{ | ||
"files": ["*.html"], | ||
"options": { | ||
"printWidth": 200 | ||
"printWidth": 200, | ||
"tabWidth": 4 | ||
} | ||
} | ||
] | ||
|
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
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
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 |
---|---|---|
|
@@ -10,41 +10,19 @@ | |
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta | ||
name="viewport" | ||
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" | ||
/> | ||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" /> | ||
|
||
<script | ||
type="module" | ||
src="/node_modules/@finos/perspective/dist/cdn/perspective.js" | ||
></script> | ||
<script | ||
type="module" | ||
src="/node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js" | ||
></script> | ||
<script | ||
type="module" | ||
src="/node_modules/@finos/perspective-viewer-datagrid/dist/cdn/perspective-viewer-datagrid.js" | ||
></script> | ||
<script | ||
type="module" | ||
src="/node_modules/@finos/perspective-viewer-d3fc/dist/cdn/perspective-viewer-d3fc.js" | ||
></script> | ||
<script | ||
type="module" | ||
src="/node_modules/@finos/perspective-viewer-openlayers/dist/cdn/perspective-viewer-openlayers.js" | ||
></script> | ||
<script type="module" src="/node_modules/@finos/perspective/dist/cdn/perspective.js"></script> | ||
<script type="module" src="/node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js"></script> | ||
<script type="module" src="/node_modules/@finos/perspective-viewer-datagrid/dist/cdn/perspective-viewer-datagrid.js"></script> | ||
<script type="module" src="/node_modules/@finos/perspective-viewer-d3fc/dist/cdn/perspective-viewer-d3fc.js"></script> | ||
<script type="module" src="/node_modules/@finos/perspective-viewer-openlayers/dist/cdn/perspective-viewer-openlayers.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/umd/index.min.js"></script> | ||
|
||
<link | ||
rel="stylesheet" | ||
crossorigin="anonymous" | ||
href="/node_modules/@finos/perspective-viewer/dist/css/themes.css" | ||
/> | ||
<link rel="stylesheet" crossorigin="anonymous" href="/node_modules/@finos/perspective-viewer/dist/css/themes.css" /> | ||
|
||
<script type="module"> | ||
import {worker} from "/node_modules/@finos/perspective/dist/cdn/perspective.js"; | ||
import { worker } from "/node_modules/@finos/perspective/dist/cdn/perspective.js"; | ||
|
||
const WORKER = worker(); | ||
const URL = `https://data.sfgov.org/resource/5cei-gny5.csv?$limit=50000`; | ||
|
@@ -55,9 +33,7 @@ | |
console.log("Using cached data from localStorage"); | ||
try { | ||
const buffer = fflate.strToU8(arrow, true); | ||
return await WORKER.table( | ||
fflate.decompressSync(buffer).buffer | ||
); | ||
return await WORKER.table(fflate.decompressSync(buffer).buffer); | ||
} catch (e) { | ||
console.error("Can't load cached data", e); | ||
localStorage.clear(); | ||
|
@@ -81,19 +57,15 @@ | |
const zipped = fflate.strFromU8(x, true); | ||
localStorage.setItem(URL, zipped); | ||
} catch (e) { | ||
console.error( | ||
"Can't cache data from data.sfgov.org", | ||
e | ||
); | ||
console.error("Can't cache data from data.sfgov.org", e); | ||
} | ||
})(); | ||
|
||
return table; | ||
} | ||
|
||
async function load() { | ||
const el = | ||
document.getElementsByTagName("perspective-viewer")[0]; | ||
const el = document.getElementsByTagName("perspective-viewer")[0]; | ||
|
||
const evictions = get_evictions(); | ||
const layout_json = await fetch("layout.json"); | ||
|
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.