A static superstore.arrow
demo.
Last active
August 11, 2024 18:19
-
-
Save JHawk/b29192cd425bfc9443dd12626cc2f606 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/build/perspective.js"></script> | |
<script src="https://unpkg.com/@finos/perspective-viewer/build/perspective.view.js"></script> | |
<script src="https://unpkg.com/@finos/perspective-viewer-hypergrid/build/hypergrid.plugin.js"></script> | |
<script src="https://unpkg.com/@finos/perspective-viewer-d3fc/build/d3fc.plugin.js"></script> | |
<script src="arrow.js"></script> | |
<link rel='stylesheet' href="https://unpkg.com/@finos/perspective-viewer/build/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