Skip to content

Commit

Permalink
fix #249
Browse files Browse the repository at this point in the history
  • Loading branch information
samussiah committed Dec 13, 2019
1 parent f7037ad commit 8ebb0ad
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 32 deletions.
22 changes: 8 additions & 14 deletions build/webcharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@
? d
: filter.val instanceof Array
? filter.val.indexOf(d[filter.col]) > -1
: d[filter.col] === filter.val;
: d[filter.col] + '' === filter.val + '';
});
});
} //Summarize data for each mark.
Expand Down Expand Up @@ -1116,7 +1116,7 @@
? d
: e.val instanceof Array
? e.val.indexOf(d[e.col]) > -1
: d[e.col] === e.val;
: d[e.col] + '' === e.val.toString() + '';
});
}); //get domain for all non-All values of first filter

Expand Down Expand Up @@ -1302,10 +1302,8 @@
return m[config.color_by];
})
)
.values()
.filter(function(f) {
return f && f !== 'undefined';
});
.values(); //.filter(f => f && f !== 'undefined');

if (config.legend.order)
colordom.sort(function(a, b) {
return d3.ascending(config.legend.order.indexOf(a), config.legend.order.indexOf(b));
Expand Down Expand Up @@ -3221,14 +3219,10 @@
? control.values
: d3
.set(
this.data
.map(function(m) {
return m[control.value_col];
})
.filter(function(f) {
return f;
})
)
this.data.map(function(m) {
return m[control.value_col];
})
) //.filter(f => f))
.values()
.sort(naturalSorter); // only sort when values are derived
//initial dropdown option
Expand Down
6 changes: 3 additions & 3 deletions build/webcharts.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/chart/draw/consolidateData.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function consolidateData(raw) {
? d
: filter.val instanceof Array
? filter.val.indexOf(d[filter.col]) > -1
: d[filter.col] === filter.val;
: d[filter.col] + '' === filter.val + '';
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/chart/draw/consolidateData/transformData.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function transformData(raw, mark) {
? d
: e.val instanceof Array
? e.val.indexOf(d[e.col]) > -1
: d[e.col] === e.val;
: d[e.col] + '' === e.val.toString() + '';
});
});
//get domain for all non-All values of first filter
Expand Down
5 changes: 2 additions & 3 deletions src/chart/draw/setColorScale.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ export default function setColorScale() {
const colordom =
Array.isArray(config.color_dom) && config.color_dom.length
? config.color_dom.slice()
: set(data.map(m => m[config.color_by]))
.values()
.filter(f => f && f !== 'undefined');
: set(data.map(m => m[config.color_by])).values();
//.filter(f => f && f !== 'undefined');

if (config.legend.order)
colordom.sort((a, b) =>
Expand Down
16 changes: 8 additions & 8 deletions src/controls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import destroy from './destroy';
import init from './init';
import layout from './layout';
import makeControlItem from './makeControlItem';
import makeBtnGroupControl from './makeBtnGroupControl';
import makeCheckboxControl from './makeCheckboxControl';
import makeDropdownControl from './makeDropdownControl';
import makeListControl from './makeListControl';
import makeNumberControl from './makeNumberControl';
import makeRadioControl from './makeRadioControl';
import makeSubsetterControl from './makeSubsetterControl';
import makeTextControl from './makeTextControl';
import makeBtnGroupControl from './makeControlItem/makeBtnGroupControl';
import makeCheckboxControl from './makeControlItem/makeCheckboxControl';
import makeDropdownControl from './makeControlItem/makeDropdownControl';
import makeListControl from './makeControlItem/makeListControl';
import makeNumberControl from './makeControlItem/makeNumberControl';
import makeRadioControl from './makeControlItem/makeRadioControl';
import makeSubsetterControl from './makeControlItem/makeSubsetterControl';
import makeTextControl from './makeControlItem/makeTextControl';
import stringAccessor from './stringAccessor';

export default {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import naturalSorter from '../dataOps/naturalSorter';
import naturalSorter from '../../dataOps/naturalSorter';
import { set, select } from 'd3';

export default function makeSubsetterControl(control, control_wrap) {
Expand All @@ -14,7 +14,7 @@ export default function makeSubsetterControl(control, control_wrap) {
//dropdown option data
const option_data = control.values
? control.values
: set(this.data.map(m => m[control.value_col]).filter(f => f))
: set(this.data.map(m => m[control.value_col])) //.filter(f => f))
.values()
.sort(naturalSorter); // only sort when values are derived

Expand Down
File renamed without changes.

0 comments on commit 8ebb0ad

Please sign in to comment.