MCPcopy Index your code
hub / github.com/plotly/plotly.js / stylePieLike

Function stylePieLike

src/components/legend/style.js:521–556  ·  view source on GitHub ↗
(d, lThis, desiredType)

Source from the content-addressed store, hash-verified

519 }
520
521 function stylePieLike(d, lThis, desiredType) {
522 var d0 = d[0];
523 var trace = d0.trace;
524
525 var isVisible = !desiredType
526 ? Registry.traceIs(trace, desiredType)
527 : trace.visible && trace.type === desiredType;
528
529 var pts = d3
530 .select(lThis)
531 .select('g.legendpoints')
532 .selectAll('path.legend' + desiredType)
533 .data(isVisible ? [d] : []);
534 pts.enter()
535 .append('path')
536 .classed('legend' + desiredType, true)
537 .attr('d', 'M6,6H-6V-6H6Z')
538 .attr('transform', centerTransform);
539 pts.exit().remove();
540
541 if (pts.size()) {
542 var cont = trace.marker || {};
543 var lw = boundLineWidth(
544 pieCastOption(cont.line.width, d0.pts),
545 cont.line,
546 MAX_MARKER_LINE_WIDTH,
547 CST_MARKER_LINE_WIDTH
548 );
549
550 var opt = 'pieLike';
551 var tMod = Lib.minExtend(trace, { marker: { line: { width: lw } } }, opt);
552 var d0Mod = Lib.minExtend(d0, { trace: tMod }, opt);
553
554 stylePie(pts, d0Mod, tMod, gd);
555 }
556 }
557
558 function styleSpatial(d) {
559 // i.e. maninly traces having z and colorscale

Callers 2

stylePiesFunction · 0.85
styleFunnelareasFunction · 0.85

Calls 1

boundLineWidthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…