fix(site-finder): visible by-quarter pipeline bars #167
1 changed files with 15 additions and 5 deletions
|
|
@ -205,16 +205,25 @@ export function Pipeline24moBlock({ data }: Props) {
|
|||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "flex-end",
|
||||
alignItems: "stretch",
|
||||
gap: 4,
|
||||
height: 80,
|
||||
}}
|
||||
>
|
||||
{data.by_quarter.map((q) => {
|
||||
const heightPct =
|
||||
// Bar height in pixels of the 60px area above label row
|
||||
// (reserves ~16px for label). Using fixed px avoids the
|
||||
// align-items:flex-end shrink-to-content trap where %-heights
|
||||
// would resolve to the column's content height instead of
|
||||
// the outer 80px container.
|
||||
const BAR_AREA_PX = 60;
|
||||
const barPx =
|
||||
maxFlatsPerQuarter > 0
|
||||
? Math.max(6, (q.flats / maxFlatsPerQuarter) * 100)
|
||||
: 6;
|
||||
? Math.max(
|
||||
4,
|
||||
(q.flats / maxFlatsPerQuarter) * BAR_AREA_PX,
|
||||
)
|
||||
: 4;
|
||||
return (
|
||||
<div
|
||||
key={q.quarter}
|
||||
|
|
@ -222,6 +231,7 @@ export function Pipeline24moBlock({ data }: Props) {
|
|||
flex: 1,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "flex-end",
|
||||
alignItems: "center",
|
||||
gap: 3,
|
||||
}}
|
||||
|
|
@ -229,7 +239,7 @@ export function Pipeline24moBlock({ data }: Props) {
|
|||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
height: `${heightPct}%`,
|
||||
height: barPx,
|
||||
background: c.fg,
|
||||
opacity: 0.5,
|
||||
borderRadius: "3px 3px 0 0",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue