                       :padding "0 !important"
                       :overflow-x "hidden"
                       :overflow-y "hidden")]
+        attrs (second t)
+        width (:width attrs)
+        height (:height attrs)
         s (hiccup.core/html (conj body t))]
+    (Platform/runLater (fn [] (.setPrefHeight @webview height)))
+    (Platform/runLater (fn [] (.setPrefWidth @webview width)))
     (render-string s)
+    (wait-for-worker)
+    (Platform/runLater (fn [] (.sizeToScene @stage)))
+    (Platform/runLater (fn [] (.show @stage)))
     s))
 
 (defn export-to-file [filename t]

  (let [tiks (apply ticks/ticks (:domain (meta scale)))]
    (map (fn [d] [:text {:x 0 :text-anchor "start" :dx ".2em" :dy ".32em" :y (scale d)} (str d)]) tiks)))


(def diagram
  [:svg {:width  (+ (:left margin) (:right margin) width)

        range-output))
    (with-meta all)))

(defn left-y-axis [scale]
  (let [tiks (apply ticks/ticks (:domain (meta scale)))]
    (map (fn [d] [:text {:x 0 :text-anchor "end" :dx "-.2em" :dy ".32em" :y (scale d)} (str d)]) tiks)))
