import React from "react"; import _ from "lodash"; import { connect } from "react-redux"; import * as globals from "../../globals"; import styles from "./categorical.css"; import SectionHeader from "../framework/sectionHeader" import createCategoryCounts from "./createCategoryCounts"; import { alphabeticallySortedValues } from "./util"; class Button extends React.Component { render () { return ( ) } } const Category = ({category, values, handleClick}) => (

{category}:

{ _.map(alphabeticallySortedValues(values), (v, i) => { return (
) @connect((state) => { let ranges = null; if ( state.cells.cells && state.cells.cells.data.ranges ) { ranges = state.cells.cells.data.ranges; } return { ranges: ranges } }) class Categories extends React.Component { constructor(props) { super(props); this.state = { }; } handleClick(category, value) { return () => { this.props.dispatch({type: "category changed", data: {category, value}}) } } render () { if (!this.props.ranges) return null return (
{ _.map(this.props.ranges, (value, key) => { if ( value.options && key !== "CellName" ) { return ( ) } else { return null } }) }
) } }; export default Categories; /* [on off] toggle hide deselected filters (shows a menu vs shows what you ordered in compact/narrative form. fold out animation.)

Sort by: Alphabetical / Count || Show counts: true / false || Collapse: all / none

*/ /* Each category has a color associated with it - ie., color by location should show up on these buttons, Does colorby live here? Like a global, with the category labels at the top? If not, we have to duplicate the category names somewhere else - but then, not all (like Cluster_2d_color) won't be listed here. */