Commit f028072c authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix conflict

parents 1e550608 708c9d59
...@@ -890,6 +890,8 @@ ...@@ -890,6 +890,8 @@
zoom_extent: undefined, zoom_extent: undefined,
zoom_privileged: false, zoom_privileged: false,
zoom_onzoom: function () {}, zoom_onzoom: function () {},
zoom_onzoomstart: function () {},
zoom_onzoomend: function () {},
interaction_enabled: true, interaction_enabled: true,
onmouseover: function () {}, onmouseover: function () {},
onmouseout: function () {}, onmouseout: function () {},
...@@ -5025,6 +5027,7 @@ ...@@ -5025,6 +5027,7 @@
$$.zoom = d3.behavior.zoom() $$.zoom = d3.behavior.zoom()
.on("zoomstart", function () { .on("zoomstart", function () {
$$.zoom.altDomain = d3.event.sourceEvent.altKey ? $$.x.orgDomain() : null; $$.zoom.altDomain = d3.event.sourceEvent.altKey ? $$.x.orgDomain() : null;
config.zoom_onzoomstart.call($$.api, d3.event.sourceEvent);
}) })
.on("zoom", function () { .on("zoom", function () {
// prevZoomTranslate is needed for the fix of unexpected zoom.translate after remaining zoom // prevZoomTranslate is needed for the fix of unexpected zoom.translate after remaining zoom
...@@ -5034,6 +5037,9 @@ ...@@ -5034,6 +5037,9 @@
$$.redrawForZoom.call($$); $$.redrawForZoom.call($$);
prevZoomTranslate = $$.zoom.translate(); prevZoomTranslate = $$.zoom.translate();
wheeled = d3.event.sourceEvent.type === 'wheel'; wheeled = d3.event.sourceEvent.type === 'wheel';
})
.on('zoomend', function () {
config.zoom_onzoomend.call($$.api, $$.x.orgDomain());
}); });
$$.zoom.scale = function (scale) { $$.zoom.scale = function (scale) {
return config.axis_rotated ? this.y(scale) : this.x(scale); return config.axis_rotated ? this.y(scale) : this.x(scale);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -11,6 +11,8 @@ c3_chart_internal_fn.getDefaultConfig = function () { ...@@ -11,6 +11,8 @@ c3_chart_internal_fn.getDefaultConfig = function () {
zoom_extent: undefined, zoom_extent: undefined,
zoom_privileged: false, zoom_privileged: false,
zoom_onzoom: function () {}, zoom_onzoom: function () {},
zoom_onzoomstart: function () {},
zoom_onzoomend: function () {},
interaction_enabled: true, interaction_enabled: true,
onmouseover: function () {}, onmouseover: function () {},
onmouseout: function () {}, onmouseout: function () {},
......
...@@ -4,6 +4,7 @@ c3_chart_internal_fn.initZoom = function () { ...@@ -4,6 +4,7 @@ c3_chart_internal_fn.initZoom = function () {
$$.zoom = d3.behavior.zoom() $$.zoom = d3.behavior.zoom()
.on("zoomstart", function () { .on("zoomstart", function () {
$$.zoom.altDomain = d3.event.sourceEvent.altKey ? $$.x.orgDomain() : null; $$.zoom.altDomain = d3.event.sourceEvent.altKey ? $$.x.orgDomain() : null;
config.zoom_onzoomstart.call($$.api, d3.event.sourceEvent);
}) })
.on("zoom", function () { .on("zoom", function () {
// prevZoomTranslate is needed for the fix of unexpected zoom.translate after remaining zoom // prevZoomTranslate is needed for the fix of unexpected zoom.translate after remaining zoom
...@@ -13,6 +14,9 @@ c3_chart_internal_fn.initZoom = function () { ...@@ -13,6 +14,9 @@ c3_chart_internal_fn.initZoom = function () {
$$.redrawForZoom.call($$); $$.redrawForZoom.call($$);
prevZoomTranslate = $$.zoom.translate(); prevZoomTranslate = $$.zoom.translate();
wheeled = d3.event.sourceEvent.type === 'wheel'; wheeled = d3.event.sourceEvent.type === 'wheel';
})
.on('zoomend', function () {
config.zoom_onzoomend.call($$.api, $$.x.orgDomain());
}); });
$$.zoom.scale = function (scale) { $$.zoom.scale = function (scale) {
return config.axis_rotated ? this.y(scale) : this.x(scale); return config.axis_rotated ? this.y(scale) : this.x(scale);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment