Add resize to gallery. It's got a bug in which I had to manually position it, and...
authorRobert Konigsberg <konigsberg@google.com>
Sun, 15 Jan 2012 16:05:39 +0000 (11:05 -0500)
committerRobert Konigsberg <konigsberg@google.com>
Sun, 15 Jan 2012 16:05:39 +0000 (11:05 -0500)
gallery/gallery.css
gallery/index.html
gallery/resize.js [new file with mode: 0644]

index c0b5837..cc83a2b 100644 (file)
@@ -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
index 13d6ab0..d4cda27 100644 (file)
@@ -23,6 +23,7 @@
     <script src="per-series.js"></script>
     <script src="synchronize.js"></script>
     <script src="range-selector.js"></script>
+    <script src="resize.js"></script>
 
     <!-- These might not remain in the gallery -->
     <script src="dygraph-simple.js"></script>
diff --git a/gallery/resize.js b/gallery/resize.js
new file mode 100644 (file)
index 0000000..c11d529
--- /dev/null
@@ -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 = "<div id='div_g'>";
+    },
+    run: function() {
+      g = new Dygraph(
+            document.getElementById("div_g"),
+            NoisyData, {
+              rollPeriod: 7,
+              errorBars: true
+            }
+          );
+    }
+  });