diff --git a/src/components/categorical/categorical.js b/src/components/categorical/categorical.js index 05c6d476..bb7d930d 100644 --- a/src/components/categorical/categorical.js +++ b/src/components/categorical/categorical.js @@ -36,20 +36,37 @@ class Category extends React.Component { }}>

- {this.props.metadataField}: + {this.props.metadataField} + + 🎨 +

- + + {"all"} + +
{ @@ -91,12 +108,10 @@ class Categories extends React.Component { return (
- { _.map(this.props.ranges, (value, key) => { const isColorField = key.includes("color") || key.includes("Color"); diff --git a/src/components/categorical/value.js b/src/components/categorical/value.js index f8703245..8214fece 100644 --- a/src/components/categorical/value.js +++ b/src/components/categorical/value.js @@ -75,7 +75,7 @@ class CategoryValue extends React.Component { fontStyle: "italic", cursor: "pointer", }}> - {" only"} + {"only"}
) diff --git a/src/components/continuous/continuous.js b/src/components/continuous/continuous.js index d47fcab0..1f431750 100644 --- a/src/components/continuous/continuous.js +++ b/src/components/continuous/continuous.js @@ -8,7 +8,6 @@ import SectionHeader from "../framework/sectionHeader"; import setupParallelCoordinates from "./setupParallelCoordinates"; import drawAxes from "./drawAxes"; import drawLinesCanvas from "./drawLinesCanvas"; -import ColorControl from "../controls/color"; import { margin, @@ -80,6 +79,7 @@ class Continuous extends React.Component { height, width, this.handleBrushAction.bind(this), + this.handleColorAction.bind(this), ); this.setState({ @@ -128,6 +128,13 @@ class Continuous extends React.Component { data: selection }) } + handleColorAction (key) { + this.props.dispatch({ + type: "color by continuous metadata", + colorAccessor: key, + rangeMaxForColorAccessor: this.props.initializeRanges[key].range.max + }); + } render() { @@ -140,7 +147,6 @@ class Continuous extends React.Component { width: width + margin.left + margin.right + "px", height: height + margin.top + margin.bottom + "px" }}>
- ) } diff --git a/src/components/continuous/drawAxes.js b/src/components/continuous/drawAxes.js index 64be2781..8003b8f5 100644 --- a/src/components/continuous/drawAxes.js +++ b/src/components/continuous/drawAxes.js @@ -14,6 +14,7 @@ const drawAxes = ( height, width, handleBrushAction, + handleColorAction, ) => { /***************************************** @@ -52,9 +53,10 @@ const drawAxes = ( d3.select(this).call(renderAxis); }) .append("text") + .on("click", (d) => { handleColorAction(d.key) }) .attr("class", styles.title) .attr("text-anchor", "start") - .text(function(d) { return "description" in d ? d.description : d.key; }); + .text(function(d) { return "description" in d ? d.description + " 🎨" : d.key + " 🎨"; }); // Add and store a brush for each axis. axes.append("g") diff --git a/src/components/continuous/parallelCoordinates.css b/src/components/continuous/parallelCoordinates.css index 565e6755..8e3a4fa0 100644 --- a/src/components/continuous/parallelCoordinates.css +++ b/src/components/continuous/parallelCoordinates.css @@ -26,8 +26,12 @@ body { font-size: 10px; transform: rotate(-21deg) translate(-5px,-6px); fill: #222; + cursor: pointer; } +/* -webkit-filter: grayscale(100%); + filter: grayscale(100%); */ + .axis line, .axis path { fill: none; diff --git a/src/components/controls/color.js b/src/components/controls/color.js deleted file mode 100644 index 2c2dbade..00000000 --- a/src/components/controls/color.js +++ /dev/null @@ -1,78 +0,0 @@ -import React from 'react'; -import _ from "lodash"; -import styles from "./controls.css"; -// import SectionHeader from "../framework/sectionHeader"; -import { connect } from "react-redux"; - -const Option = ({name, selected, handleClick}) => { - return ( - - ) -} - -@connect((state) => { - const ranges = state.cells.cells && state.cells.cells.data.ranges ? state.cells.cells.data.ranges : null; - const initializeRanges = state.initialize.data && state.initialize.data.data.ranges ? state.initialize.data.data.ranges : null; - return { - ranges, - initializeRanges, - colorAccessor: state.controls.colorAccessor, - } -}) -class ColorOptions extends React.Component { - - constructor(props) { - super(props); - this.state = { - - }; - } - - handleClick (name) { - return () => { - this.props.dispatch({ - type: "color by continuous metadata", - colorAccessor: name, - rangeMaxForColorAccessor: this.props.initializeRanges[name].range.max - }); - } - } - - render() { - if (!this.props.ranges || !this.props.initializeRanges) { return null } - return ( -
- Color: - { - _.map(this.props.ranges, (value, key) => { - if ( /* value.options */ - value.range && - key !== "CellName" - ) { - return
- ) - } -}; - -export default ColorOptions; - -// diff --git a/src/components/controls/controls.css b/src/components/controls/controls.css deleted file mode 100644 index e69de29b..00000000