container.enter().append('g').classed(id, true) .each(function() { var s = d3.select(this); s.append('rect').classed('cbbg', true); s.append('g').classed('cbfills', true); s.append('g').classed('cblines', true); s.append('g').classed('cbaxis', true).classed('crisp', true); s.append('g').classed('cbtitleunshift', true) .append('g').classed('cbtitle', true); s.append('rect').classed('cboutline', true); s.select('.cbtitle').datum(0); });
svg.selectAll(".day") .data(function(d) { return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1)); }) .enter().append("rect") .attr("class", "day") .attr("width", cellSize) .attr("height", cellSize) .attr("x", function(d) { return d3.time.weekOfYear(d) * cellSize; }) .attr("y", function(d) { return d.getDay() * cellSize; }) .datum(format)
g.datum(function(d) { return {center: mouse.slice(), angle: 0}; });
componentDidMount() { // console.log('g', this.g); if (!this.g) { throw new Error('missing ref!'); } const { force, } = this.props; d3.select(this.g) .datum(this.props.data) .call(selection => selection .select('circle') .call(force.drag), ); }
.datum(topojson.feature(us, us.objects.land)) .attr("d", path); .datum(topojson.mesh(congress, congress.objects.districts, function(a, b) { return a !== b && (a.id / 1000 | 0) === (b.id / 1000 | 0); })) .attr("d", path); .datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; })) .attr("d", path);
.datum(this.props.data) .call(this.scatter); },
.datum(topojson.feature(us, us.objects.land)) .attr("d", path); .datum(topojson.mesh(congress, congress.objects.districts, function(a, b) { return a !== b && (a.id / 1000 | 0) === (b.id / 1000 | 0); })) .attr("d", path); .datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; })) .attr("d", path);
.enter() .append("path") .datum(d => d) .attr("fill", (_, i) => colors[i]) .attr("d", area);
.datum(data) .attr("fill", "none") .attr("stroke", "steelblue")
.datum(props.data) .transition(t) .attr('transform', 'translate(' + (x.bandwidth() / 2) + ',0)')
.datum(this.props.data) .call(this.bar); },
.datum(chartData) .attr("fill", "none") .attr("stroke", "rgb(63,81,181)")
.datum(this.props.data) .call(this.scatter); },
.datum(chartData) .attr("fill", "none") .attr("stroke", "rgb(63,81,181)")