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

Function plotOne

src/traces/scatter/plot.js:113–621  ·  view source on GitHub ↗
(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transitionOpts)

Source from the content-addressed store, hash-verified

111}
112
113function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transitionOpts) {
114 var isStatic = gd._context.staticPlot;
115 var i;
116
117 // Since this has been reorganized and we're executing this on individual traces,
118 // we need to pass it the full list of cdscatter as well as this trace's index (idx)
119 // since it does an internal n^2 loop over comparisons with other traces:
120 selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll);
121
122 var hasTransition = !!transitionOpts && transitionOpts.duration > 0;
123
124 function transition(selection) {
125 return hasTransition ? selection.transition() : selection;
126 }
127
128 var xa = plotinfo.xaxis;
129 var ya = plotinfo.yaxis;
130
131 var trace = cdscatter[0].trace;
132 var line = trace.line;
133 var tr = d3.select(element);
134
135 var errorBarGroup = ensureSingle(tr, 'g', 'errorbars');
136 var lines = ensureSingle(tr, 'g', 'lines');
137 var points = ensureSingle(tr, 'g', 'points');
138 var text = ensureSingle(tr, 'g', 'text');
139
140 // error bars are at the bottom
141 Registry.getComponentMethod('errorbars', 'plot')(gd, errorBarGroup, plotinfo, transitionOpts);
142
143 if(trace.visible !== true) return;
144
145 transition(tr).style('opacity', trace.opacity);
146
147 // BUILD LINES AND FILLS
148 var ownFillEl3, tonext;
149 var ownFillDir = trace.fill.charAt(trace.fill.length - 1);
150 if(ownFillDir !== 'x' && ownFillDir !== 'y') ownFillDir = '';
151
152 var fillAxisIndex, fillAxisZero;
153 if(ownFillDir === 'y') {
154 fillAxisIndex = 1;
155 fillAxisZero = ya.c2p(0, true);
156 } else if(ownFillDir === 'x') {
157 fillAxisIndex = 0;
158 fillAxisZero = xa.c2p(0, true);
159 }
160
161 // store node for tweaking by selectPoints
162 cdscatter[0][plotinfo.isRangePlot ? 'nodeRangePlot3' : 'node3'] = tr;
163
164 var prevRevpath = '';
165 var prevPolygons = [];
166 var prevtrace = trace._prevtrace;
167 var prevFillsegments = null;
168 var prevFillElement = null;
169
170 if(prevtrace) {

Callers 1

plot.jsFile · 0.70

Calls 7

selectMarkersFunction · 0.85
makePolygonsToPreviousFunction · 0.85
makeSelfPolygonsFunction · 0.85
clearFillFunction · 0.85
transitionFunction · 0.70
makePointsFunction · 0.70
makeUpdateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…