Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Last active December 11, 2015 08:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hypercubed/05c132fc2996fc7795da to your computer and use it in GitHub Desktop.
Save Hypercubed/05c132fc2996fc7795da to your computer and use it in GitHub Desktop.
plotly-jspm
jspm_packages
letter frequency
A .08167
B .01492
C .02780
D .04253
E .12702
F .02288
G .02022
H .06094
I .06973
J .00153
K .00747
L .04025
M .02517
N .06749
O .07507
P .01929
Q .00098
R .05987
S .06333
T .09056
U .02758
V .01037
W .02465
X .00150
Y .01971
Z .00074
System.config({
baseURL: "/",
defaultJSExtensions: true,
transpiler: "traceur",
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
map: {
"plotly.js": "github:plotly/plotly.js@1.1.0",
"traceur": "github:jmcriffey/bower-traceur@0.0.92",
"traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.92"
}
});
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>plotly-jspm</title>
</head>
<body ng-cloak>
<h1>Plotly - JSPM</h1>
<h2>jspm install plotly.js=github:plotly/plotly.js</h2>
<div id="chart"></div>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import('index');
</script>
</body>
</html>
import plotly from 'plotly.js/dist/plotly';
plotly.d3.tsv('bars.tsv', function(data) {
plotly.newPlot('chart', [
{
x: data.map(d => d.letter),
y: data.map(d => d.frequency),
type: 'bar'
}
]);
});
{
"jspm": {
"dependencies": {
"plotly.js": "github:plotly/plotly.js@^1.1.0"
},
"devDependencies": {
"traceur": "github:jmcriffey/bower-traceur@0.0.92",
"traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.92"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment