Merge pull request #242 from Prydeton/feat/tooltip-legend-display-filtered-count
Display filtered people count on legend and tooltip
This commit is contained in:
commit
01bb14031d
|
|
@ -126,7 +126,7 @@ const AvailabilityViewer = ({
|
||||||
setTooltip({
|
setTooltip({
|
||||||
x: Math.round(cellBox.x-wrapperBox.x + cellBox.width/2),
|
x: Math.round(cellBox.x-wrapperBox.x + cellBox.width/2),
|
||||||
y: Math.round(cellBox.y-wrapperBox.y + cellBox.height)+6,
|
y: Math.round(cellBox.y-wrapperBox.y + cellBox.height)+6,
|
||||||
available: `${peopleHere.length} / ${people.length} ${t('event:available')}`,
|
available: `${peopleHere.length} / ${filteredPeople.length} ${t('event:available')}`,
|
||||||
date: parsedDate.hour(time.slice(0, 2)).minute(time.slice(2, 4)).format(isSpecificDates ? `${timeText} ddd, D MMM YYYY` : `${timeText} ddd`),
|
date: parsedDate.hour(time.slice(0, 2)).minute(time.slice(2, 4)).format(isSpecificDates ? `${timeText} ddd, D MMM YYYY` : `${timeText} ddd`),
|
||||||
people: peopleHere,
|
people: peopleHere,
|
||||||
})
|
})
|
||||||
|
|
@ -168,7 +168,7 @@ const AvailabilityViewer = ({
|
||||||
<Legend
|
<Legend
|
||||||
min={Math.min(min, filteredPeople.length)}
|
min={Math.min(min, filteredPeople.length)}
|
||||||
max={Math.min(max, filteredPeople.length)}
|
max={Math.min(max, filteredPeople.length)}
|
||||||
total={people.filter(p => p.availability.length > 0).length}
|
total={filteredPeople.length}
|
||||||
onSegmentFocus={count => setFocusCount(count)}
|
onSegmentFocus={count => setFocusCount(count)}
|
||||||
/>
|
/>
|
||||||
<Info>{t('event:group.info1')}</Info>
|
<Info>{t('event:group.info1')}</Info>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue