d3.select(this).each(generator['dot']).style({ opacity: function(dB, iB) { return +_config[pI].data.dotVisible; }, fill: markStyle.stroke(d, i, pI) }).attr({ 'class': 'mark dot' });
s.selectAll('g.points') .each(function(d) { d3.select(this).selectAll('path.point') .call(Drawing.pointStyle, d.trace || d[0].trace); d3.select(this).selectAll('text') .call(Drawing.textPointStyle, d.trace || d[0].trace); });
it('should be able to restyle', function(done) { Plotly.restyle(gd, { a: [[1, 2, 3]]}, 0).then(function() { var transforms = []; d3.selectAll('.ternary .point').each(function() { var point = d3.select(this); transforms.push(point.attr('transform')); }); expect(transforms).toEqual([ 'translate(186.45,209.8)', 'translate(118.53,170.59)', 'translate(248.76,117.69)' ]); }).then(done); });
newAndOldNodes.select<SVGTextElement>('.type').each(function (d) { this.setAttribute('visibility', view.state.showTypes ? 'visible' : 'hidden'); });
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(); } }
sbsvg.selectAll('rect.shape').each(function (d, i) { graph.nodes.push( nodeLookup[this.id] = { label: this.attributes['dunnart:label'].value, dunnartid: this.id, index: i, width: 60, height: 40, x: parseFloat(this.attributes['x'].value), y: parseFloat(this.attributes['y'].value), rx: ('rx' in this.attributes) ? parseFloat(this.attributes['rx'].value) : 5, ry: ('ry' in this.attributes) ? parseFloat(this.attributes['ry'].value) : 5 } ); });
// trace styling s.style('opacity', function(d) { return d[0].trace.opacity; }) // for gapless (either stacked or neighboring grouped) bars use // crispEdges to turn off antialiasing so an artificial gap // isn't introduced. .each(function(d) { if((fullLayout.barmode === 'stack' && barcount > 1) || (fullLayout.bargap === 0 && fullLayout.bargroupgap === 0 && !d[0].trace.marker.line.width)) { d3.select(this).attr('shape-rendering', 'crispEdges'); } });
it('has the correct name spaces', function() { var mainSVGs = d3.selectAll('.main-svg'); mainSVGs.each(function() { var node = this; assertNamespaces(node); }); });
s.style('opacity', function(d) { return d[0].trace.opacity; }) .each(function(d) { var trace = d[0].trace, lineWidth = trace.line.width; d3.select(this).selectAll('path.box') .style('stroke-width', lineWidth + 'px') .call(Color.stroke, trace.line.color) .call(Color.fill, trace.fillcolor); d3.select(this).selectAll('path.mean') .style({ 'stroke-width': lineWidth, 'stroke-dasharray': (2 * lineWidth) + 'px,' + lineWidth + 'px' }) .call(Color.stroke, trace.line.color); d3.select(this).selectAll('g.points path') .call(Drawing.pointStyle, trace); });
geo.framework.selectAll('g.trace.choropleth') .each(function(trace) { var s = d3.select(this), marker = trace.marker || {}, markerLine = marker.line || {}, zmin = trace.zmin, zmax = trace.zmax, scl = getColorscale(trace.colorscale), sclFunc = makeScaleFunction(scl, zmin, zmax); s.selectAll('path.choroplethlocation') .each(function(pt) { d3.select(this) .attr('fill', function(pt) { return sclFunc(pt.z); }) .call(Color.stroke, pt.mlc || markerLine.color) .call(Drawing.dashLine, '', pt.mlw || markerLine.width); }); });
function checkScatterGeoOrder() { var order = ['js-path', 'point', null]; var nodes = d3.selectAll('g.trace.scattergeo'); nodes.each(function() { var list = []; d3.select(this).selectAll('*').each(function() { var className = d3.select(this).attr('class'); list.push(className); }); var listSorted = list.slice().sort(function(a, b) { return order.indexOf(a) - order.indexOf(b); }); expect(list).toEqual(listSorted); }); }
newGs.each(function (d) { appendInputAndOutputBubbles(d3.select(this), d); });
sbsvg.selectAll('[relType=alignment]').each(function () { var cid = this.attributes['constraintID'].value; var nodeid = nodeLookup[this.attributes['objOneID'].value].index; var alignmentPos = this.attributes['alignmentPos'].value; var o = {node: nodeid, offset: 0}; if (cid in constraintMap) { constraintMap[cid].offsets.push(o); } else { graph.constraints.push(constraintMap[cid] = { type: 'alignment', offsets: [o], axis: alignmentPos == 1 ? "y" : "x" }); } });
d3.selectAll('defs').each(function() { if(this.id) otherUids.push(this.id.split('-')[1]); });