Skip to content

Commit

Permalink
flex layout of full timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson committed Sep 13, 2023
1 parent 3e1bacd commit 082cfb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Plotly, { Layout } from 'plotly.js-basic-dist'
import createPlotlyComponent from 'react-plotly.js/factory'
import { ObservationEvent } from './TimelinePlot'
import dayjs, { ManipulateType } from 'dayjs'
import pluralize from 'pluralize'
import { Paper, Typography } from '@mui/material'
const Plot = createPlotlyComponent(Plotly)

Expand Down Expand Up @@ -140,7 +139,7 @@ const TimelinePhase = ({
data={getTimelineData(start, observationEvents)}
layout={getLayout(start, timeMax, timeUnits, color, observationEvents)}
config={{ displayModeBar: false }}
style={{ width: '100%', height: '300px' }}
style={{ maxHeight: '300px' }}
useResizeHandler={true}
onHover={eventData => {
setHoverEvent(eventData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import hardcodedPhasesQueryResponseData, {
} from './phasesQueryResponseData'
import TimelinePhase from './TimelinePhase'
import getColorPalette from '../ColorGradient/ColorGradient'
import { Box } from '@mui/system'

const OBSERVATION_PHASE_COLUMN_NAME = 'observationphase'
const OBSERVATION_ID_COLUMN_NAME = 'observationid'
Expand Down Expand Up @@ -76,7 +77,7 @@ const TimelinePlot = ({
return <></>
}
return (
<>
<Box sx={{ display: 'flex' }}>
{phasesForTargetSpecies.map((phaseRow, index) => {
const { colorPalette } = getColorPalette(index, 1)
const phaseEventRows =
Expand Down Expand Up @@ -109,7 +110,7 @@ const TimelinePlot = ({
)
)
})}
</>
</Box>
)
}

Expand Down

0 comments on commit 082cfb6

Please sign in to comment.