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

4
htdocs/samples/custom_x_scale.html

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

4
htdocs/samples/custom_xs_scale.html

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

4
htdocs/samples/simple.html

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

Loading…
Cancel
Save