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

Function style

src/traces/bar/style.js:16–45  ·  view source on GitHub ↗
(gd)

Source from the content-addressed store, hash-verified

14var helpers = require('./helpers');
15
16function style(gd) {
17 var s = d3.select(gd).selectAll('g[class^="barlayer"]').selectAll('g.trace');
18 resizeText(gd, s, 'bar');
19
20 var barcount = s.size();
21 var fullLayout = gd._fullLayout;
22
23 // trace styling
24 s.style('opacity', function(d) { return d[0].trace.opacity; })
25
26 // for gapless (either stacked or neighboring grouped) bars use
27 // crispEdges to turn off antialiasing so an artificial gap
28 // isn't introduced.
29 .each(function(d) {
30 if((fullLayout.barmode === 'stack' && barcount > 1) ||
31 (fullLayout.bargap === 0 &&
32 fullLayout.bargroupgap === 0 &&
33 !d[0].trace.marker.line.width)) {
34 d3.select(this).attr('shape-rendering', 'crispEdges');
35 }
36 });
37
38 s.selectAll('g.points').each(function(d) {
39 var sel = d3.select(this);
40 var trace = d[0].trace;
41 stylePoints(sel, trace, gd);
42 });
43
44 Registry.getComponentMethod('errorbars', 'style')(s);
45}
46
47function stylePoints(sel, trace, gd) {
48 Drawing.pointStyle(sel.selectAll('path'), trace, gd);

Callers

nothing calls this directly

Calls 2

resizeTextFunction · 0.85
stylePointsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…