function applyFunctions(){ var timeout = setTimeout(function() { d3.select("input[value=\"grouped\"]").property("checked", true).each(change); }, 2000); d3.selectAll("input").on("change", change); function change() { clearTimeout(timeout); if (this.value === "grouped") transitionGrouped(); else transitionStacked(); } }
svg.append("g") .attr("class", "lineMS") .selectAll("path") .data(elements) .enter().append("path") .style("stroke", function(d) { return color(d.value); }) .attr("d", function(d) { return line(d.indexes); }) .select(function() { return this.parentNode.insertBefore(this.cloneNode(false), this); }) .attr("class", "line-haloMS") .style("stroke", null) .on('mount', function(){});
d3.select(window).on("keydown", function() { switch (d3.event.keyCode) { case 37: year = Math.max(year0, year - 10); break case 39: year = Math.min(year1, year + 10); break default: return null } update(); })
componentWillUnmount() { const { id } = this.props; select(`#${id}`).on('.drag', null); }
// Create .on('mount') function to wrap timer and transformations in svg.on("mount", function(){ // has Timer property that will be binded to the React component this.hasTimer = true; //pass down a reference to this to the addTimer function var that = this addTimer(that); });
d3.select(node).select('svg') .on("mousemove", function(){ var mousex = d3.mouse(this); mousex = mousex[0] + 10; d3.selectAll('.remove').style("left", mousex + "px" ); }) .on("mouseover", function(){ var mousex = d3.mouse(this); mousex = mousex[0] + 10; d3.selectAll('.remove').style("left", mousex + "px"); });
svg.on("mount", function(){ applyTransition() });
svg.on("mount", function(){ applyFunctions(); });
// On load function that will trigger the transitions svg.on('mount', function() { transition(); });
componentWillUnmount() { const { id } = this.props; select(`#${id}`).on('.drag', null); }
// Create .on('mount') function to wrap timer and transformations in svg.on("mount", function(){ this.hasTimer = true; var that = this addTimer(that); });
componentWillUnmount() { const { id } = this.props; select(`#${id}`).on('.drag', null); }
componentWillUnmount() { const { id } = this.props; select(`#${id}`).on('.drag', null); }