Skip to content

Commit e12e97b

Browse files
move renderTitles closer to where it's used
and rename it so it's not clashing with the option and perhaps more consistent with some imagined consistency for #1200
1 parent 817df10 commit e12e97b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/scatter-plot.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dc.scatterPlot = function (parent, chartGroup) {
7878
.attr('fill', _chart.getColor)
7979
.attr('transform', _locator);
8080

81-
symbols.call(renderTitle, _chart.data());
81+
symbols.call(renderTitles, _chart.data());
8282

8383
symbols.each(function (d, i) {
8484
_filtered[i] = !_chart.filter() || _chart.filter().isFiltered([d.key[0], d.key[1]]);
@@ -110,6 +110,15 @@ dc.scatterPlot = function (parent, chartGroup) {
110110
.attr('opacity', 0).remove();
111111
};
112112

113+
function renderTitles (symbol, d) {
114+
if (_chart.renderTitle()) {
115+
symbol.selectAll('title').remove();
116+
symbol.append('title').text(function (d) {
117+
return _chart.title()(d);
118+
});
119+
}
120+
}
121+
113122
/**
114123
* Get or set the existence accessor. If a point exists, it is drawn with
115124
* {@link dc.scatterPlot#symbolSize symbolSize} radius and
@@ -260,15 +269,6 @@ dc.scatterPlot = function (parent, chartGroup) {
260269
return _chart;
261270
};
262271

263-
function renderTitle (symbol, d) {
264-
if (_chart.renderTitle()) {
265-
symbol.selectAll('title').remove();
266-
symbol.append('title').text(function (d) {
267-
return _chart.title()(d);
268-
});
269-
}
270-
}
271-
272272
/**
273273
* Set or get color for symbols when the group is empty. If null, just use the
274274
* {@link dc.colorMixin#colors colorMixin.colors} color scale zero value.

0 commit comments

Comments
 (0)