From a6333604563ac36e510b6dc113336d3478fb4211 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 7 Apr 2016 11:32:31 +0200 Subject: make layout more responsive --- index.html | 103 +++++++++++++++++++++++-------------------------------------- 1 file changed, 39 insertions(+), 64 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index d0e7b28..5a1b913 100644 --- a/index.html +++ b/index.html @@ -57,13 +57,32 @@ /* responsive deck */ function sizeSlides() { d3.selectAll(".slide") - .style("width", (parseInt(window.innerWidth) * 0.9) + "px") - .style("height", (parseInt(window.innerHeight) * 0.9) + "px"); + .style("width", parseInt(window.innerWidth) + "px") + .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 scalePicture = function(d, i, me, extraRatio) { + // "extraRatio" might scale vertically + extraRatio = extraRatio || 1; + var me = d3.select(me || this); + var winW = window.innerWidth, + winH = window.innerHeight, + picW = me.node().naturalWidth, + picH = me.node().naturalHeight, + ratioH = 0.75*extraRatio, ratioW = 0.9; + if ((winW*ratioW)/picW > (winH*ratioH)/picH) { + me.style("height", winH*ratioH + "px"); + me.style("width", "auto"); + } else { + me.style("width", winW*ratioW + "px"); + me.style("height", "auto"); + } + }; + d3.selectAll(".scalepic").each(scalePicture); + d3.selectAll(".scalepic-half").each(function(d, i) { scalePicture(d, i, this, 0.5); }); }; window.addEventListener("resize", sizeSlides); @@ -132,11 +151,11 @@

Neuronale Netze

Ein Neuron

- Schema Neuron + Schema Neuron

Ein Neuronales Netz

- Foto Neuron + Foto Neuron
@@ -144,18 +163,19 @@

Künstliche neuronale Netze

Neuron - künstliches Neuron

- Schema Neuron - Schema eines künstlichen Neurons + Schema Neuron + Schema eines künstlichen Neurons

Neuronales Netz - künstliches neuronales Netz

- Foto Neuron - Mehrschichtiges Perzeptron + Foto Neuron + Mehrschichtiges Perzeptron

Das Problem – Die Boston-Häuserdatenreihe

+

:homes:

@@ -188,54 +208,10 @@
- +
+

Ein leeres Netz

@@ -253,8 +229,8 @@
-
-
+
+

Aktivierungstest

@@ -286,8 +262,8 @@
-
-
+
+

Der Fehler im Verlauf

@@ -305,8 +281,8 @@
-
-
+
+

Die Gewichte im Verlauf

@@ -324,8 +300,8 @@
-
-
+
+

Gewichte und Fehler

@@ -342,7 +318,6 @@ }, ".visContainer");
--->
-- cgit v1.3.1