this.container.selectAll('.node') .data(root.descendants()) .enter() .append('circle') .classed('node', true) .attr('r', 5) .attr('fill', getHouseColor) .attr('cx', d => d.y) .attr('cy', d => d.x)
function stylePies(d) { var trace = d[0].trace, pts = d3.select(this).select('g.legendpoints') .selectAll('path.legendpie') .data(Plots.traceIs(trace, 'pie') && trace.visible ? [d] : []); pts.enter().append('path').classed('legendpie', true) .attr('d', 'M6,6H-6V-6H6Z') .attr('transform', 'translate(20,0)'); pts.exit().remove(); if(pts.size()) pts.call(stylePie, d[0], trace); }
d3.merge($$.main.selectAll('.' + CLASS.shapes + $$.getTargetSelectorSuffix(targetId)).selectAll('.' + CLASS.shape).filter(function () { return d3.select(this).classed(CLASS.SELECTED); }).map(function (d) { return d.map(function (d) { var data = d.__data__;return data.data ? data.data : data; }); }))
$$.legend.selectAll('.' + CLASS.legendItem).filter(function (id) { return targetIds.indexOf(id) >= 0; }).classed(CLASS.legendItemFocused, focus).transition().duration(100).style('opacity', function () { var opacity = focus ? $$.opacityForLegend : $$.opacityForUnfocusedLegend; return opacity.call($$, $$.d3.select(this)); });
function makeBackground(plotgroup, perimeter, contours) { var bggroup = plotgroup.selectAll('g.contourbg').data([0]); bggroup.enter().append('g').classed('contourbg', true); var bgfill = bggroup.selectAll('path') .data(contours.coloring === 'fill' ? [0] : []); bgfill.enter().append('path'); bgfill.exit().remove(); bgfill .attr('d', 'M' + perimeter.join('L') + 'Z') .style('stroke', 'none'); }
createRenderingPrimitives(container, data, typeClass) { return container .selectAll("." + typeClass) .data(data) .enter() .append("g") .classed(typeClass, true) .attr("id", function(d) { return d.id(); }); }
linkEnter.sort(function (a, b) { return b.thickness - a.thickness; }) .classed("leftToRight", function(d) {return d.direction > 0;}) .classed("rightToLeft", function(d) {return d.direction < 0;}) .style("marker-end", function() {return 'url(#arrowHead)';}) .style("stroke", LINK_COLOR) .style("opacity", 0) .transition() .delay(TRANSITION_DURATION) .duration(TRANSITION_DURATION) .attr("d", path) .attr("stroke-width", function (d) {return Math.max(1, d.thickness);}) .style("opacity", OPACITY.LINK_DEFAULT);
newAndOldNodes .classed("selected", function (n) { if (state.selection.isSelected(n)) return true; return false; }) .attr("transform", function (d) { return "translate(" + d.x + "," + d.y + ")"; }) .select('rect') .attr('height', function (d) { return d.getNodeHeight(view.state.showTypes); });
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); });
fullLayout._infolayer.append('g') .classed('annotation', true) .attr('data-index', String(index)) .style('opacity', options.opacity) .on('click', function() { gd._dragging = false; gd.emit('plotly_clickannotation', { index: index, annotation: optionsIn, fullAnnotation: options }); })
gScatterGeoTraces.each(function(trace) { var s = d3.select(this); if(!subTypes.hasLines(trace)) return; s.selectAll('path.js-line') .data([makeLineGeoJSON(trace)]) .enter().append('path') .classed('js-line', true); // TODO add hover - how? });