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 Value from "./value"; import { alphabeticallySortedValues } from "./util"; @connect((state) => { return { colorAccessor: state.controls.colorAccessor } }) class Category extends React.Component { constructor(props) { super(props); this.state = { isChecked: true }; } handleColorChange() { this.props.dispatch({ type: "color by categorical metadata", colorAccessor: this.props.metadataField }) } toggleAll() { this.props.dispatch({ type: "categorical metadata filter all of these", metadataField: this.props.metadataField }) this.setState({isChecked: true}) } toggleNone() { this.props.dispatch({ type: "categorical metadata filter none of these", metadataField: this.props.metadataField, value: this.props.value }) this.setState({isChecked: false}) } render() { return (
{this.props.metadataField} 🖌️
Sort by: Alphabetical / Count || Show counts: true / false || Collapse: all / none
might be interesting to show them as an 👁 icon, or with a slash through it, to allow for visible or hidden state */ /* 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. */