Browse Source

Rename onenter/onleave to onmouseover/onmouseout

pull/319/head
Masayuki Tanaka 11 years ago
parent
commit
d3c0068174
  1. 20
      c3.js
  2. 2
      c3.min.js
  3. 4
      htdocs/samples/chart_bar.html
  4. 4
      htdocs/samples/custom_x_scale.html
  5. 4
      htdocs/samples/custom_xs_scale.html
  6. 4
      htdocs/samples/simple.html

20
c3.js

@ -129,8 +129,8 @@
var __interaction_enabled = getConfig(['interaction', 'enabled'], true); var __interaction_enabled = getConfig(['interaction', 'enabled'], true);
var __onenter = getConfig(['onenter'], function () {}), var __onmouseover = getConfig(['onmouseover'], function () {}),
__onleave = getConfig(['onleave'], function () {}), __onmouseout = getConfig(['onmouseout'], function () {}),
__onresize = getConfig(['onresize'], function () {}), __onresize = getConfig(['onresize'], function () {}),
__onresized = getConfig(['onresized'], function () {}); __onresized = getConfig(['onresized'], function () {});
@ -161,8 +161,8 @@
__data_selection_isselectable = getConfig(['data', 'selection', 'isselectable'], function () { return true; }), __data_selection_isselectable = getConfig(['data', 'selection', 'isselectable'], function () { return true; }),
__data_selection_multiple = getConfig(['data', 'selection', 'multiple'], true), __data_selection_multiple = getConfig(['data', 'selection', 'multiple'], true),
__data_onclick = getConfig(['data', 'onclick'], function () {}), __data_onclick = getConfig(['data', 'onclick'], function () {}),
__data_onenter = getConfig(['data', 'onenter'], function () {}), __data_onmouseover = getConfig(['data', 'onmouseover'], function () {}),
__data_onleave = getConfig(['data', 'onleave'], function () {}), __data_onmouseout = getConfig(['data', 'onmouseout'], function () {}),
__data_onselected = getConfig(['data', 'onselected'], function () {}), __data_onselected = getConfig(['data', 'onselected'], function () {}),
__data_onunselected = getConfig(['data', 'onunselected'], function () {}), __data_onunselected = getConfig(['data', 'onunselected'], function () {}),
__data_ondragstart = getConfig(['data', 'ondragstart'], function () {}), __data_ondragstart = getConfig(['data', 'ondragstart'], function () {}),
@ -2863,8 +2863,8 @@
// Define svgs // Define svgs
svg = selectChart.append("svg") svg = selectChart.append("svg")
.style("overflow", "hidden") .style("overflow", "hidden")
.on('mouseenter', __onenter) .on('mouseenter', __onmouseover)
.on('mouseleave', __onleave); .on('mouseleave', __onmouseout);
// Define defs // Define defs
defs = svg.append("defs"); defs = svg.append("defs");
@ -3147,7 +3147,7 @@
// Call event handler // Call event handler
main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) { main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
__data_onenter(d); __data_onmouseover(d);
}); });
}) })
.on('mouseout', function (d) { .on('mouseout', function (d) {
@ -3160,7 +3160,7 @@
unexpandBars(); unexpandBars();
// Call event handler // Call event handler
main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) { main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
__data_onleave(d); __data_onmouseout(d);
}); });
}) })
.on('mousemove', function (d) { .on('mousemove', function (d) {
@ -3286,12 +3286,12 @@
if (dist(closest, mouse) < 100) { if (dist(closest, mouse) < 100) {
svg.select('.' + CLASS.eventRect).style('cursor', 'pointer'); svg.select('.' + CLASS.eventRect).style('cursor', 'pointer');
if (!mouseover) { if (!mouseover) {
__data_onenter(closest); __data_onmouseover(closest);
mouseover = true; mouseover = true;
} }
} else { } else {
svg.select('.' + CLASS.eventRect).style('cursor', null); svg.select('.' + CLASS.eventRect).style('cursor', null);
__data_onleave(closest); __data_onmouseout(closest);
mouseover = false; mouseover = false;
} }
}) })

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
htdocs/samples/chart_bar.html

@ -16,8 +16,8 @@
], ],
type: 'bar', type: 'bar',
onclick: function (d, element) { console.log("onclick", d, element); }, onclick: function (d, element) { console.log("onclick", d, element); },
onenter: function (d) { console.log("onenter", d); }, onmouseover: function (d) { console.log("onmouseover", d); },
onleave: function (d) { console.log("onleave", d); } onmouseout: function (d) { console.log("onmouseout", d); }
}, },
axis: { axis: {
x: { x: {

4
htdocs/samples/custom_x_scale.html

@ -20,8 +20,8 @@
selection: { selection: {
enabled: true enabled: true
}, },
onenter: function (d) { console.log("onenter", d); }, onmouseover: function (d) { console.log("onmouseover", d); },
onleave: function (d) { console.log("onleave", d); } onmouseout: function (d) { console.log("onmouseout", d); }
}, },
}); });

4
htdocs/samples/custom_xs_scale.html

@ -24,8 +24,8 @@
selection: { selection: {
enabled: true enabled: true
}, },
onenter: function (d) { console.log("onenter", d); }, onmouseover: function (d) { console.log("onmouseover", d); },
onleave: function (d) { console.log("onleave", d); } onmouseout: function (d) { console.log("onmouseout", d); }
} }
}); });

4
htdocs/samples/simple.html

@ -15,8 +15,8 @@
['data2', 50, 20, 10, 40, 15, 25] ['data2', 50, 20, 10, 40, 15, 25]
], ],
onclick: function (d, element) { console.log("onclick", d, element); }, onclick: function (d, element) { console.log("onclick", d, element); },
onenter: function (d) { console.log("onenter", d); }, onmouseover: function (d) { console.log("onmouseover", d); },
onleave: function (d) { console.log("onleave", d); }, onmouseout: function (d) { console.log("onmouseout", d); },
} }
}); });
</script> </script>

Loading…
Cancel
Save