diff --git a/hiplot/fetchers_demo.py b/hiplot/fetchers_demo.py index fea200e7..1882a96e 100644 --- a/hiplot/fetchers_demo.py +++ b/hiplot/fetchers_demo.py @@ -152,6 +152,13 @@ def demo_distribution(**kwargs: Any) -> hip.Experiment: return xp +def demo_bool() -> hip.Experiment: + return hip.Experiment.from_iterable([ + {"bool": True}, + {"bool": False} + ]) + + README_DEMOS: Dict[str, Callable[[], hip.Experiment]] = { "demo": demo, "demo_big": lambda: demo(1000), @@ -163,4 +170,5 @@ def demo_distribution(**kwargs: Any) -> hip.Experiment: "demo_distribution_cat": lambda: demo_distribution(axis="cat"), "demo_distribution_num": lambda: demo_distribution(axis="numeric"), "demo_distribution_num_100bins": lambda: demo_distribution(axis="numeric", nbins=100), + "demo_bool": demo_bool, } diff --git a/src/infertypes.ts b/src/infertypes.ts index e86ca16f..bd9cf243 100644 --- a/src/infertypes.ts +++ b/src/infertypes.ts @@ -164,7 +164,9 @@ export function infertypes(url_states: PersistentState, table: Array, } else { setVals.push(v); } - if (typeof v != "number" && !is_special_num && isNaN(v)) { + // Detect non-numeric column + if ((typeof v != "number" && !is_special_num && isNaN(v)) || + v === true || v === false) { numeric = false; return; }