Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Props = {
helperDisplay?: boolean;
className?: string;
styles?: Partial<Record<SemanticName, CSSProperties>>;
withArrowStep?: boolean;
};

const BinarySlider: FC<Props> = ({
Expand All @@ -35,6 +36,7 @@ const BinarySlider: FC<Props> = ({
helperDisplay = false,
className,
styles,
withArrowStep = true,
}) => {
const inputDisplayValue = forecast ? forecast.toString() + "%" : "—";
const [, setInputValue] = useState(inputDisplayValue);
Expand Down Expand Up @@ -87,7 +89,7 @@ const BinarySlider: FC<Props> = ({
defaultValue={forecast ?? DEFAULT_SLIDER_VALUE}
onChange={handleSliderForecastChange}
step={1}
arrowStep={0.1}
arrowStep={withArrowStep ? 0.1 : undefined}
shouldSyncWithDefault
marks={
communityForecast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ const CurveHistogram: FC<Props> = ({
padding={{ top: 0, bottom: 25, left: 10, right: 10 }}
height={height}
>
<VictoryBar
data={histogramData}
style={{
data: {
fill: "light" + color,
},
}}
barRatio={1.7}
x={(d) => d.x + 0.5}
/>
<VictoryAxis
tickValues={range(0, 101)}
tickFormat={(x: number) => (x % 10 === 0 ? `${x}%` : "")}
Expand All @@ -65,16 +75,6 @@ const CurveHistogram: FC<Props> = ({
grid: { stroke: "none" },
}}
/>
<VictoryBar
data={histogramData}
style={{
data: {
fill: "light" + color,
},
}}
barRatio={1.7}
x={(d) => d.x + 0.5}
/>
{choiceOptions[0].forecast && (
<VictoryScatter
data={[{ y: 0, x: choiceOptions[0].forecast * 100 }]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const CurveForecastMaker: FC<Props> = ({
rail: { backgroundColor: "white", height: "3px" },
track: { backgroundColor: "white", height: "3px" },
}}
withArrowStep={false}
/>
</React.Fragment>
))}
Expand Down