Commit cc571011 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Add data.selection.draggable and enable scrolling even if it's on the chart - #215 #798

parent 795219f7
...@@ -972,6 +972,7 @@ ...@@ -972,6 +972,7 @@
data_selection_grouped: false, data_selection_grouped: false,
data_selection_isselectable: function () { return true; }, data_selection_isselectable: function () { return true; },
data_selection_multiple: true, data_selection_multiple: true,
data_selection_draggable: false,
data_onclick: function () {}, data_onclick: function () {},
data_onmouseover: function () {}, data_onmouseover: function () {},
data_onmouseout: function () {}, data_onmouseout: function () {},
...@@ -2366,10 +2367,12 @@ ...@@ -2366,10 +2367,12 @@
}); });
}) })
.call( .call(
d3.behavior.drag().origin(Object) config.data_selection_draggable && $$.drag ? (
.on('drag', function () { $$.drag(d3.mouse(this)); }) d3.behavior.drag().origin(Object)
.on('dragstart', function () { $$.dragstart(d3.mouse(this)); }) .on('drag', function () { $$.drag(d3.mouse(this)); })
.on('dragend', function () { $$.dragend(); }) .on('dragstart', function () { $$.dragstart(d3.mouse(this)); })
.on('dragend', function () { $$.dragend(); })
) : function () {}
); );
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -44,6 +44,7 @@ c3_chart_internal_fn.getDefaultConfig = function () { ...@@ -44,6 +44,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
data_selection_grouped: false, data_selection_grouped: false,
data_selection_isselectable: function () { return true; }, data_selection_isselectable: function () { return true; },
data_selection_multiple: true, data_selection_multiple: true,
data_selection_draggable: false,
data_onclick: function () {}, data_onclick: function () {},
data_onmouseover: function () {}, data_onmouseover: function () {},
data_onmouseout: function () {}, data_onmouseout: function () {},
......
...@@ -231,10 +231,12 @@ c3_chart_internal_fn.generateEventRectsForSingleX = function (eventRectEnter) { ...@@ -231,10 +231,12 @@ c3_chart_internal_fn.generateEventRectsForSingleX = function (eventRectEnter) {
}); });
}) })
.call( .call(
d3.behavior.drag().origin(Object) config.data_selection_draggable && $$.drag ? (
.on('drag', function () { $$.drag(d3.mouse(this)); }) d3.behavior.drag().origin(Object)
.on('dragstart', function () { $$.dragstart(d3.mouse(this)); }) .on('drag', function () { $$.drag(d3.mouse(this)); })
.on('dragend', function () { $$.dragend(); }) .on('dragstart', function () { $$.dragstart(d3.mouse(this)); })
.on('dragend', function () { $$.dragend(); })
) : function () {}
); );
}; };
......
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