-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
47 lines (42 loc) · 1.47 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>d3.js - pre-requisitos</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<main class="container">
<div class="row">
<h1 class="col-xs-12 text-danger bg-danger text-center">faltan algunas dependencias!</h1>
</div>
</main>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/lodash/lodash.min.js"></script>
<script src="node_modules/d3/build/d3.min.js"></script>
<script>
$(function()
{
"use strict";
if( window.d3 && window._ && window.$ )
{
d3.select('.row').select('h1').remove();
d3.select('.row').append('h1')
.attr('class','col-xs-12 text-success bg-success text-center')
.text('dependencias ok!');
}
var versions = [
['d3', window.d3 && d3.version],
['lodash', window._ && _.VERSION],
['jquery', window.$ && $().jquery],
];
var list = d3.select('.row').append('ul')
.attr('class','col-xs-12');
var items = list.selectAll('li').data(versions);
items.enter().append('li')
.attr('class', function(d) { return d[1] === undefined? 'text-danger': 'text-success'})
.text(function(d) { return d[0] + ": " + (d[1] || "¡¡FALTA!!"); });
});
</script>
</body>
</html>