Sha256: 85d0391eb6b1d8f2c70b747c98c08a75e529a9ac7308e2b8dfd06fa74924427d
Contents?: true
Size: 968 Bytes
Versions: 25
Compression:
Stored size: 968 Bytes
Contents
require("../env"); require("../../d3"); var vows = require("vows"), assert = require("assert"); var suite = vows.describe("selection.order"); suite.addBatch({ "selectAll(div)": { topic: function() { return d3.select("body").html("").selectAll("div") .data([1, 2, 10, 20]) .enter().append("div") .attr("id", String); }, "orders elements by data": function(div) { div = div.data([1, 10, 20, 2], String).order(); assert.domNull(div[0][0].previousSibling); assert.domEqual(div[0][1].previousSibling, div[0][0]); assert.domEqual(div[0][2].previousSibling, div[0][1]); assert.domEqual(div[0][3].previousSibling, div[0][2]); assert.domNull(div[0][3].nextSibling); }, "returns the current selection": function(span) { span = d3.select("body"); // https://github.com/tmpvar/jsdom/issues/277 assert.isTrue(span.order() === span); } } }); suite.export(module);
Version data entries
25 entries across 25 versions & 1 rubygems