mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-08 04:18:13 +08:00
better positioning of continuous paintbrushes
This commit is contained in:
@@ -9,6 +9,7 @@ import _ from "lodash";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import FaPaintBrush from "react-icons/lib/fa/paint-brush";
|
import FaPaintBrush from "react-icons/lib/fa/paint-brush";
|
||||||
import * as globals from "../../globals";
|
import * as globals from "../../globals";
|
||||||
|
import * as d3 from "d3";
|
||||||
|
|
||||||
@connect(state => {
|
@connect(state => {
|
||||||
const initializeRanges = _.get(state, "initialize.data.data.ranges", null);
|
const initializeRanges = _.get(state, "initialize.data.data.ranges", null);
|
||||||
@@ -155,9 +156,23 @@ class HistogramBrush extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{ marginTop: 10, position: "relative" }}
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
position: "flex"
|
||||||
|
}}
|
||||||
id={"histogram_" + this.props.metadataField}
|
id={"histogram_" + this.props.metadataField}
|
||||||
>
|
>
|
||||||
|
<svg
|
||||||
|
width={this.width}
|
||||||
|
height={this.height}
|
||||||
|
ref={svgRef => {
|
||||||
|
this.drawHistogram(svgRef);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{this.props.ranges.min}
|
||||||
|
{" to "}
|
||||||
|
{this.props.ranges.max}
|
||||||
|
</svg>
|
||||||
<span
|
<span
|
||||||
onClick={this.handleColorAction.bind(this)}
|
onClick={this.handleColorAction.bind(this)}
|
||||||
style={{
|
style={{
|
||||||
@@ -170,26 +185,15 @@ class HistogramBrush extends React.Component {
|
|||||||
? globals.brightBlue
|
? globals.brightBlue
|
||||||
: "black",
|
: "black",
|
||||||
// backgroundColor: this.props.colorAccessor === this.props.metadataField ? globals.brightBlue : "inherit",
|
// backgroundColor: this.props.colorAccessor === this.props.metadataField ? globals.brightBlue : "inherit",
|
||||||
display: "inline-block",
|
// display: "inline-block",
|
||||||
position: "relative",
|
position: "relative",
|
||||||
left: this.width,
|
// left: this.width + 15,
|
||||||
top: this.height - 22,
|
top: -29,
|
||||||
cursor: "pointer"
|
cursor: "pointer"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FaPaintBrush />
|
<FaPaintBrush />
|
||||||
</span>
|
</span>
|
||||||
<svg
|
|
||||||
width={this.width}
|
|
||||||
height={this.height}
|
|
||||||
ref={svgRef => {
|
|
||||||
this.drawHistogram(svgRef);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{this.props.ranges.min}
|
|
||||||
{" to "}
|
|
||||||
{this.props.ranges.max}
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user