diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-08-04 11:25:36 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-08-04 11:25:36 -0400 |
commit | f073fd90481d58f2eaccc1d546899dd157aff905 (patch) | |
tree | 4fd83b4159aba9057b3f54a825b72bb3deee7d02 /src/client/views/nodes/DataVizBox/components/Histogram.tsx | |
parent | acbfb6e690b98388d1f7d9a8544c89b2740adea4 (diff) |
selected rows + colored bars + colored slices updating with getAnchor / restoreView
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index b574a0062..02f1ddbbb 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -394,21 +394,11 @@ export class Histogram extends React.Component<HistogramProps> { @action changeSelectedColor = (color: string) => { this.curBarSelected.attr("fill", color); var barName = StrCast(this._currSelected[this.props.axes[0]].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')) - // this.props.layoutDoc['histogramBarColors-'+barName] = color; const barColors = Cast(this.props.layoutDoc.histogramBarColors, listSpec("string"), null); - barColors.map(each => { if (each.split('::')[0] == barName) barColors.splice(barColors.indexOf(each)) }); + barColors.map(each => { if (each.split('::')[0] == barName) barColors.splice(barColors.indexOf(each), 1) }); barColors.push(StrCast(barName + '::' + color)); }; - - @action changeDefaultColor = (color: string) => { - const defaultColorBars = this._histogramSvg!.selectAll('.histogram-bar').filter((d: any) => { - if (this.props.layoutDoc['histogramBarColors-'+d[0]]) return false; - else return true; - }) - defaultColorBars.attr("fill", color); - this.props.layoutDoc.defaultHistogramColor = color; - }; render() { var curSelectedBarName; @@ -451,7 +441,7 @@ export class Histogram extends React.Component<HistogramProps> { type={Type.SEC} icon={<FaFillDrip/>} selectedColor={StrCast(this.props.layoutDoc.defaultHistogramColor)} - setSelectedColor={color => this.changeDefaultColor(color)} + setSelectedColor={color => this.props.layoutDoc.defaultHistogramColor = color} size={Size.XSMALL} /> |