Make diagrams responsive, import data handling for tree map
This commit is contained in:
parent
e59f78adea
commit
e7baf951e9
@ -5,10 +5,11 @@
|
||||
<title>GeoVis - Project 1</title>
|
||||
<script src="https://www.gstatic.com/charts/loader.js"></script> <!-- Google Charts-->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> <!-- Tree Maps-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/underscore@1.11.0/underscore-min.js"></script>
|
||||
<script src="js/tree.js"></script> <!-- Tree Maps-->
|
||||
<script src="script.js"></script>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
|
||||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
|
||||
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<div class="m-5">
|
||||
@ -45,6 +46,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="m-5">Aufgabe 2</h1>
|
||||
<div id="foldermap" class="m-5"></div>
|
||||
<div class="row">
|
||||
<div id="foldermap" class="m-5 col"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -135,6 +135,13 @@ google.charts.setOnLoadCallback(drawPieChartMonth)
|
||||
google.charts.setOnLoadCallback(drawLineChart)
|
||||
google.charts.setOnLoadCallback(drawScatterChart)
|
||||
google.charts.setOnLoadCallback(drawBubbleChart)
|
||||
window.addEventListener('resize', _.debounce(() => {
|
||||
drawPieChartYear()
|
||||
drawPieChartMonth()
|
||||
drawLineChart()
|
||||
drawScatterChart()
|
||||
drawBubbleChart()
|
||||
}))
|
||||
|
||||
|
||||
// Tree Map
|
||||
@ -162,12 +169,12 @@ function loadTreeMap() {
|
||||
]
|
||||
|
||||
let data = [
|
||||
[...files[0].map(value => value.size)], //Folder 1
|
||||
[...files[1].map(value => value.size)] //Folder 2
|
||||
files[0].map(value => value.size), //Folder 1
|
||||
files[1].map(value => value.size) //Folder 2
|
||||
]
|
||||
let labels = [
|
||||
[...files[0].map(value => value.name)], //Folder 1
|
||||
[...files[1].map(value => value.name)] //Folder 2
|
||||
files[0].map(value => value.name), //Folder 1
|
||||
files[1].map(value => value.name) //Folder 2
|
||||
]
|
||||
Treemap.draw("foldermap", 600, 400, data, labels, {"box": pickColor})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user