Using transition.transition to chain transitions and transition.each to apply a transition to a selection. Compare to using explicit delays. In response to a Stack Overflow question.
(ns workflows-conductor.le-workspace-join | |
(:require [clojure.set :refer [difference | |
intersection | |
union]])) | |
(defn inner-join | |
[left-keys right-keys] | |
(intersection (set left-keys) (set right-keys))) | |
(defn outer-join |
(comment ; Fun with transducers, v2 | |
;; Still haven't found a brief + approachable overview of Clojure 1.7's new | |
;; transducers in the particular way I would have preferred myself - so here goes: | |
;;;; Definitions | |
;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as: | |
(fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation | |
;; (The `[]` arity is actually optional; it's only used when calling | |
;; `reduce` w/o an init-accumulator). |
By adding transitions, we can more easily follow the elements as they are entered, updated and exited. Separate transitions are defined for each of the three states.
Note that no transition is applied to the merged enter + update selection; this is because it would supersede the transition already scheduled on entering and updating elements. It's possible to schedule concurrent elements by using transition.transition or by setting transition.id
, but it's simpler here to only transition the x-position on update; for entering elements, the x-position is assigned statically.
Want to read more? Try these tutorials:
This grouped bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:
- d3.csv - load and parse data
- d3.scale.ordinal - x-position encoding and color encoding
- d3.scale.linear - y-position encoding
- d3.format - SI prefix formatting (e.g., “10M” for 10,000,000)
- d3.max - compute domains
- d3.keys - compute column names
- d3.svg.axis - display axes
This simple bar chart is constructed from a TSV file storing the frequency of letters in the English language. The chart employs conventional margins and a number of D3 features:
- d3.tsv - load and parse data
- d3.format - format percentages
- d3.scale.ordinal - x-position encoding
- d3.scale.linear - y-position encoding
- d3.max - compute domains
- d3.svg.axis - display axes
window.onload=function(){ | |
var data = [-15, 20, -22, 18, -2, 6, -26, 18], | |
duration = 300; | |
var margin = {top: 30, right: 10, bottom: 10, left: 30}, | |
width = 320 - margin.left - margin.right, | |
height = 250 - margin.top - margin.bottom; | |
var y0 = Math.max(Math.abs(d3.min(data)), Math.abs(d3.max(data))); | |
var y = d3.scale.linear() |
<header>header</header> | |
<nav>navigation</nav> | |
<article>article</article> | |
<footer>footer</footer> |
require 'formula' | |
class WkhtmltopdfQt < Formula | |
# This is the latest staging branch commit, dated 6 JAN 2012. | |
url 'https://qt.gitorious.org/qt/wkhtmltopdf-qt/archive-tarball/6053b687d24956d0a7eac21a015172b29cf0f451' | |
sha1 'c8217e7a96d5e63cb6b2334d5eefe866d06acfde' | |
version '6053b68' | |
end | |
class Wkhtmltopdf < Formula |