Skip to content

Commit

Permalink
test pull request: does it pass the format checker?
Browse files Browse the repository at this point in the history
  • Loading branch information
marishuman committed May 17, 2023
1 parent 6a3b9d9 commit 22eb15d
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions src/vis/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as d3 from 'd3';

import { MapType } from './MapSelectionRadio';
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
import VisibilityIcon from '@mui/icons-material/Visibility';
import IconButton from '@mui/material/IconButton';

import { MULTIPLIERS } from './MeasurementMap';
Expand Down Expand Up @@ -86,13 +87,13 @@ const LineChart = ({
}
const _lineSummary = await fetchToJson(
API_URL +
'/api/lineSummary?' +
new URLSearchParams([
['mapType', mapType],
['selectedSites', _selectedSites.join(',')],
['timeFrom', timeFrom.toISOString()],
['timeTo', timeTo.toISOString()],
]),
'/api/lineSummary?' +
new URLSearchParams([
['mapType', mapType],
['selectedSites', _selectedSites.join(',')],
['timeFrom', timeFrom.toISOString()],
['timeTo', timeTo.toISOString()],
]),
);
setLineSummary(_lineSummary);
})();
Expand Down Expand Up @@ -216,13 +217,13 @@ const LineChart = ({
tooltip
.html(
d.site +
'<br>' +
d.values[
Math.floor(
d.values.length *
((event.offsetX - margin.left) / chartWidth),
)
].value.toFixed(2),
'<br>' +
d.values[
Math.floor(
d.values.length *
((event.offsetX - margin.left) / chartWidth),
)
].value.toFixed(2),
)
.style('left', event.offsetX - 120 + 'px')
.style('top', event.offsetY - 50 + 'px'),
Expand Down Expand Up @@ -252,21 +253,29 @@ const LineChart = ({
timeFrom,
timeTo,
]);
const [visible, setVisible] = useState(false);

const toggleVisibility = () => {
setVisible(!visible);
};

return (
<>
<div

id='line-close'
style={{ position: 'absolute', right: 10, top: 10, zIndex: 1600 }}
>

<IconButton
onClick={() => {
setDisplayOptions(
solveDisplayOptions(displayOptions, 'displayGraph', false),
);
}}
>
<VisibilityOffIcon></VisibilityOffIcon>
{visible ? <VisibilityIcon /> : <VisibilityOffIcon />}

</IconButton>
</div>
<div style={{ height, width, position: 'relative', top: offset }}>
Expand Down

0 comments on commit 22eb15d

Please sign in to comment.