diff options
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index ed663006f..883cc006b 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -14,6 +14,7 @@ import { FaFillDrip } from "react-icons/fa"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { listSpec } from "../../../../../fields/Schema"; import { scaleCreatorNumerical, yAxisCreator } from "../utils/D3Utils"; +import { undoBatch, undoable } from "../../../../util/UndoManager"; export interface HistogramProps { rootDoc: Doc; @@ -426,7 +427,7 @@ export class Histogram extends React.Component<HistogramProps> { <div className="graph-title"> <EditableText val={StrCast(this.props.layoutDoc[titleAccessor])} - setVal={action(val => this.props.layoutDoc[titleAccessor] = val as string)} + setVal={undoable (action(val => this.props.layoutDoc[titleAccessor] = val as string), "Change Graph Title")} color={"black"} size={Size.LARGE} fillWidth @@ -437,7 +438,7 @@ export class Histogram extends React.Component<HistogramProps> { type={Type.SEC} icon={<FaFillDrip/>} selectedColor={StrCast(this.props.layoutDoc.defaultHistogramColor)} - setSelectedColor={color => this.props.layoutDoc.defaultHistogramColor = color} + setSelectedColor={undoable (color => this.props.layoutDoc.defaultHistogramColor = color, "Change Default Bar Color")} size={Size.XSMALL} /> </div> @@ -451,7 +452,7 @@ export class Histogram extends React.Component<HistogramProps> { type={Type.SEC} icon={<FaFillDrip/>} selectedColor={selectedBarColor? selectedBarColor : this.curBarSelected.attr("fill")} - setSelectedColor={color => this.changeSelectedColor(color)} + setSelectedColor={undoable (color => this.changeSelectedColor(color), "Change Selected Bar Color")} size={Size.XSMALL} /> @@ -461,7 +462,7 @@ export class Histogram extends React.Component<HistogramProps> { color={'black'} type={Type.SEC} tooltip={'Revert to the default bar color'} - onClick={action(() => this.eraseSelectedColor())} + onClick={undoable (action(() => this.eraseSelectedColor()), "Change Selected Bar Color")} /> </div> : null} |