From 328d2ccee498aefe549041b5c8a2b4a97a29fea1 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Sun, 15 Jan 2012 11:05:39 -0500 Subject: [PATCH] Add resize to gallery. It's got a bug in which I had to manually position it, and it's not inside the gray border. Not sure. --- gallery/gallery.css | 10 ++++++++++ gallery/index.html | 1 + gallery/resize.js | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 gallery/resize.js diff --git a/gallery/gallery.css b/gallery/gallery.css index c0b5837..cc83a2b 100644 --- a/gallery/gallery.css +++ b/gallery/gallery.css @@ -84,3 +84,13 @@ aside { border-style: solid; border-color: black; } + +/* CSS for resize */ +#workarea #resize #div_g { + /* The left and top are just guesses, this needs a proper run-through */ + position: absolute; + left: 200px; + right: 10px; + top: 100px; + bottom: 10px; +} \ No newline at end of file diff --git a/gallery/index.html b/gallery/index.html index 13d6ab0..d4cda27 100644 --- a/gallery/index.html +++ b/gallery/index.html @@ -23,6 +23,7 @@ + diff --git a/gallery/resize.js b/gallery/resize.js new file mode 100644 index 0000000..c11d529 --- /dev/null +++ b/gallery/resize.js @@ -0,0 +1,18 @@ +Gallery.register( + 'resize', + { + name: 'Resizable Graph', + title: 'Resize the window. The dygraph will resize with it.', + setup: function(parent) { + parent.innerHTML = "
"; + }, + run: function() { + g = new Dygraph( + document.getElementById("div_g"), + NoisyData, { + rollPeriod: 7, + errorBars: true + } + ); + } + }); -- 2.7.4