summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2016-04-08 20:01:29 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2016-04-08 20:01:29 +0200
commit71d6973d350595ffbe29f5d791ec8972ccc23416 (patch)
tree7fcea2a605fa7652c2df8092213cc9107321f728
parenta6333604563ac36e510b6dc113336d3478fb4211 (diff)
downloadvortrag-knn-71d6973d350595ffbe29f5d791ec8972ccc23416.tar.gz
vortrag-knn-71d6973d350595ffbe29f5d791ec8972ccc23416.zip
optimize further for 800x600
-rw-r--r--code/bostonset.js1
-rw-r--r--index.css29
-rw-r--r--index.html16
3 files changed, 15 insertions, 31 deletions
diff --git a/code/bostonset.js b/code/bostonset.js
index f5f1264..bfdbb63 100644
--- a/code/bostonset.js
+++ b/code/bostonset.js
@@ -36,7 +36,6 @@ var Bostonset = (function() {
};
Bostonset.prototype.attributes = function() {
- console.log(attrs);
return attrs;
};
diff --git a/index.css b/index.css
index 13e9525..a3ca997 100644
--- a/index.css
+++ b/index.css
@@ -1,27 +1,12 @@
-/* reset */
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed,
-figure, figcaption, footer, header, hgroup,
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-
h1, h2, h3, h4, h5, h6 {
text-align: center;
+ color: #222;
+ line-height: 90%;
+}
+
+body {
+ color: #444;
+ background-color: #EEEEEE;
}
.step {
diff --git a/index.html b/index.html
index 5a1b913..c649d6b 100644
--- a/index.html
+++ b/index.html
@@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8">
<title></title>
- <link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="dep/material-icons.css">
<link rel="stylesheet" href="dep/material.deep_purple-blue.min.css">
<link rel="stylesheet" href="dep/emojione.min.css">
+ <link rel="stylesheet" href="index.css">
</head>
<body>
<script src="dep/d3.js" type="text/javascript"></script>
@@ -61,8 +61,9 @@
.style("height", parseInt(window.innerHeight) + "px");
d3.selectAll(".scale")
.style("font-size", function() {
- var lines = d3.select(this).selectAll("p")[0].length; // TODO a bit specific, may not work in all cases
- return Math.min(this.clientWidth/10, this.clientHeight/lines*(1.5)) + "px"; // TODO replace by line height?
+ var lines = d3.select(this).selectAll("p")[0].length+1; // TODO a bit specific, may not work in all cases
+ if (lines<=1) return this.clientWidth/10 + "px";
+ return this.clientHeight/10 + "px";
});
var scalePicture = function(d, i, me, extraRatio) {
// "extraRatio" might scale vertically
@@ -72,7 +73,7 @@
winH = window.innerHeight,
picW = me.node().naturalWidth,
picH = me.node().naturalHeight,
- ratioH = 0.75*extraRatio, ratioW = 0.9;
+ ratioH = 0.7*extraRatio, ratioW = 0.7;
if ((winW*ratioW)/picW > (winH*ratioH)/picH) {
me.style("height", winH*ratioH + "px");
me.style("width", "auto");
@@ -82,7 +83,7 @@
}
};
d3.selectAll(".scalepic").each(scalePicture);
- d3.selectAll(".scalepic-half").each(function(d, i) { scalePicture(d, i, this, 0.5); });
+ d3.selectAll(".scalepic-half").each(function(d, i) { scalePicture(d, i, this, 0.45); });
};
window.addEventListener("resize", sizeSlides);
@@ -93,7 +94,7 @@
});
</script>
- <div id="impress">
+ <div id="impress" data-width="800" data-height="600">
<!-- TODO Fortschrittsbalken unten? -->
<div class="step slide" data-x="0" data-y="0" data-z="5000">
<h1>Künstliche neuronale Netze</h1>
@@ -175,7 +176,6 @@
<div class="step slide" data-x="4000" data-y="0" data-z="5000">
<h1>Das Problem &ndash; Die Boston-Häuserdatenreihe</h1>
- <!-- TODO overflows right in 800x600 -->
<div class="center">
<p class="emoji scale">:homes:</p>
<table id="boston-example"></table>
@@ -193,7 +193,7 @@
});
// TODO highlight medv
table.append("tbody");
- for(c=0; c<8; c++) {
+ for(c=0; c<5; c++) {
var row = Math.floor(Math.random()*bostonset.length());
var tr = table.select("tbody").append("tr");
bostonset.rawData(row).forEach(function(val) {