diff --git a/c3.js b/c3.js index a242774..92e7eb8 100644 --- a/c3.js +++ b/c3.js @@ -395,14 +395,14 @@ if (! text) { title = titleFormat ? titleFormat(d[i].x) : d[i].x; - text = "" + (title || title === 0 ? "" : ""); + text = "
" + title + "
" + (title || title === 0 ? "" : ""); } name = nameFormat(d[i].name); value = valueFormat(d[i].value, d[i].ratio, d[i].id, d[i].index); bgcolor = $$.levelColor ? $$.levelColor(d[i].value) : color(d[i].id); - text += ""; + text += ""; text += ""; text += ""; text += ""; @@ -660,51 +660,51 @@ // text when empty main.append("text") - .attr("class", CLASS[text] + ' ' + CLASS[empty]) + .attr("class", CLASS[_text] + ' ' + CLASS[_empty]) .attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers. .attr("dominant-baseline", "middle"); // vertical centering of text at y position in all browsers, except IE. // Regions main.append('g') .attr("clip-path", $$.clipPath) - .attr("class", CLASS[regions]); + .attr("class", CLASS[_regions]); // Grids $$.grid = main.append('g') .attr("clip-path", $$.clipPath) - .attr('class', CLASS[grid]); + .attr('class', CLASS[_grid]); if (config[__grid_x_show]) { - $$.grid.append("g").attr("class", CLASS[xgrids]); + $$.grid.append("g").attr("class", CLASS[_xgrids]); } if (config[__grid_y_show]) { - $$.grid.append('g').attr('class', CLASS[ygrids]); + $$.grid.append('g').attr('class', CLASS[_ygrids]); } - $$.grid.append('g').attr("class", CLASS[xgridLines]); - $$.grid.append('g').attr('class', CLASS[ygridLines]); + $$.grid.append('g').attr("class", CLASS[_xgridLines]); + $$.grid.append('g').attr('class', CLASS[_ygridLines]); if (config[__grid_focus_show]) { $$.grid.append('g') - .attr("class", CLASS[xgridFocus]) + .attr("class", CLASS[_xgridFocus]) .append('line') - .attr('class', CLASS[xgridFocus]); + .attr('class', CLASS[_xgridFocus]); } // Define g for chart area main.append('g') .attr("clip-path", $$.clipPath) - .attr('class', CLASS[chart]); + .attr('class', CLASS[_chart]); // Cover whole with rects for events - eventRect = main.select('.' + CLASS[chart]).append("g") - .attr("class", CLASS[eventRects]) + eventRect = main.select('.' + CLASS[_chart]).append("g") + .attr("class", CLASS[_eventRects]) .style('fill-opacity', 0); // Define g for bar chart area - main.select('.' + CLASS[chart]).append("g") - .attr("class", CLASS[chartBars]); + main.select('.' + CLASS[_chart]).append("g") + .attr("class", CLASS[_chartBars]); // Define g for line chart area - main.select('.' + CLASS[chart]).append("g") - .attr("class", CLASS[chartLines]); + main.select('.' + CLASS[_chart]).append("g") + .attr("class", CLASS[_chartLines]); // Define g for arc chart area if (isFunction($$.initArc)) { @@ -714,12 +714,12 @@ $$.initGauge(); } - main.select('.' + CLASS[chart]).append("g") - .attr("class", CLASS[chartTexts]); + main.select('.' + CLASS[_chart]).append("g") + .attr("class", CLASS[_chartTexts]); // if zoom privileged, insert rect to forefront - main.insert('rect', config[__zoom_privileged] ? null : 'g.' + CLASS[regions]) - .attr('class', CLASS[zoomRect]) + main.insert('rect', config[__zoom_privileged] ? null : 'g.' + CLASS[_regions]) + .attr('class', CLASS[_zoomRect]) .attr('width', $$.width) .attr('height', $$.height) .style('opacity', 0) @@ -732,32 +732,32 @@ // Add Axis $$.axes.x = main.append("g") - .attr("class", CLASS[axis] + ' ' + CLASS[axisX]) + .attr("class", CLASS[_axis] + ' ' + CLASS[_axisX]) .attr("clip-path", $$.clipPathForXAxis) .attr("transform", $$.translate.x) .style("visibility", config[__axis_x_show] ? 'visible' : 'hidden'); $$.axes.x.append("text") - .attr("class", CLASS[axisXLabel]) + .attr("class", CLASS[_axisXLabel]) .attr("transform", config[__axis_rotated] ? "rotate(-90)" : "") .style("text-anchor", generateCall($$.textAnchorForXAxisLabel, $$)); $$.axes.y = main.append("g") - .attr("class", CLASS[axis] + ' ' + CLASS[axisY]) + .attr("class", CLASS[_axis] + ' ' + CLASS[_axisY]) .attr("clip-path", $$.clipPathForYAxis) .attr("transform", $$.translate.y) .style("visibility", config[__axis_y_show] ? 'visible' : 'hidden'); $$.axes.y.append("text") - .attr("class", CLASS[axisYLabel]) + .attr("class", CLASS[_axisYLabel]) .attr("transform", config[__axis_rotated] ? "" : "rotate(-90)") .style("text-anchor", generateCall($$.textAnchorForYAxisLabel, $$)); $$.axes.y2 = main.append("g") - .attr("class", CLASS[axis] + ' ' + CLASS[axisY2]) + .attr("class", CLASS[_axis] + ' ' + CLASS[_axisY2]) // clip-path? .attr("transform", $$.translate.y2) .style("visibility", config[__axis_y2_show] ? 'visible' : 'hidden'); $$.axes.y2.append("text") - .attr("class", CLASS[axisY2Label]) + .attr("class", CLASS[_axisY2Label]) .attr("transform", config[__axis_rotated] ? "" : "rotate(-90)") .style("text-anchor", generateCall($$.textAnchorForY2AxisLabel, $$)); @@ -913,7 +913,7 @@ /*-- Main --*/ //-- Text --// - mainTextUpdate = main.select('.' + CLASS[chartTexts]).selectAll('.' + CLASS[chartText]) + mainTextUpdate = main.select('.' + CLASS[_chartTexts]).selectAll('.' + CLASS[_chartText]) .data(targets) .attr('class', generateCall($$.classChartText, $$)); mainTextEnter = mainTextUpdate.enter().append('g') @@ -924,7 +924,7 @@ .attr('class', generateCall($$.classTexts, $$)); //-- Bar --// - mainBarUpdate = main.select('.' + CLASS[chartBars]).selectAll('.' + CLASS[chartBar]) + mainBarUpdate = main.select('.' + CLASS[_chartBars]).selectAll('.' + CLASS[_chartBar]) .data(targets) .attr('class', generateCall($$.classChartBar, $$)); mainBarEnter = mainBarUpdate.enter().append('g') @@ -937,7 +937,7 @@ .style("cursor", function (d) { return config[__data_selection_isselectable](d) ? "pointer" : null; }); //-- Line --// - mainLineUpdate = main.select('.' + CLASS[chartLines]).selectAll('.' + CLASS[chartLine]) + mainLineUpdate = main.select('.' + CLASS[_chartLines]).selectAll('.' + CLASS[_chartLine]) .data(targets) .attr('class', generateCall($$.classChartLine, $$)); mainLineEnter = mainLineUpdate.enter().append('g') @@ -952,13 +952,13 @@ .attr('class', generateCall($$.classAreas, $$)); // Circles for each data point on lines mainLineEnter.append('g') - .attr("class", function (d) { return $$.generateClass(CLASS[selectedCircles], d.id); }); + .attr("class", function (d) { return $$.generateClass(CLASS[_selectedCircles], d.id); }); mainLineEnter.append('g') .attr("class", generateCall($$.classCircles, $$)) .style("cursor", function (d) { return config[__data_selection_isselectable](d) ? "pointer" : null; }); // Update date for selected circles targets.forEach(function (t) { - main.selectAll('.' + CLASS[selectedCircles] + $$.getTargetSelectorSuffix(t.id)).selectAll('.' + CLASS[selectedCircle]).each(function (d) { + main.selectAll('.' + CLASS[_selectedCircles] + $$.getTargetSelectorSuffix(t.id)).selectAll('.' + CLASS[_selectedCircle]).each(function (d) { d.value = t.values[d.index].value; }); }); @@ -975,7 +975,7 @@ /*-- Show --*/ // Fade-in each chart - $$.svg.selectAll('.' + CLASS[target]).filter(function (d) { return $$.isTargetToShow(d.id); }) + $$.svg.selectAll('.' + CLASS[_target]).filter(function (d) { return $$.isTargetToShow(d.id); }) .transition().duration(config[__transition_duration]) .style("opacity", 1); }; @@ -1059,14 +1059,14 @@ break; } } - $$.svg.selectAll('.' + CLASS[axisX] + ' .tick text').each(function (e) { + $$.svg.selectAll('.' + CLASS[_axisX] + ' .tick text').each(function (e) { var index = tickValues.indexOf(e); if (index >= 0) { d3.select(this).style('display', index % intervalForCulling ? 'none' : 'block'); } }); } else { - $$.svg.selectAll('.' + CLASS[axisX] + ' .tick text').style('display', 'block'); + $$.svg.selectAll('.' + CLASS[_axisX] + ' .tick text').style('display', 'block'); } } @@ -1093,7 +1093,7 @@ $$.updateXgridFocus(); // Data empty label positioning and text. - main.select("text." + CLASS[text] + '.' + CLASS[empty]) + main.select("text." + CLASS[_text] + '.' + CLASS[_empty]) .attr("x", $$.width / 2) .attr("y", $$.height / 2) .text(config[__data_empty_label_text]) @@ -1101,7 +1101,7 @@ .style('opacity', targetsToShow.length ? 0 : 1); // grid - main.select('line.' + CLASS[xgridFocus]).style("visibility", "hidden"); + main.select('line.' + CLASS[_xgridFocus]).style("visibility", "hidden"); if (config[__grid_x_show]) { xgridAttr = config[__axis_rotated] ? { 'x1': 0, @@ -1118,9 +1118,9 @@ flushXGrid = function (withoutUpdate) { xgridData = $$.generateGridData(config[__grid_x_type], $$.x); tickOffset = $$.isCategorized ? $$.xAxis.tickOffset() : 0; - xgrid = main.select('.' + CLASS[xgrids]).selectAll('.' + CLASS[xgrid]) + xgrid = main.select('.' + CLASS[_xgrids]).selectAll('.' + CLASS[_xgrid]) .data(xgridData); - xgrid.enter().append('line').attr("class", CLASS[xgrid]); + xgrid.enter().append('line').attr("class", CLASS[_xgrid]); if (!withoutUpdate) { xgrid.attr(xgridAttr) .style("opacity", function () { return +d3.select(this).attr(config[__axis_rotated] ? 'y1' : 'x1') === (config[__axis_rotated] ? $$.height : 0) ? 0 : 1; }); @@ -1129,11 +1129,11 @@ }; flushXGrid(); } - xgridLines = main.select('.' + CLASS[xgridLines]).selectAll('.' + CLASS[xgridLine]) + xgridLines = main.select('.' + CLASS[_xgridLines]).selectAll('.' + CLASS[_xgridLine]) .data(config[__grid_x_lines]); // enter xgridLine = xgridLines.enter().append('g') - .attr("class", function (d) { return CLASS[xgridLine] + (d.class ? ' ' + d.class : ''); }); + .attr("class", function (d) { return CLASS[_xgridLine] + (d.class ? ' ' + d.class : ''); }); xgridLine.append('line') .style("opacity", 0); xgridLine.append('text') @@ -1150,10 +1150,10 @@ .remove(); // Y-Grid if (withY && config[__grid_y_show]) { - ygrid = main.select('.' + CLASS[ygrids]).selectAll('.' + CLASS[ygrid]) + ygrid = main.select('.' + CLASS[_ygrids]).selectAll('.' + CLASS[_ygrid]) .data($$.y.ticks(config[__grid_y_ticks])); ygrid.enter().append('line') - .attr('class', CLASS[ygrid]); + .attr('class', CLASS[_ygrid]); ygrid.attr("x1", config[__axis_rotated] ? $$.y : 0) .attr("x2", config[__axis_rotated] ? $$.y : $$.width) .attr("y1", config[__axis_rotated] ? 0 : $$.y) @@ -1162,11 +1162,11 @@ $$.smoothLines(ygrid, 'grid'); } if (withY) { - ygridLines = main.select('.' + CLASS[ygridLines]).selectAll('.' + CLASS[ygridLine]) + ygridLines = main.select('.' + CLASS[_ygridLines]).selectAll('.' + CLASS[_ygridLine]) .data(config[__grid_y_lines]); // enter ygridLine = ygridLines.enter().append('g') - .attr("class", function (d) { return CLASS[ygridLine] + (d.class ? ' ' + d.class : ''); }); + .attr("class", function (d) { return CLASS[_ygridLine] + (d.class ? ' ' + d.class : ''); }); ygridLine.append('line') .style("opacity", 0); ygridLine.append('text') @@ -1197,7 +1197,7 @@ } // rect for regions - mainRegion = main.select('.' + CLASS[regions]).selectAll('.' + CLASS[region]) + mainRegion = main.select('.' + CLASS[_regions]).selectAll('.' + CLASS[_region]) .data(config[__regions]); mainRegion.enter().append('g') .attr('class', generateCall($$.classRegion, $$)) @@ -1208,7 +1208,7 @@ .remove(); // bars - mainBar = main.selectAll('.' + CLASS[bars]).selectAll('.' + CLASS[bar]) + mainBar = main.selectAll('.' + CLASS[_bars]).selectAll('.' + CLASS[_bar]) .data(generateCall($$.barData, $$)); mainBar.enter().append('path') .attr("class", generateCall($$.classBar, $$)) @@ -1221,7 +1221,7 @@ .remove(); // lines, areas and cricles - mainLine = main.selectAll('.' + CLASS[lines]).selectAll('.' + CLASS[line]) + mainLine = main.selectAll('.' + CLASS[_lines]).selectAll('.' + CLASS[_line]) .data(generateCall($$.lineData, $$)); mainLine.enter().append('path') .attr('class', generateCall($$.classLine, $$)) @@ -1233,7 +1233,7 @@ .style('opacity', 0) .remove(); - mainArea = main.selectAll('.' + CLASS[areas]).selectAll('.' + CLASS[area]) + mainArea = main.selectAll('.' + CLASS[_areas]).selectAll('.' + CLASS[_area]) .data(generateCall($$.lineData, $$)); mainArea.enter().append('path') .attr("class", generateCall($$.classArea, $$)) @@ -1246,7 +1246,7 @@ .remove(); if (config[__point_show]) { - mainCircle = main.selectAll('.' + CLASS[circles]).selectAll('.' + CLASS[circle]) + mainCircle = main.selectAll('.' + CLASS[_circles]).selectAll('.' + CLASS[_circle]) .data(generateCall($$.lineOrScatterData, $$)); mainCircle.enter().append("circle") .attr("class", generateCall($$.classCircle, $$)) @@ -1258,7 +1258,7 @@ } if ($$.hasDataLabel()) { - mainText = main.selectAll('.' + CLASS[texts]).selectAll('.' + CLASS[text]) + mainText = main.selectAll('.' + CLASS[_texts]).selectAll('.' + CLASS[_text]) .data(generateCall($$.barOrLineData, $$)); mainText.enter().append('text') .attr("class", generateCall($$.classText, $$)) @@ -1285,23 +1285,23 @@ } // circles for select - main.selectAll('.' + CLASS[selectedCircles]) + main.selectAll('.' + CLASS[_selectedCircles]) .filter(generateCall($$.isBarType, $$)) .selectAll('circle') .remove(); if (config[__interaction_enabled]) { // rect for mouseover - eventRect = main.select('.' + CLASS[eventRects]) + eventRect = main.select('.' + CLASS[_eventRects]) .style('cursor', config[__zoom_enabled] ? config[__axis_rotated] ? 'ns-resize' : 'ew-resize' : null); if (notEmpty(config[__data_xs]) && !$$.isSingleX(config[__data_xs])) { - if (!eventRect.classed(CLASS[eventRectsMultiple])) { - eventRect.classed(CLASS[eventRectsMultiple], true).classed(CLASS[eventRectsSingle], false) - .selectAll('.' + CLASS[eventRect]).remove(); + if (!eventRect.classed(CLASS[_eventRectsMultiple])) { + eventRect.classed(CLASS[_eventRectsMultiple], true).classed(CLASS[_eventRectsSingle], false) + .selectAll('.' + CLASS[_eventRect]).remove(); } - eventRectUpdate = main.select('.' + CLASS[eventRects]).selectAll('.' + CLASS[eventRect]) + eventRectUpdate = main.select('.' + CLASS[_eventRects]).selectAll('.' + CLASS[_eventRect]) .data([0]); // enter : only one rect will be added $$.generateEventRectsForMultipleXs(eventRectUpdate.enter()); @@ -1314,9 +1314,9 @@ // exit : not needed because always only one rect exists } else { - if (!eventRect.classed(CLASS[eventRectsSingle])) { - eventRect.classed(CLASS[eventRectsMultiple], false).classed(CLASS[eventRectsSingle], true) - .selectAll('.' + CLASS[eventRect]).remove(); + if (!eventRect.classed(CLASS[_eventRectsSingle])) { + eventRect.classed(CLASS[_eventRectsMultiple], false).classed(CLASS[_eventRectsSingle], true) + .selectAll('.' + CLASS[_eventRect]).remove(); } if (($$.isCustomX() || $$.isTimeSeries) && !$$.isCategorized) { @@ -1337,10 +1337,10 @@ } // Set data maxDataCountTarget = $$.getMaxDataCountTarget($$.data.targets); - main.select('.' + CLASS[eventRects]) + main.select('.' + CLASS[_eventRects]) .datum(maxDataCountTarget ? maxDataCountTarget.values : []); // Update rects - eventRectUpdate = main.select('.' + CLASS[eventRects]).selectAll('.' + CLASS[eventRect]) + eventRectUpdate = main.select('.' + CLASS[_eventRects]).selectAll('.' + CLASS[_eventRect]) .data(function (d) { return d; }); // enter $$.generateEventRectsForSingleX(eventRectUpdate.enter()); @@ -1381,7 +1381,7 @@ .style("fill", $$.color) .attr("cx", cx) .attr("cy", cy)); - transitions.push(main.selectAll('.' + CLASS[selectedCircle]).transition() + transitions.push(main.selectAll('.' + CLASS[_selectedCircle]).transition() .attr("cx", cx) .attr("cy", cy)); transitions.push(mainText.transition() @@ -1477,14 +1477,14 @@ // remove flowed elements if (flowLength) { for (i = 0; i < flowLength; i++) { - shapes.push('.' + CLASS[shape] + '-' + (flowIndex + i)); - texts.push('.' + CLASS[text] + '-' + (flowIndex + i)); - eventRects.push('.' + CLASS[eventRect] + '-' + (flowIndex + i)); + shapes.push('.' + CLASS[_shape] + '-' + (flowIndex + i)); + texts.push('.' + CLASS[_text] + '-' + (flowIndex + i)); + eventRects.push('.' + CLASS[_eventRect] + '-' + (flowIndex + i)); } - $$.svg.selectAll('.' + CLASS[shapes]).selectAll(shapes).remove(); - $$.svg.selectAll('.' + CLASS[texts]).selectAll(texts).remove(); - $$.svg.selectAll('.' + CLASS[eventRects]).selectAll(eventRects).remove(); - $$.svg.select('.' + CLASS[xgrid]).remove(); + $$.svg.selectAll('.' + CLASS[_shapes]).selectAll(shapes).remove(); + $$.svg.selectAll('.' + CLASS[_texts]).selectAll(texts).remove(); + $$.svg.selectAll('.' + CLASS[_eventRects]).selectAll(eventRects).remove(); + $$.svg.select('.' + CLASS[_xgrid]).remove(); } // draw again for removing flowed elements and reverting attr @@ -1626,7 +1626,7 @@ $$.expandBars(index); // Call event handler - $$.main.selectAll('.' + CLASS[shape] + '-' + index).each(function (d) { + $$.main.selectAll('.' + CLASS[_shape] + '-' + index).each(function (d) { config[__data_onmouseover].call(c3, d); }); }) @@ -1639,13 +1639,13 @@ $$.unexpandCircles(index); $$.unexpandBars(); // Call event handler - $$.main.selectAll('.' + CLASS[shape] + '-' + index).each(function (d) { + $$.main.selectAll('.' + CLASS[_shape] + '-' + index).each(function (d) { config[__data_onmouseout].call($$, d); }); }) .on('mousemove', function (d) { var selectedData, index = d.index, - eventRect = $$.svg.select('.' + CLASS[eventRect] + '-' + index); + eventRect = $$.svg.select('.' + CLASS[_eventRect] + '-' + index); if ($$.dragging) { return; } // do nothing when dragging if ($$.hasArcType()) { return; } @@ -1664,9 +1664,9 @@ return; } - $$.main.selectAll('.' + CLASS[shape] + '-' + index) + $$.main.selectAll('.' + CLASS[_shape] + '-' + index) .each(function () { - d3.select(this).classed(CLASS[EXPANDED], true); + d3.select(this).classed(CLASS[_EXPANDED], true); if (config[__data_selection_enabled]) { eventRect.style('cursor', config[__data_selection_grouped] ? 'pointer' : null); } @@ -1706,7 +1706,7 @@ $$.cancelClick = false; return; } - $$.main.selectAll('.' + CLASS[shape] + '-' + index).each(function (d) { $$.toggleShape(this, d, index); }); + $$.main.selectAll('.' + CLASS[_shape] + '-' + index).each(function (d) { $$.toggleShape(this, d, index); }); }) .call( d3.behavior.drag().origin(Object) @@ -1724,7 +1724,7 @@ .attr('y', 0) .attr('width', $$.width) .attr('height', $$.height) - .attr('class', CLASS[eventRect]) + .attr('class', CLASS[_eventRect]) .on('mouseout', function () { if ($$.hasArcType()) { return; } $$.hideXGridFocus(); @@ -1766,13 +1766,13 @@ // Show cursor as pointer if point is close to mouse position if ($$.dist(closest, mouse) < 100) { - $$.svg.select('.' + CLASS[eventRect]).style('cursor', 'pointer'); + $$.svg.select('.' + CLASS[_eventRect]).style('cursor', 'pointer'); if (!$$.mouseover) { config[__data_onmouseover].call($$, closest); $$.mouseover = true; } } else if ($$.mouseover) { - $$.svg.select('.' + CLASS[eventRect]).style('cursor', null); + $$.svg.select('.' + CLASS[_eventRect]).style('cursor', null); config[__data_onmouseout].call($$, closest); $$.mouseover = false; } @@ -1790,7 +1790,7 @@ // select if selection enabled if ($$.dist(closest, mouse) < 100) { - $$.main.select('.' + CLASS[circles] + $$.getTargetSelectorSuffix(closest.id)).select('.' + CLASS[circle] + '-' + closest.index).each(function () { + $$.main.select('.' + CLASS[_circles] + $$.getTargetSelectorSuffix(closest.id)).select('.' + CLASS[_circle] + '-' + closest.index).each(function () { $$.toggleShape(this, closest, closest.index); }); } @@ -1845,26 +1845,26 @@ if (transitions && transitions.axisX) { xAxis = transitions.axisX; } else { - xAxis = $$.main.select('.' + CLASS[axisX]); + xAxis = $$.main.select('.' + CLASS[_axisX]); if (withTransition) { xAxis = xAxis.transition(); } } if (transitions && transitions.axisY) { yAxis = transitions.axisY; } else { - yAxis = $$.main.select('.' + CLASS[axisY]); + yAxis = $$.main.select('.' + CLASS[_axisY]); if (withTransition) { yAxis = yAxis.transition(); } } if (transitions && transitions.axisY2) { y2Axis = transitions.axisY2; } else { - y2Axis = $$.main.select('.' + CLASS[axisY2]); + y2Axis = $$.main.select('.' + CLASS[_axisY2]); if (withTransition) { y2Axis = y2Axis.transition(); } } (withTransition ? $$.main.transition() : $$.main).attr("transform", $$.translate.main); xAxis.attr("transform", $$.translate.x); yAxis.attr("transform", $$.translate.y); y2Axis.attr("transform", $$.translate.y2); - $$.main.select('.' + CLASS[chartArcs]).attr("transform", $$.translate.arc); + $$.main.select('.' + CLASS[_chartArcs]).attr("transform", $$.translate.arc); }; c3_chart_internal_fn.transformLegend = function (withTransition) { var $$ = this; @@ -1894,7 +1894,7 @@ .attr('y', generateCall($$.getYAxisClipY, $$)) .attr('width', generateCall($$.getYAxisClipWidth, $$)) .attr('height', generateCall($$.getYAxisClipHeight, $$)); - $$.svg.select('.' + CLASS[zoomRect]) + $$.svg.select('.' + CLASS[_zoomRect]) .attr('width', $$.width) .attr('height', $$.height); // MEMO: parent div's height will be bigger than svg when @@ -2022,7 +2022,7 @@ c3_chart_internal_fn.getSvgLeft = function () { var $$ = this, config = $$.config, - leftAxisClass = config[__axis_rotated] ? CLASS[axisX] : CLASS[axisY], + leftAxisClass = config[__axis_rotated] ? CLASS[_axisX] : CLASS[_axisY], leftAxis = $$.main.select('.' + leftAxisClass).node(), svgRect = leftAxis ? leftAxis.getBoundingClientRect() : {right: 0}, chartRect = $$.selectChart.node().getBoundingClientRect(), @@ -2124,7 +2124,7 @@ if (! config[__tooltip_show]) { return; } // Hide when scatter plot exists if ($$.hasType('scatter') || $$.hasArcType()) { return; } - var focusEl = $$.main.selectAll('line.' + CLASS[xgridFocus]); + var focusEl = $$.main.selectAll('line.' + CLASS[_xgridFocus]); focusEl .style("visibility", "visible") .data([dataToShow[0]]) @@ -2133,11 +2133,11 @@ $$.smoothLines(focusEl, 'grid'); }; c3_chart_internal_fn.hideXGridFocus = function () { - this.main.select('line.' + CLASS[xgridFocus]).style("visibility", "hidden"); + this.main.select('line.' + CLASS[_xgridFocus]).style("visibility", "hidden"); }; c3_chart_internal_fn.updateXgridFocus = function () { var $$ = this, config = $$.config; - $$.main.select('line.' + CLASS[xgridFocus]) + $$.main.select('line.' + CLASS[_xgridFocus]) .attr("x1", config[__axis_rotated] ? 0 : -10) .attr("x2", config[__axis_rotated] ? $$.width : -10) .attr("y1", config[__axis_rotated] ? -10 : 0) @@ -2146,7 +2146,7 @@ c3_chart_internal_fn.generateGridData = function (type, scale) { var $$ = this, gridData = [], xDomain, firstYear, lastYear, i, - tickNum = $$.main.select("." + CLASS[axisX]).selectAll('.tick').size(); + tickNum = $$.main.select("." + CLASS[_axisX]).selectAll('.tick').size(); if (type === 'year') { xDomain = $$.getXDomain(); firstYear = xDomain[0].getFullYear(); @@ -2177,8 +2177,8 @@ var $$ = this, config = $$.config, toRemove = $$.getGridFilterToRemove(params), toShow = function (line) { return !toRemove(line); }, - classLines = forX ? CLASS[xgridLines] : CLASS[ygridLines], - classLine = forX ? CLASS[xgridLine] : CLASS.ygridLine; + classLines = forX ? CLASS[_xgridLines] : CLASS[_ygridLines], + classLine = forX ? CLASS[_xgridLine] : CLASS.ygridLine; $$.main.select('.' + classLines).selectAll('.' + classLine).filter(toRemove) .transition().duration(config[__transition_duration]) .style('opacity', 0).remove(); @@ -2221,15 +2221,15 @@ }; c3_chart_internal_fn.opacityForLegend = function (legendItem) { var $$ = this; - return legendItem.classed(CLASS[legendItemHidden]) ? $$.legendOpacityForHidden : 1; + return legendItem.classed(CLASS[_legendItemHidden]) ? $$.legendOpacityForHidden : 1; }; c3_chart_internal_fn.opacityForUnfocusedLegend = function (legendItem) { var $$ = this; - return legendItem.classed(CLASS[legendItemHidden]) ? $$.legendOpacityForHidden : 0.3; + return legendItem.classed(CLASS[_legendItemHidden]) ? $$.legendOpacityForHidden : 0.3; }; c3_chart_internal_fn.toggleFocusLegend = function (id, focus) { var $$ = this; - $$.legend.selectAll('.' + CLASS[legendItem]) + $$.legend.selectAll('.' + CLASS[_legendItem]) .transition().duration(100) .style('opacity', function (_id) { var This = $$.d3.select(this); @@ -2242,7 +2242,7 @@ }; c3_chart_internal_fn.revertLegend = function () { var $$ = this, d3 = $$.d3; - $$.legend.selectAll('.' + CLASS[legendItem]) + $$.legend.selectAll('.' + CLASS[_legendItem]) .transition().duration(100) .style('opacity', function () { return $$.opacityForLegend(d3.select(this)); }); }; @@ -2275,7 +2275,7 @@ var paddingTop = 4, paddingRight = 36, maxWidth = 0, maxHeight = 0, posMin = 10; var l, totalLength = 0, offsets = {}, widths = {}, heights = {}, margins = [0], steps = {}, step = 0; var withTransition, withTransitionForTransform; - var hasFocused = $$.legend.selectAll('.' + CLASS[legendItemFocused]).size(); + var hasFocused = $$.legend.selectAll('.' + CLASS[_legendItemFocused]).size(); var texts, rects, tiles; options = options || {}; @@ -2283,7 +2283,7 @@ withTransitionForTransform = getOption(options, "withTransitionForTransform", true); function updatePositions(textElement, id, reset) { - var box = $$.getTextRect(textElement.textContent, CLASS[legendItem]), + var box = $$.getTextRect(textElement.textContent, CLASS[_legendItem]), itemWidth = Math.ceil((box.width + paddingRight) / 10) * 10, itemHeight = Math.ceil((box.height + paddingTop) / 10) * 10, itemLength = $$.isLegendRight || $$.isLegendInset ? itemHeight : itemWidth, @@ -2358,17 +2358,17 @@ yForLegendRect = function (id, i) { return yForLegend(id, i) - 7; }; // Define g for legend area - l = $$.legend.selectAll('.' + CLASS[legendItem]) + l = $$.legend.selectAll('.' + CLASS[_legendItem]) .data(targetIds) .enter().append('g') - .attr('class', function (id) { return $$.generateClass(CLASS[legendItem], id); }) + .attr('class', function (id) { return $$.generateClass(CLASS[_legendItem], id); }) .style('visibility', function (id) { return $$.isLegendToShow(id) ? 'visible' : 'hidden'; }) .style('cursor', 'pointer') .on('click', function (id) { isFunction(config[__legend_item_onclick]) ? config[__legend_item_onclick].call(c3, id) : $$.api.toggle(id); }) .on('mouseover', function (id) { - $$.d3.select(this).classed(CLASS[legendItemFocused], true); + $$.d3.select(this).classed(CLASS[_legendItemFocused], true); if (!$$.transiting) { $$.api.focus(id); } @@ -2377,7 +2377,7 @@ } }) .on('mouseout', function (id) { - $$.d3.select(this).classed(CLASS[legendItemFocused], false); + $$.d3.select(this).classed(CLASS[_legendItemFocused], false); if (!$$.transiting) { $$.api.revert(); } @@ -2392,12 +2392,12 @@ .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendText : -200) .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegendText); l.append('rect') - .attr("class", CLASS[legendItemEvent]) + .attr("class", CLASS[_legendItemEvent]) .style('fill-opacity', 0) .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendRect : -200) .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegendRect); l.append('rect') - .attr("class", CLASS[legendItemTile]) + .attr("class", CLASS[_legendItemTile]) .style("pointer-events", "none") .style('fill', $$.color) .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendText : -200) @@ -2406,8 +2406,8 @@ .attr('height', 10); // Set background for inset legend if ($$.isLegendInset && maxWidth !== 0) { - $$.legend.insert('g', '.' + CLASS[legendItem]) - .attr("class", CLASS[legendBackground]) + $$.legend.insert('g', '.' + CLASS[_legendItem]) + .attr("class", CLASS[_legendBackground]) .append('rect') .attr('height', $$.getLegendHeight() - 10) .attr('width', maxWidth * (step + 1) + 10); @@ -2421,7 +2421,7 @@ .attr('x', xForLegendText) .attr('y', yForLegendText); - rects = $$.legend.selectAll('rect.' + CLASS[legendItemEvent]) + rects = $$.legend.selectAll('rect.' + CLASS[_legendItemEvent]) .data(targetIds); (withTransition ? rects.transition() : rects) .attr('width', function (id) { return widths[id]; }) @@ -2429,7 +2429,7 @@ .attr('x', xForLegendRect) .attr('y', yForLegendRect); - tiles = $$.legend.selectAll('rect.' + CLASS[legendItemTile]) + tiles = $$.legend.selectAll('rect.' + CLASS[_legendItemTile]) .data(targetIds); (withTransition ? tiles.transition() : tiles) .style('fill', $$.color) @@ -2437,13 +2437,13 @@ .attr('y', yForLegend); // toggle legend state - $$.legend.selectAll('.' + CLASS[legendItem]) - .classed(CLASS[legendItemHidden], function (id) { return !$$.isTargetToShow(id); }) + $$.legend.selectAll('.' + CLASS[_legendItem]) + .classed(CLASS[_legendItemHidden], function (id) { return !$$.isTargetToShow(id); }) .transition() .style('opacity', function (id) { var This = $$.d3.select(this); if ($$.isTargetToShow(id)) { - return !hasFocused || This.classed(CLASS[legendItemFocused]) ? $$.opacityForLegend(This) : $$.opacityForUnfocusedLegend(This); + return !hasFocused || This.classed(CLASS[_legendItemFocused]) ? $$.opacityForLegend(This) : $$.opacityForUnfocusedLegend(This); } else { return $$.legendOpacityForHidden; } @@ -3041,7 +3041,7 @@ // Reset fadein for future load $$.withoutFadeIn[id] = false; // Remove target's elements - $$.legend.selectAll('.' + CLASS[legendItem] + $$.getTargetSelectorSuffix(id)).remove(); + $$.legend.selectAll('.' + CLASS[_legendItem] + $$.getTargetSelectorSuffix(id)).remove(); // Remove target $$.data.targets = $$.data.targets.filter(function (t) { return t.id !== id; @@ -3127,19 +3127,19 @@ }; c3_chart_internal_fn.getCircles = function (i, id) { var $$ = this; - return (id ? $$.main.selectAll('.' + CLASS[circles] + $$.getTargetSelectorSuffix(id)) : $$.main).selectAll('.' + CLASS[circle] + (isValue(i) ? '-' + i : '')); + return (id ? $$.main.selectAll('.' + CLASS[_circles] + $$.getTargetSelectorSuffix(id)) : $$.main).selectAll('.' + CLASS[_circle] + (isValue(i) ? '-' + i : '')); }; c3_chart_internal_fn.expandCircles = function (i, id) { var $$ = this; $$.getCircles(i, id) - .classed(CLASS[EXPANDED], true) + .classed(CLASS[_EXPANDED], true) .attr('r', generateCall($$.pointExpandedR, $$)); }; c3_chart_internal_fn.unexpandCircles = function (i) { var $$ = this; $$.getCircles(i) - .filter(function () { return $$.d3.select(this).classed(CLASS[EXPANDED]); }) - .classed(CLASS[EXPANDED], false) + .filter(function () { return $$.d3.select(this).classed(CLASS[_EXPANDED]); }) + .classed(CLASS[_EXPANDED], false) .attr('r', generateCall($$.pointR, $$)); }; c3_chart_internal_fn.pointR = function (d) { @@ -3164,15 +3164,15 @@ }; c3_chart_internal_fn.getBars = function (i) { var $$ = this; - return $$.main.selectAll('.' + CLASS[bar] + (isValue(i) ? '-' + i : '')); + return $$.main.selectAll('.' + CLASS[_bar] + (isValue(i) ? '-' + i : '')); }; c3_chart_internal_fn.expandBars = function (i) { var $$ = this; - $$.getBars(i).classed(CLASS[EXPANDED], true); + $$.getBars(i).classed(CLASS[_EXPANDED], true); }; c3_chart_internal_fn.unexpandBars = function (i) { var $$ = this; - $$.getBars(i).classed(CLASS[EXPANDED], false); + $$.getBars(i).classed(CLASS[_EXPANDED], false); }; c3_chart_internal_fn.generateDrawBar = function (barIndices, isSub) { var $$ = this, config = $$.config, @@ -4199,9 +4199,9 @@ c3_chart_internal_fn.updateAxisLabels = function (withTransition) { var $$ = this; - var axisXLabel = $$.main.select('.' + CLASS[axisX] + ' .' + CLASS[axisXLabel]), - axisYLabel = $$.main.select('.' + CLASS[axisY] + ' .' + CLASS[axisYLabel]), - axisY2Label = $$.main.select('.' + CLASS[axisY2] + ' .' + CLASS[axisY2Label]); + var axisXLabel = $$.main.select('.' + CLASS[_axisX] + ' .' + CLASS[_axisXLabel]), + axisYLabel = $$.main.select('.' + CLASS[_axisY] + ' .' + CLASS[_axisYLabel]), + axisY2Label = $$.main.select('.' + CLASS[_axisY2] + ' .' + CLASS[_axisY2Label]); (withTransition ? axisXLabel.transition() : axisXLabel) .attr("x", generateCall($$.xForXAxisLabel, $$)) .attr("dx", generateCall($$.dxForXAxisLabel, $$)) @@ -4427,8 +4427,8 @@ c3_chart_internal_fn.expandArc = function (id, withoutFadeOut) { var $$ = this, - target = $$.svg.selectAll('.' + CLASS[chartArc] + $$.selectorTarget(id)), - noneTargets = $$.svg.selectAll('.' + CLASS[arc]).filter(function (data) { return data.data.id !== id; }); + target = $$.svg.selectAll('.' + CLASS[_chartArc] + $$.selectorTarget(id)), + noneTargets = $$.svg.selectAll('.' + CLASS[_arc]).filter(function (data) { return data.data.id !== id; }); if ($$.shouldExpand(id)) { target.selectAll('path') @@ -4449,11 +4449,11 @@ c3_chart_internal_fn.unexpandArc = function (id) { var $$ = this, - target = $$.svg.selectAll('.' + CLASS[chartArc] + $$.selectorTarget(id)); - target.selectAll('path.' + CLASS[arc]) + target = $$.svg.selectAll('.' + CLASS[_chartArc] + $$.selectorTarget(id)); + target.selectAll('path.' + CLASS[_arc]) .transition().duration(50) .attr("d", $$.svgArc); - $$.svg.selectAll('.' + CLASS[arc]) + $$.svg.selectAll('.' + CLASS[_arc]) .style("opacity", 1); }; @@ -4501,7 +4501,7 @@ c3_chart_internal_fn.updateTargetsForArc = function (targets) { var $$ = this, main = $$.main, mainPieUpdate, mainPieEnter; - mainPieUpdate = main.select('.' + CLASS[chartArcs]).selectAll('.' + CLASS[chartArc]) + mainPieUpdate = main.select('.' + CLASS[_chartArcs]).selectAll('.' + CLASS[_chartArc]) .data($$.pie(targets)) .attr("class", generateCall($$.classChartArc, $$)); mainPieEnter = mainPieUpdate.enter().append("g") @@ -4519,11 +4519,11 @@ c3_chart_internal_fn.initArc = function () { var $$ = this, arcs; - arcs = $$.main.select('.' + CLASS[chart]).append("g") - .attr("class", CLASS[chartArcs]) + arcs = $$.main.select('.' + CLASS[_chart]).append("g") + .attr("class", CLASS[_chartArcs]) .attr("transform", $$.translate.arc); arcs.append('text') - .attr('class', CLASS[chartArcsTitle]) + .attr('class', CLASS[_chartArcsTitle]) .style("text-anchor", "middle") .text($$.getArcTitle()); }; @@ -4531,7 +4531,7 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransform) { var $$ = this, d3 = $$.d3, config = $$.config, main = $$.main, mainArc; - mainArc = main.selectAll('.' + CLASS[arcs]).selectAll('.' + CLASS[arc]) + mainArc = main.selectAll('.' + CLASS[_arcs]).selectAll('.' + CLASS[_arc]) .data(generateCall($$.arcData, $$)); mainArc.enter().append('path') .attr("class", generateCall($$.classArc, $$)) @@ -4614,14 +4614,14 @@ mainArc.exit().transition().duration(durationForExit) .style('opacity', 0) .remove(); - main.selectAll('.' + CLASS[chartArc]).select('text') + main.selectAll('.' + CLASS[_chartArc]).select('text') .style("opacity", 0) - .attr('class', function (d) { return $$.isGaugeType(d.data) ? CLASS[gaugeValue] : ''; }) + .attr('class', function (d) { return $$.isGaugeType(d.data) ? CLASS[_gaugeValue] : ''; }) .text(generateCall($$.textForArcLabel, $$)) .attr("transform", generateCall($$.transformForArcLabel, $$)) .transition().duration(duration) .style("opacity", function (d) { return $$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? 1 : 0; }); - main.select('.' + CLASS[chartArcsTitle]) + main.select('.' + CLASS[_chartArcsTitle]) .style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0); }; @@ -4632,7 +4632,7 @@ var $$ = this, config = $$.config, arcs; if ($$.hasType('gauge')) { arcs.append('path') - .attr("class", CLASS[chartArcsBackground]) + .attr("class", CLASS[_chartArcsBackground]) .attr("d", function () { var d = { data: [{value: config[__gauge_max]}], @@ -4643,21 +4643,21 @@ }); arcs.append("text") .attr("dy", ".75em") - .attr("class", CLASS[chartArcsGaugeUnit]) + .attr("class", CLASS[_chartArcsGaugeUnit]) .style("text-anchor", "middle") .style("pointer-events", "none") .text(config[__gauge_label_show] ? config[__gauge_units] : ''); arcs.append("text") .attr("dx", -1 * ($$.innerRadius + (($$.radius - $$.innerRadius) / 2)) + "px") .attr("dy", "1.2em") - .attr("class", CLASS[chartArcsGaugeMin]) + .attr("class", CLASS[_chartArcsGaugeMin]) .style("text-anchor", "middle") .style("pointer-events", "none") .text(config[__gauge_label_show] ? config[__gauge_min] : ''); arcs.append("text") .attr("dx", $$.innerRadius + (($$.radius - $$.innerRadius) / 2) + "px") .attr("dy", "1.2em") - .attr("class", CLASS[chartArcsGaugeMax]) + .attr("class", CLASS[_chartArcsGaugeMax]) .style("text-anchor", "middle") .style("pointer-events", "none") .text(config[__gauge_label_show] ? config[__gauge_max] : ''); @@ -4691,7 +4691,7 @@ var $$ = this, d3 = $$.d3; $$.brush = d3.svg.brush().on("brush", function () { $$.redrawForBrush(); }); $$.brush.update = function () { - if ($$.context) { $$.context.select('.' + $$.CLASS[brush]).call(this); } + if ($$.context) { $$.context.select('.' + $$.CLASS[_brush]).call(this); } return this; }; $$.brush.scale = function (scale) { @@ -4709,20 +4709,20 @@ // Define g for chart area context.append('g') .attr("clip-path", $$.clipPath) - .attr('class', CLASS[chart]); + .attr('class', CLASS[_chart]); // Define g for bar chart area - context.select('.' + CLASS[chart]).append("g") - .attr("class", CLASS[chartBars]); + context.select('.' + CLASS[_chart]).append("g") + .attr("class", CLASS[_chartBars]); // Define g for line chart area - context.select('.' + CLASS[chart]).append("g") - .attr("class", CLASS[chartLines]); + context.select('.' + CLASS[_chart]).append("g") + .attr("class", CLASS[_chartLines]); // Add extent rect for Brush context.append("g") .attr("clip-path", $$.clipPath) - .attr("class", CLASS[brush]) + .attr("class", CLASS[_brush]) .call($$.brush) .selectAll("rect") .attr(config[__axis_rotated] ? "width" : "height", config[__axis_rotated] ? $$.width2 : $$.height2); @@ -4730,7 +4730,7 @@ // ATTENTION: This must be called AFTER chart added // Add Axis $$.axes.subx = context.append("g") - .attr("class", CLASS[axisX]) + .attr("class", CLASS[_axisX]) .attr("transform", $$.translate.subx) .attr("clip-path", config[__axis_rotated] ? "" : $$.clipPathForXAxis); }; @@ -4740,7 +4740,7 @@ if (config[__subchart_show]) { - contextBarUpdate = context.select('.' + CLASS[chartBars]).selectAll('.' + CLASS[chartBar]) + contextBarUpdate = context.select('.' + CLASS[_chartBars]).selectAll('.' + CLASS[_chartBar]) .data(targets) .attr('class', generateCall($$.classChartBar, $$)); contextBarEnter = contextBarUpdate.enter().append('g') @@ -4751,7 +4751,7 @@ .attr("class", generateCall($$.classBars, $$)); //-- Line --// - contextLineUpdate = context.select('.' + CLASS[chartLines]).selectAll('.' + CLASS[chartLine]) + contextLineUpdate = context.select('.' + CLASS[_chartLines]).selectAll('.' + CLASS[_chartLine]) .data(targets) .attr('class', generateCall($$.classChartLine, $$)); contextLineEnter = contextLineUpdate.enter().append('g') @@ -4792,7 +4792,7 @@ drawBarOnSub = $$.generateDrawBar(barIndices, true); drawLineOnSub = $$.generateDrawLine(lineIndices, true); // bars - contextBar = context.selectAll('.' + CLASS[bars]).selectAll('.' + CLASS[bar]) + contextBar = context.selectAll('.' + CLASS[_bars]).selectAll('.' + CLASS[_bar]) .data(generateCall($$.barData, $$)); contextBar.enter().append('path') .attr("class", generateCall($$.classBar, $$)) @@ -4807,7 +4807,7 @@ .style('opacity', 0) .remove(); // lines - contextLine = context.selectAll('.' + CLASS[lines]).selectAll('.' + CLASS[line]) + contextLine = context.selectAll('.' + CLASS[_lines]).selectAll('.' + CLASS[_line]) .data(generateCall($$.lineData, $$)); contextLine.enter().append('path') .attr('class', generateCall($$.classLine, $$)) @@ -4821,7 +4821,7 @@ .style('opacity', 0) .remove(); // area - contextArea = context.selectAll('.' + CLASS[areas]).selectAll('.' + CLASS[area]) + contextArea = context.selectAll('.' + CLASS[_areas]).selectAll('.' + CLASS[_area]) .data(generateCall($$.lineData, $$)); contextArea.enter().append('path') .attr("class", generateCall($$.classArea, $$)) @@ -4854,7 +4854,7 @@ if (transitions && transitions.axisSubX) { subXAxis = transitions.axisSubX; } else { - subXAxis = $$.context.select('.' + CLASS[axisX]); + subXAxis = $$.context.select('.' + CLASS[_axisX]); if (withTransition) { subXAxis = subXAxis.transition(); } } $$.context.attr("transform", $$.translate.context); @@ -4867,8 +4867,8 @@ */ c3_chart_internal_fn.updateZoom = function () { var $$ = this, z = $$.config[__zoom_enabled] ? $$.zoom : function () {}; - $$.main.select('.' + $$.CLASS[zoomRect]).call(z); - $$.main.selectAll('.' + $$.CLASS[eventRect]).call(z); + $$.main.select('.' + $$.CLASS[_zoomRect]).call(z); + $$.main.selectAll('.' + $$.CLASS[_eventRect]).call(z); }; @@ -4947,10 +4947,10 @@ var $$ = this, config = $$.config; config[__data_onselected](d, target.node()); // add selected-circle on low layer g - $$.main.select('.' + CLASS[selectedCircles] + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS[selectedCircle] + '-' + i) + $$.main.select('.' + CLASS[_selectedCircles] + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS[_selectedCircle] + '-' + i) .data([d]) .enter().append('circle') - .attr("class", function () { return $$.generateClass(CLASS[selectedCircle], i); }) + .attr("class", function () { return $$.generateClass(CLASS[_selectedCircle], i); }) .attr("cx", config[__axis_rotated] ? $$.circleY : $$.circleX) .attr("cy", config[__axis_rotated] ? $$.circleX : $$.circleY) .attr("stroke", function () { return $$.color(d); }) @@ -4962,7 +4962,7 @@ var $$ = this; $$.config[__data_onunselected](d, target.node()); // remove selected-circle from low layer g - $$.main.select('.' + CLASS[selectedCircles] + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS[selectedCircle] + '-' + i) + $$.main.select('.' + CLASS[_selectedCircles] + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS[_selectedCircle] + '-' + i) .transition().duration(100).attr('r', 0) .remove(); }; @@ -4990,17 +4990,17 @@ c3_chart_internal_fn.getToggle = function (that) { var $$ = this; // path selection not supported yet - return that.nodeName === 'circle' ? $$.togglePoint : ($$.d3.select(that).classed(CLASS[bar]) ? $$.toggleBar : $$.toggleArc); + return that.nodeName === 'circle' ? $$.togglePoint : ($$.d3.select(that).classed(CLASS[_bar]) ? $$.toggleBar : $$.toggleArc); }; c3_chart_internal_fn.toggleShape = function (that, d, i) { var $$ = this, d3 = $$.d3, config = $$.config, - shape = d3.select(that), isSelected = shape.classed(CLASS[SELECTED]), isWithin, toggle; + shape = d3.select(that), isSelected = shape.classed(CLASS[_SELECTED]), isWithin, toggle; if (that.nodeName === 'circle') { isWithin = $$.isWithinCircle(that, $$.pointSelectR(d) * 1.5); toggle = $$.togglePoint; } else if (that.nodeName === 'path') { - if (shape.classed(CLASS[bar])) { + if (shape.classed(CLASS[_bar])) { isWithin = $$.isWithinBar(that); toggle = $$.toggleBar; } else { // would be arc @@ -5011,12 +5011,12 @@ if (config[__data_selection_grouped] || isWithin) { if (config[__data_selection_enabled] && config[__data_selection_isselectable](d)) { if (!config[__data_selection_multiple]) { - $$.main.selectAll('.' + CLASS[shapes] + (config[__data_selection_grouped] ? $$.getTargetSelectorSuffix(d.id) : "")).selectAll('.' + CLASS[shape]).each(function (d, i) { + $$.main.selectAll('.' + CLASS[_shapes] + (config[__data_selection_grouped] ? $$.getTargetSelectorSuffix(d.id) : "")).selectAll('.' + CLASS[_shape]).each(function (d, i) { var shape = d3.select(this); - if (shape.classed(CLASS[SELECTED])) { toggle(false, shape.classed(CLASS[SELECTED], false), d, i); } + if (shape.classed(CLASS[_SELECTED])) { toggle(false, shape.classed(CLASS[_SELECTED], false), d, i); } }); } - shape.classed(CLASS[SELECTED], !isSelected); + shape.classed(CLASS[_SELECTED], !isSelected); toggle(!isSelected, shape, d, i); } $$.config[__data_onclick](d, that); @@ -5090,234 +5090,234 @@ /** * c3.class.js */ - var target = 'target', - chart = 'chart ', - chartLine = 'chartLine', - chartLines = 'chartLines', - chartBar = 'chartBar', - chartBars = 'chartBars', - chartText = 'chartText', - chartTexts = 'chartTexts', - chartArc = 'chartArc', - chartArcs = 'chartArcs', - chartArcsTitle = 'chartArcsTitle', - chartArcsBackground = 'chartArcsBackground', - chartArcsGaugeUnit = 'chartArcsGaugeUnit', - chartArcsGaugeMax = 'chartArcsGaugeMax', - chartArcsGaugeMin = 'chartArcsGaugeMin', - selectedCircle = 'selectedCircle', - selectedCircles = 'selectedCircles', - eventRect = 'eventRect', - eventRects = 'eventRects', - eventRectsSingle = 'eventRectsSingle', - eventRectsMultiple = 'eventRectsMultiple', - zoomRect = 'zoomRect', - brush = 'brush', - focused = 'focused', - region = 'region', - regions = 'regions', - tooltip = 'tooltip', - tooltipName = 'tooltipName', - shape = 'shape', - shapes = 'shapes', - line = 'line', - lines = 'lines', - bar = 'bar', - bars = 'bars', - circle = 'circle', - circles = 'circles', - arc = 'arc', - arcs = 'arcs', - area = 'area', - areas = 'areas', - empty = 'empty', - text = 'text', - texts = 'texts', - gaugeValue = 'gaugeValue', - grid = 'grid', - xgrid = 'xgrid', - xgrids = 'xgrids', - xgridLine = 'xgridLine', - xgridLines = 'xgridLines', - xgridFocus = 'xgridFocus', - ygrid = 'ygrid', - ygrids = 'ygrids', - ygridLine = 'ygridLine', - ygridLines = 'ygridLines', - axis = 'axis', - axisX = 'axisX', - axisXLabel = 'axisXLabel', - axisY = 'axisY', - axisYLabel = 'axisYLabel', - axisY2 = 'axisY2', - axisY2Label = 'axisY2Label', - legendBackground = 'legendBackground', - legendItem = 'legendItem', - legendItemEvent = 'legendItemEvent', - legendItemTile = 'legendItemTile', - legendItemHidden = 'legendItemHidden', - legendItemFocused = 'legendItemFocused', - dragarea = 'dragarea', - EXPANDED = 'EXPANDED', - SELECTED = 'SELECTED', - INCLUDED = 'INCLUDED'; + var _target = 'target', + _chart = 'chart ', + _chartLine = 'chartLine', + _chartLines = 'chartLines', + _chartBar = 'chartBar', + _chartBars = 'chartBars', + _chartText = 'chartText', + _chartTexts = 'chartTexts', + _chartArc = 'chartArc', + _chartArcs = 'chartArcs', + _chartArcsTitle = 'chartArcsTitle', + _chartArcsBackground = 'chartArcsBackground', + _chartArcsGaugeUnit = 'chartArcsGaugeUnit', + _chartArcsGaugeMax = 'chartArcsGaugeMax', + _chartArcsGaugeMin = 'chartArcsGaugeMin', + _selectedCircle = 'selectedCircle', + _selectedCircles = 'selectedCircles', + _eventRect = 'eventRect', + _eventRects = 'eventRects', + _eventRectsSingle = 'eventRectsSingle', + _eventRectsMultiple = 'eventRectsMultiple', + _zoomRect = 'zoomRect', + _brush = 'brush', + _focused = 'focused', + _region = 'region', + _regions = 'regions', + _tooltip = 'tooltip', + _tooltipName = 'tooltipName', + _shape = 'shape', + _shapes = 'shapes', + _line = 'line', + _lines = 'lines', + _bar = 'bar', + _bars = 'bars', + _circle = 'circle', + _circles = 'circles', + _arc = 'arc', + _arcs = 'arcs', + _area = 'area', + _areas = 'areas', + _empty = 'empty', + _text = 'text', + _texts = 'texts', + _gaugeValue = 'gaugeValue', + _grid = 'grid', + _xgrid = 'xgrid', + _xgrids = 'xgrids', + _xgridLine = 'xgridLine', + _xgridLines = 'xgridLines', + _xgridFocus = 'xgridFocus', + _ygrid = 'ygrid', + _ygrids = 'ygrids', + _ygridLine = 'ygridLine', + _ygridLines = 'ygridLines', + _axis = 'axis', + _axisX = 'axisX', + _axisXLabel = 'axisXLabel', + _axisY = 'axisY', + _axisYLabel = 'axisYLabel', + _axisY2 = 'axisY2', + _axisY2Label = 'axisY2Label', + _legendBackground = 'legendBackground', + _legendItem = 'legendItem', + _legendItemEvent = 'legendItemEvent', + _legendItemTile = 'legendItemTile', + _legendItemHidden = 'legendItemHidden', + _legendItemFocused = 'legendItemFocused', + _dragarea = 'dragarea', + _EXPANDED = 'EXPANDED', + _SELECTED = 'SELECTED', + _INCLUDED = 'INCLUDED'; var CLASS = c3_chart_internal_fn.CLASS = {}; - CLASS[target] = 'c3-target'; - CLASS[chart] = 'c3-chart'; - CLASS[chartLine] = 'c3-chart-line'; - CLASS[chartLines] = 'c3-chart-lines'; - CLASS[chartBar] = 'c3-chart-bar'; - CLASS[chartBars] = 'c3-chart-bars'; - CLASS[chartText] = 'c3-chart-text'; - CLASS[chartTexts] = 'c3-chart-texts'; - CLASS[chartArc] = 'c3-chart-arc'; - CLASS[chartArcs] = 'c3-chart-arcs'; - CLASS[chartArcsTitle] = 'c3-chart-arcs-title'; - CLASS[chartArcsBackground] = 'c3-chart-arcs-background'; - CLASS[chartArcsGaugeUnit] = 'c3-chart-arcs-gauge-unit'; - CLASS[chartArcsGaugeMax] = 'c3-chart-arcs-gauge-max'; - CLASS[chartArcsGaugeMin] = 'c3-chart-arcs-gauge-min'; - CLASS[selectedCircle] = 'c3-selected-circle'; - CLASS[selectedCircles] = 'c3-selected-circles'; - CLASS[eventRect] = 'c3-event-rect'; - CLASS[eventRects] = 'c3-event-rects'; - CLASS[eventRectsSingle] = 'c3-event-rects-single'; - CLASS[eventRectsMultiple] = 'c3-event-rects-multiple'; - CLASS[zoomRect] = 'c3-zoom-rect'; - CLASS[brush] = 'c3-brush'; - CLASS[focused] = 'c3-focused'; - CLASS[region] = 'c3-region'; - CLASS[regions] = 'c3-regions'; - CLASS[tooltip] = 'c3-tooltip'; - CLASS[tooltipName] = 'c3-tooltip-name'; - CLASS[shape] = 'c3-shape'; - CLASS[shapes] = 'c3-shapes'; - CLASS[line] = 'c3-line'; - CLASS[lines] = 'c3-lines'; - CLASS[bar] = 'c3-bar'; - CLASS[bars] = 'c3-bars'; - CLASS[circle] = 'c3-circle'; - CLASS[circles] = 'c3-circles'; - CLASS[arc] = 'c3-arc'; - CLASS[arcs] = 'c3-arcs'; - CLASS[area] = 'c3-area'; - CLASS[areas] = 'c3-areas'; - CLASS[empty] = 'c3-empty'; - CLASS[text] = 'c3-text'; - CLASS[texts] = 'c3-texts'; - CLASS[gaugeValue] = 'c3-gauge-value'; - CLASS[grid] = 'c3-grid'; - CLASS[xgrid] = 'c3-xgrid'; - CLASS[xgrids] = 'c3-xgrids'; - CLASS[xgridLine] = 'c3-xgrid-line'; - CLASS[xgridLines] = 'c3-xgrid-lines'; - CLASS[xgridFocus] = 'c3-xgrid-focus'; - CLASS[ygrid] = 'c3-ygrid'; - CLASS[ygrids] = 'c3-ygrids'; - CLASS[ygridLine] = 'c3-ygrid-line'; - CLASS[ygridLines] = 'c3-ygrid-lines'; - CLASS[axis] = 'c3-axis'; - CLASS[axisX] = 'c3-axis-x'; - CLASS[axisXLabel] = 'c3-axis-x-label'; - CLASS[axisY] = 'c3-axis-y'; - CLASS[axisYLabel] = 'c3-axis-y-label'; - CLASS[axisY2] = 'c3-axis-y2'; - CLASS[axisY2Label] = 'c3-axis-y2-label'; - CLASS[legendBackground] = 'c3-legend-background'; - CLASS[legendItem] = 'c3-legend-item'; - CLASS[legendItemEvent] = 'c3-legend-item-event'; - CLASS[legendItemTile] = 'c3-legend-item-tile'; - CLASS[legendItemHidden] = 'c3-legend-item-hidden'; - CLASS[legendItemFocused] = 'c3-legend-item-focused'; - CLASS[dragarea] = 'c3-dragarea'; - CLASS[EXPANDED] = '_expanded_'; - CLASS[SELECTED] = '_selected_'; - CLASS[INCLUDED] = '_included_'; + CLASS[_target] = 'c3-target'; + CLASS[_chart] = 'c3-chart'; + CLASS[_chartLine] = 'c3-chart-line'; + CLASS[_chartLines] = 'c3-chart-lines'; + CLASS[_chartBar] = 'c3-chart-bar'; + CLASS[_chartBars] = 'c3-chart-bars'; + CLASS[_chartText] = 'c3-chart-text'; + CLASS[_chartTexts] = 'c3-chart-texts'; + CLASS[_chartArc] = 'c3-chart-arc'; + CLASS[_chartArcs] = 'c3-chart-arcs'; + CLASS[_chartArcsTitle] = 'c3-chart-arcs-title'; + CLASS[_chartArcsBackground] = 'c3-chart-arcs-background'; + CLASS[_chartArcsGaugeUnit] = 'c3-chart-arcs-gauge-unit'; + CLASS[_chartArcsGaugeMax] = 'c3-chart-arcs-gauge-max'; + CLASS[_chartArcsGaugeMin] = 'c3-chart-arcs-gauge-min'; + CLASS[_selectedCircle] = 'c3-selected-circle'; + CLASS[_selectedCircles] = 'c3-selected-circles'; + CLASS[_eventRect] = 'c3-event-rect'; + CLASS[_eventRects] = 'c3-event-rects'; + CLASS[_eventRectsSingle] = 'c3-event-rects-single'; + CLASS[_eventRectsMultiple] = 'c3-event-rects-multiple'; + CLASS[_zoomRect] = 'c3-zoom-rect'; + CLASS[_brush] = 'c3-brush'; + CLASS[_focused] = 'c3-focused'; + CLASS[_region] = 'c3-region'; + CLASS[_regions] = 'c3-regions'; + CLASS[_tooltip] = 'c3-tooltip'; + CLASS[_tooltipName] = 'c3-tooltip-name'; + CLASS[_shape] = 'c3-shape'; + CLASS[_shapes] = 'c3-shapes'; + CLASS[_line] = 'c3-line'; + CLASS[_lines] = 'c3-lines'; + CLASS[_bar] = 'c3-bar'; + CLASS[_bars] = 'c3-bars'; + CLASS[_circle] = 'c3-circle'; + CLASS[_circles] = 'c3-circles'; + CLASS[_arc] = 'c3-arc'; + CLASS[_arcs] = 'c3-arcs'; + CLASS[_area] = 'c3-area'; + CLASS[_areas] = 'c3-areas'; + CLASS[_empty] = 'c3-empty'; + CLASS[_text] = 'c3-text'; + CLASS[_texts] = 'c3-texts'; + CLASS[_gaugeValue] = 'c3-gauge-value'; + CLASS[_grid] = 'c3-grid'; + CLASS[_xgrid] = 'c3-xgrid'; + CLASS[_xgrids] = 'c3-xgrids'; + CLASS[_xgridLine] = 'c3-xgrid-line'; + CLASS[_xgridLines] = 'c3-xgrid-lines'; + CLASS[_xgridFocus] = 'c3-xgrid-focus'; + CLASS[_ygrid] = 'c3-ygrid'; + CLASS[_ygrids] = 'c3-ygrids'; + CLASS[_ygridLine] = 'c3-ygrid-line'; + CLASS[_ygridLines] = 'c3-ygrid-lines'; + CLASS[_axis] = 'c3-axis'; + CLASS[_axisX] = 'c3-axis-x'; + CLASS[_axisXLabel] = 'c3-axis-x-label'; + CLASS[_axisY] = 'c3-axis-y'; + CLASS[_axisYLabel] = 'c3-axis-y-label'; + CLASS[_axisY2] = 'c3-axis-y2'; + CLASS[_axisY2Label] = 'c3-axis-y2-label'; + CLASS[_legendBackground] = 'c3-legend-background'; + CLASS[_legendItem] = 'c3-legend-item'; + CLASS[_legendItemEvent] = 'c3-legend-item-event'; + CLASS[_legendItemTile] = 'c3-legend-item-tile'; + CLASS[_legendItemHidden] = 'c3-legend-item-hidden'; + CLASS[_legendItemFocused] = 'c3-legend-item-focused'; + CLASS[_dragarea] = 'c3-dragarea'; + CLASS[_EXPANDED] = '_expanded_'; + CLASS[_SELECTED] = '_selected_'; + CLASS[_INCLUDED] = '_included_'; c3_chart_internal_fn.generateClass = function (prefix, targetId) { return " " + prefix + " " + prefix + this.getTargetSelectorSuffix(targetId); }; c3_chart_internal_fn.classText = function (d) { - return this.generateClass(CLASS[text], d.index); + return this.generateClass(CLASS[_text], d.index); }; c3_chart_internal_fn.classTexts = function (d) { - return this.generateClass(CLASS[texts], d.id); + return this.generateClass(CLASS[_texts], d.id); }; c3_chart_internal_fn.classShape = function (d) { - return this.generateClass(CLASS[shape], d.index); + return this.generateClass(CLASS[_shape], d.index); }; c3_chart_internal_fn.classShapes = function (d) { - return this.generateClass(CLASS[shapes], d.id); + return this.generateClass(CLASS[_shapes], d.id); }; c3_chart_internal_fn.classLine = function (d) { - return this.classShape(d) + this.generateClass(CLASS[line], d.id); + return this.classShape(d) + this.generateClass(CLASS[_line], d.id); }; c3_chart_internal_fn.classLines = function (d) { - return this.classShapes(d) + this.generateClass(CLASS[lines], d.id); + return this.classShapes(d) + this.generateClass(CLASS[_lines], d.id); }; c3_chart_internal_fn.classCircle = function (d) { - return this.classShape(d) + this.generateClass(CLASS[circle], d.index); + return this.classShape(d) + this.generateClass(CLASS[_circle], d.index); }; c3_chart_internal_fn.classCircles = function (d) { - return this.classShapes(d) + this.generateClass(CLASS[circles], d.id); + return this.classShapes(d) + this.generateClass(CLASS[_circles], d.id); }; c3_chart_internal_fn.classBar = function (d) { - return this.classShape(d) + this.generateClass(CLASS[bar], d.index); + return this.classShape(d) + this.generateClass(CLASS[_bar], d.index); }; c3_chart_internal_fn.classBars = function (d) { - return this.classShapes(d) + this.generateClass(CLASS[bars], d.id); + return this.classShapes(d) + this.generateClass(CLASS[_bars], d.id); }; c3_chart_internal_fn.classArc = function (d) { - return this.classShape(d.data) + this.generateClass(CLASS[arc], d.data.id); + return this.classShape(d.data) + this.generateClass(CLASS[_arc], d.data.id); }; c3_chart_internal_fn.classArcs = function (d) { - return this.classShapes(d.data) + this.generateClass(CLASS[arcs], d.data.id); + return this.classShapes(d.data) + this.generateClass(CLASS[_arcs], d.data.id); }; c3_chart_internal_fn.classArea = function (d) { - return this.classShape(d) + this.generateClass(CLASS[area], d.id); + return this.classShape(d) + this.generateClass(CLASS[_area], d.id); }; c3_chart_internal_fn.classAreas = function (d) { - return this.classShapes(d) + this.generateClass(CLASS[areas], d.id); + return this.classShapes(d) + this.generateClass(CLASS[_areas], d.id); }; c3_chart_internal_fn.classRegion = function (d, i) { - return this.generateClass(CLASS[region], i) + ' ' + ('class' in d ? d.class : ''); + return this.generateClass(CLASS[_region], i) + ' ' + ('class' in d ? d.class : ''); }; c3_chart_internal_fn.classEvent = function (d) { - return this.generateClass(CLASS[eventRect], d.index); + return this.generateClass(CLASS[_eventRect], d.index); }; c3_chart_internal_fn.classTarget = function (id) { var $$ = this; var additionalClassSuffix = $$.config[__data_classes][id], additionalClass = ''; if (additionalClassSuffix) { - additionalClass = ' ' + CLASS[target] + '-' + additionalClassSuffix; + additionalClass = ' ' + CLASS[_target] + '-' + additionalClassSuffix; } - return $$.generateClass(CLASS[target], id) + additionalClass; + return $$.generateClass(CLASS[_target], id) + additionalClass; }; c3_chart_internal_fn.classChartText = function (d) { - return CLASS[chartText] + this.classTarget(d.id); + return CLASS[_chartText] + this.classTarget(d.id); }; c3_chart_internal_fn.classChartLine = function (d) { - return CLASS[chartLine] + this.classTarget(d.id); + return CLASS[_chartLine] + this.classTarget(d.id); }; c3_chart_internal_fn.classChartBar = function (d) { - return CLASS[chartBar] + this.classTarget(d.id); + return CLASS[_chartBar] + this.classTarget(d.id); }; c3_chart_internal_fn.classChartArc = function (d) { - return CLASS[chartArc] + this.classTarget(d.data.id); + return CLASS[_chartArc] + this.classTarget(d.data.id); }; c3_chart_internal_fn.getTargetSelectorSuffix = function (targetId) { return targetId || targetId === 0 ? '-' + (targetId.replace ? targetId.replace(/([^a-zA-Z0-9-_])/g, '-') : targetId) : ''; }; c3_chart_internal_fn.selectorTarget = function (id) { - return '.' + CLASS[target] + this.getTargetSelectorSuffix(id); + return '.' + CLASS[_target] + this.getTargetSelectorSuffix(id); }; c3_chart_internal_fn.selectorTargets = function (ids) { var $$ = this; return ids.length ? ids.map(function (id) { return $$.selectorTarget(id); }) : null; }; c3_chart_internal_fn.selectorLegend = function (id) { - return '.' + CLASS[legendItem] + this.getTargetSelectorSuffix(id); + return '.' + CLASS[_legendItem] + this.getTargetSelectorSuffix(id); }; c3_chart_internal_fn.selectorLegends = function (ids) { var $$ = this; @@ -5391,26 +5391,26 @@ minY = (config[__data_selection_grouped]) ? $$.margin.top : Math.min(sy, my); maxY = (config[__data_selection_grouped]) ? $$.height : Math.max(sy, my); - main.select('.' + CLASS[dragarea]) + main.select('.' + CLASS[_dragarea]) .attr('x', minX) .attr('y', minY) .attr('width', maxX - minX) .attr('height', maxY - minY); // TODO: binary search when multiple xs - main.selectAll('.' + CLASS[shapes]).selectAll('.' + CLASS[shape]) + main.selectAll('.' + CLASS[_shapes]).selectAll('.' + CLASS[_shape]) .filter(function (d) { return config[__data_selection_isselectable](d); }) .each(function (d, i) { var shape = d3.select(this), - isSelected = shape.classed(CLASS[SELECTED]), - isIncluded = shape.classed(CLASS[INCLUDED]), + isSelected = shape.classed(CLASS[_SELECTED]), + isIncluded = shape.classed(CLASS[_INCLUDED]), _x, _y, _w, _h, toggle, isWithin = false, box; - if (shape.classed(CLASS[circle])) { + if (shape.classed(CLASS[_circle])) { _x = shape.attr("cx") * 1; _y = shape.attr("cy") * 1; toggle = $$.togglePoint; isWithin = minX < _x && _x < maxX && minY < _y && _y < maxY; } - else if (shape.classed(CLASS[bar])) { + else if (shape.classed(CLASS[_bar])) { box = getPathBox(this); _x = box.x; _y = box.y; @@ -5423,9 +5423,9 @@ return; } if (isWithin ^ isIncluded) { - shape.classed(CLASS[INCLUDED], !isIncluded); + shape.classed(CLASS[_INCLUDED], !isIncluded); // TODO: included/unincluded callback here - shape.classed(CLASS[SELECTED], !isSelected); + shape.classed(CLASS[_SELECTED], !isSelected); $$.toggle(!isSelected, shape, d, i); } }); @@ -5436,8 +5436,8 @@ if ($$.hasArcType()) { return; } if (! config[__data_selection_enabled]) { return; } // do nothing if not selectable $$.dragStart = mouse; - $$.main.select('.' + CLASS[chart]).append('rect') - .attr('class', CLASS[dragarea]) + $$.main.select('.' + CLASS[_chart]).append('rect') + .attr('class', CLASS[_dragarea]) .style('opacity', 0.1); $$.dragging = true; $$.config[__data_ondragstart](); @@ -5447,12 +5447,12 @@ var $$ = this, config = $$.config; if ($$.hasArcType()) { return; } if (! config[__data_selection_enabled]) { return; } // do nothing if not selectable - $$.main.select('.' + CLASS[dragarea]) + $$.main.select('.' + CLASS[_dragarea]) .transition().duration(100) .style('opacity', 0) .remove(); - $$.main.selectAll('.' + CLASS[shape]) - .classed(CLASS[INCLUDED], false); + $$.main.selectAll('.' + CLASS[_shape]) + .classed(CLASS[_INCLUDED], false); $$.dragging = false; $$.config[__data_ondragend](); }; @@ -5474,7 +5474,7 @@ } this.revert(); this.defocus(); - focus(candidatesForNoneArc.classed(CLASS[focused], true)); + focus(candidatesForNoneArc.classed(CLASS[_focused], true)); focus(candidatesForArc); if ($$.hasArcType()) { $$.expandArc(targetId, true); @@ -5491,7 +5491,7 @@ $$.filterTargetsToShow(targets).transition().duration(100).style('opacity', 0.3); } this.revert(); - defocus(candidatesForNoneArc.classed(CLASS[focused], false)); + defocus(candidatesForNoneArc.classed(CLASS[_focused], false)); defocus(candidatesForArc); if ($$.hasArcType()) { $$.unexpandArc(targetId); @@ -5507,7 +5507,7 @@ function revert(targets) { $$.filterTargetsToShow(targets).transition().duration(100).style('opacity', 1); } - revert(candidatesForNoneArc.classed(CLASS[focused], false)); + revert(candidatesForNoneArc.classed(CLASS[_focused], false)); revert(candidatesForArc); if ($$.hasArcType()) { $$.unexpandArc(targetId); @@ -5754,30 +5754,30 @@ c3_chart_fn.selected = function (targetId) { var $$ = this.internal, d3 = $$.d3; return d3.merge( - $$.main.selectAll('.' + CLASS[shapes] + $$.getTargetSelectorSuffix(targetId)).selectAll('.' + CLASS[shape]) - .filter(function () { return d3.select(this).classed(CLASS[SELECTED]); }) + $$.main.selectAll('.' + CLASS[_shapes] + $$.getTargetSelectorSuffix(targetId)).selectAll('.' + CLASS[_shape]) + .filter(function () { return d3.select(this).classed(CLASS[_SELECTED]); }) .map(function (d) { return d.map(function (d) { var data = d.__data__; return data.data ? data.data : data; }); }) ); }; c3_chart_fn.select = function (ids, indices, resetOther) { var $$ = this.internal, d3 = $$.d3, config = $$.config; if (! config[__data_selection_enabled]) { return; } - $$.main.selectAll('.' + CLASS[shapes]).selectAll('.' + CLASS[shape]).each(function (d, i) { + $$.main.selectAll('.' + CLASS[_shapes]).selectAll('.' + CLASS[_shape]).each(function (d, i) { var shape = d3.select(this), id = d.data ? d.data.id : d.id, toggle = $$.getToggle(this), isTargetId = config[__data_selection_grouped] || !ids || ids.indexOf(id) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0, - isSelected = shape.classed(CLASS[SELECTED]); + isSelected = shape.classed(CLASS[_SELECTED]); // line/area selection not supported yet - if (shape.classed(CLASS[line]) || shape.classed(CLASS[area])) { + if (shape.classed(CLASS[_line]) || shape.classed(CLASS[_area])) { return; } if (isTargetId && isTargetIndex) { if (config[__data_selection_isselectable](d) && !isSelected) { - toggle(true, shape.classed(CLASS[SELECTED], true), d, i); + toggle(true, shape.classed(CLASS[_SELECTED], true), d, i); } } else if (isDefined(resetOther) && resetOther) { if (isSelected) { - toggle(false, shape.classed(CLASS[SELECTED], false), d, i); + toggle(false, shape.classed(CLASS[_SELECTED], false), d, i); } } }); @@ -5785,19 +5785,19 @@ c3_chart_fn.unselect = function (ids, indices) { var $$ = this.internal, d3 = $$.d3, config = $$.config; if (! config[__data_selection_enabled]) { return; } - $$.main.selectAll('.' + CLASS[shapes]).selectAll('.' + CLASS[shape]).each(function (d, i) { + $$.main.selectAll('.' + CLASS[_shapes]).selectAll('.' + CLASS[_shape]).each(function (d, i) { var shape = d3.select(this), id = d.data ? d.data.id : d.id, toggle = $$.getToggle(this), isTargetId = config[__data_selection_grouped] || !ids || ids.indexOf(id) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0, - isSelected = shape.classed(CLASS[SELECTED]); + isSelected = shape.classed(CLASS[_SELECTED]); // line/area selection not supported yet - if (shape.classed(CLASS[line]) || shape.classed(CLASS[area])) { + if (shape.classed(CLASS[_line]) || shape.classed(CLASS[_area])) { return; } if (isTargetId && isTargetIndex) { if (config[__data_selection_isselectable](d)) { if (isSelected) { - toggle(false, shape.classed(CLASS[SELECTED], false), d, i); + toggle(false, shape.classed(CLASS[_SELECTED], false), d, i); } } } @@ -5870,9 +5870,9 @@ options = options || {}; duration = $$.getOption(options, "duration", config[__transition_duration]); - classes = $$.getOption(options, "classes", [CLASS[region]]); + classes = $$.getOption(options, "classes", [CLASS[_region]]); - regions = $$.main.select('.' + CLASS[regions]).selectAll(classes.map(function (c) { return '.' + c; })); + regions = $$.main.select('.' + CLASS[_regions]).selectAll(classes.map(function (c) { return '.' + c; })); (duration ? regions.transition().duration(duration) : regions) .style('opacity', 0) .remove();
" + title + "
" + name + "" + value + "