diff --git a/spec/tooltip-spec.js b/spec/tooltip-spec.js index 1d3ccde..68d314c 100644 --- a/spec/tooltip-spec.js +++ b/spec/tooltip-spec.js @@ -163,12 +163,7 @@ describe('c3 chart tooltip', function () { dataGroups = [ [ 'data1', 'data2', 'data3' ]]; }); -<<<<<<< HEAD - it('should display each tooltip value descending order', function() { - window.setMouseEvent(chart, 'mousemove', 100, 100, d3.select('.c3-event-rect-2').node()); - var classes = d3.selectAll('.c3-tooltip tr')[0].map(function(node) { -======= it('should display each data in ascending order', function() { var eventRect = d3.select('.c3-event-rect').node(), x = chart.internal.x(2), @@ -176,16 +171,10 @@ describe('c3 chart tooltip', function () { window.setMouseEvent(chart, 'mousemove', x, y, eventRect); var classes = d3.selectAll('.c3-tooltip tr').nodes().map(function(node) { ->>>>>>> c45b30fe3190872f6760875840587bd2a2d9371b return node.className; }); expect(classes[0]).toBe(''); // header -<<<<<<< HEAD - expect(classes[1]).toBe('c3-tooltip-name--data3'); // 110 - expect(classes[2]).toBe('c3-tooltip-name--data1'); // 100 - expect(classes[3]).toBe('c3-tooltip-name--data2'); // 10 -======= expect(classes[1]).toBe('c3-tooltip-name--data2'); // 160 expect(classes[2]).toBe('c3-tooltip-name--data3'); // 760 expect(classes[3]).toBe('c3-tooltip-name--data1'); // 1130 @@ -267,7 +256,6 @@ describe('c3 chart tooltip', function () { describe('tooltip with data_order as desc with un-grouped data', function() { beforeAll(function() { dataOrder = 'desc'; ->>>>>>> c45b30fe3190872f6760875840587bd2a2d9371b }); }); @@ -277,17 +265,6 @@ describe('c3 chart tooltip', function () { order: 'asc' }; -<<<<<<< HEAD - // this should be ignored - dataOrder = 'desc'; - dataGroups = [ [ 'data1', 'data2', 'data3' ]]; - }); - - it('should display each tooltip value in ascending order', function() { - window.setMouseEvent(chart, 'mousemove', 100, 100, d3.select('.c3-event-rect-2').node()); - - var classes = d3.selectAll('.c3-tooltip tr')[0].map(function(node) { -======= it('should display each tooltip value descending order', function() { var eventRect = d3.select('.c3-event-rect').node(), x = chart.internal.x(2), @@ -339,7 +316,6 @@ describe('c3 chart tooltip', function () { window.setMouseEvent(chart, 'mousemove', x, y, eventRect); var classes = d3.selectAll('.c3-tooltip tr').nodes().map(function(node) { ->>>>>>> c45b30fe3190872f6760875840587bd2a2d9371b return node.className; }); diff --git a/src/tooltip.js b/src/tooltip.js index 4ccaaa1..3e8108c 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -69,11 +69,7 @@ c3_chart_internal_fn.getTooltipSortFunction = function() { } : null, b ? { id: b.id, values: [ b ] -<<<<<<< HEAD - } : null) -======= } : null); ->>>>>>> c45b30fe3190872f6760875840587bd2a2d9371b }; } @@ -82,11 +78,7 @@ c3_chart_internal_fn.getTooltipSortFunction = function() { } else if (isArray(order)) { return function(a, b) { return order.indexOf(a.id) - order.indexOf(b.id); -<<<<<<< HEAD - } -======= }; ->>>>>>> c45b30fe3190872f6760875840587bd2a2d9371b } } else { // if data are grouped, we follow the order of grouped targets @@ -102,11 +94,7 @@ c3_chart_internal_fn.getTooltipSortFunction = function() { return function(a, b) { return ids.indexOf(a.id) - ids.indexOf(b.id); -<<<<<<< HEAD - } -======= }; ->>>>>>> c45b30fe3190872f6760875840587bd2a2d9371b } }; c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaultValueFormat, color) { @@ -117,11 +105,7 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul text, i, title, value, name, bgcolor; var tooltipSortFunction = this.getTooltipSortFunction(); -<<<<<<< HEAD - if (tooltipSortFunction) { -======= if(tooltipSortFunction) { ->>>>>>> c45b30fe3190872f6760875840587bd2a2d9371b d.sort(tooltipSortFunction); }