Commit c50f5191 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix toggle on select

parent 8a2e44a8
...@@ -5632,7 +5632,8 @@ ...@@ -5632,7 +5632,8 @@
var $$ = this.internal, d3 = $$.d3, config = $$.config; var $$ = this.internal, d3 = $$.d3, config = $$.config;
if (! config.data_selection_enabled) { return; } if (! config.data_selection_enabled) { return; }
$$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) { $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
var shape = d3.select(this), id = d.data ? d.data.id : d.id, toggle = $$.getToggle(this), var shape = d3.select(this), id = d.data ? d.data.id : d.id,
toggle = $$.getToggle(this).bind($$),
isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0, isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
isTargetIndex = !indices || indices.indexOf(i) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0,
isSelected = shape.classed(CLASS.SELECTED); isSelected = shape.classed(CLASS.SELECTED);
...@@ -5655,7 +5656,8 @@ ...@@ -5655,7 +5656,8 @@
var $$ = this.internal, d3 = $$.d3, config = $$.config; var $$ = this.internal, d3 = $$.d3, config = $$.config;
if (! config.data_selection_enabled) { return; } if (! config.data_selection_enabled) { return; }
$$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) { $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
var shape = d3.select(this), id = d.data ? d.data.id : d.id, toggle = $$.getToggle(this), var shape = d3.select(this), id = d.data ? d.data.id : d.id,
toggle = $$.getToggle(this).bind($$),
isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0, isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
isTargetIndex = !indices || indices.indexOf(i) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0,
isSelected = shape.classed(CLASS.SELECTED); isSelected = shape.classed(CLASS.SELECTED);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -10,7 +10,8 @@ c3_chart_fn.select = function (ids, indices, resetOther) { ...@@ -10,7 +10,8 @@ c3_chart_fn.select = function (ids, indices, resetOther) {
var $$ = this.internal, d3 = $$.d3, config = $$.config; var $$ = this.internal, d3 = $$.d3, config = $$.config;
if (! config.data_selection_enabled) { return; } if (! config.data_selection_enabled) { return; }
$$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) { $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
var shape = d3.select(this), id = d.data ? d.data.id : d.id, toggle = $$.getToggle(this), var shape = d3.select(this), id = d.data ? d.data.id : d.id,
toggle = $$.getToggle(this).bind($$),
isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0, isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
isTargetIndex = !indices || indices.indexOf(i) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0,
isSelected = shape.classed(CLASS.SELECTED); isSelected = shape.classed(CLASS.SELECTED);
...@@ -33,7 +34,8 @@ c3_chart_fn.unselect = function (ids, indices) { ...@@ -33,7 +34,8 @@ c3_chart_fn.unselect = function (ids, indices) {
var $$ = this.internal, d3 = $$.d3, config = $$.config; var $$ = this.internal, d3 = $$.d3, config = $$.config;
if (! config.data_selection_enabled) { return; } if (! config.data_selection_enabled) { return; }
$$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) { $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
var shape = d3.select(this), id = d.data ? d.data.id : d.id, toggle = $$.getToggle(this), var shape = d3.select(this), id = d.data ? d.data.id : d.id,
toggle = $$.getToggle(this).bind($$),
isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0, isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
isTargetIndex = !indices || indices.indexOf(i) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0,
isSelected = shape.classed(CLASS.SELECTED); isSelected = shape.classed(CLASS.SELECTED);
......
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