-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #975 from Elias0127/error_bar
Error bar
- Loading branch information
Showing
24 changed files
with
829 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react'; | ||
import { useSelector, useDispatch } from 'react-redux'; | ||
import { State } from '../types/redux/state'; | ||
import { toggleShowMinMax } from '../actions/graph'; | ||
import translate from '../utils/translate'; | ||
import TooltipMarkerComponent from './TooltipMarkerComponent'; | ||
|
||
/** | ||
* React Component rendering an Error Bar checkbox for toggle operation. | ||
* @returns Error Bar checkbox with tooltip and label | ||
*/ | ||
export default function ErrorBarComponent() { | ||
const dispatch = useDispatch(); | ||
const graphState = useSelector((state: State) => state.graph); | ||
|
||
/** | ||
* Dispatches an action to toggle visibility of min/max lines on checkbox interaction | ||
*/ | ||
const handleToggleShowMinMax = () => { | ||
dispatch(toggleShowMinMax()); | ||
} | ||
|
||
return ( | ||
<div className='checkbox'> | ||
<input | ||
type='checkbox' | ||
style={{ marginRight: '10px' }} | ||
onChange={() => handleToggleShowMinMax()} | ||
checked={graphState.showMinMax} | ||
id='errorBar' | ||
/> | ||
<label htmlFor='errorBar'> | ||
{translate('error.bar')} | ||
</label> | ||
<TooltipMarkerComponent page='home' helpTextId='help.home.error.bar' /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.