A static superstore.arrow
demo.
-
-
Save texodus/372d406997d5522ebaafb17f0f521d97 to your computer and use it in GitHub Desktop.
Perspective Superstore Arrow Example
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
license: apache-2.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
const ARROW = "https://unpkg.com/@jpmorganchase/perspective-examples/build/superstore.arrow"; | |
window.addEventListener('WebComponentsReady', function() { | |
// Fetch and load arrow data. | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', ARROW, true); | |
xhr.responseType = "arraybuffer" | |
xhr.onload = function() { | |
// Get element from the DOM. | |
var el = document.getElementsByTagName('perspective-viewer')[0]; | |
// Load the arrow response in the `<perspective-viewer>` DOM reference. | |
el.load(xhr.response); | |
// Toggle the config controls open. | |
el.toggleConfig(); | |
} | |
xhr.send(null); | |
}); |
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
perspective-viewer { | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | |
<script src="https://unpkg.com/@finos/perspective/dist/umd/perspective.js"></script> | |
<script src="https://unpkg.com/@finos/perspective-viewer/dist/umd/perspective-viewer.js"></script> | |
<script src="https://unpkg.com/@finos/perspective-viewer-hypergrid/dist/umd/perspective-viewer-hypergrid.js"></script> | |
<script src="https://unpkg.com/@finos/perspective-viewer-d3fc/dist/umd/perspective-viewer-d3fc.js"></script> | |
<script src="arrow.js"></script> | |
<link rel='stylesheet' href="https://unpkg.com/@finos/perspective-viewer/dist/umd/material.css" is="custom-style"> | |
<link rel='stylesheet' href="index.css"> | |
</head> | |
<body> | |
<perspective-viewer view="d3_sunburst" row-pivots='["Sub-Category","Region","Segment"]' sort='[["Profit","desc"]]' columns='["Sales", "Profit"]'> | |
</perspective-viewer> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment