Skip to content

Commit

Permalink
feat: show home and workplace
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Czigler committed Apr 5, 2023
1 parent ae62006 commit aaec304
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
7 changes: 6 additions & 1 deletion packages/sampleAddresses/lib/elasticsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ const fetchAdresses = async (query) => {
.map(
({
_id: id,
_source: { center_point: position, address_parts: address },
_source: {
center_point: position,
address_parts: address,
name: { default: name } = {},
},
}) => ({
address,
name,
position,
id,
})
Expand Down
2 changes: 2 additions & 0 deletions packages/simulator/lib/models/citizen.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ class Citizen {
position: this.position,
waitTime: this.waitTime,
kommun: this.kommun.name,
home: this.home,
workplace: this.workplace,
}
return obj
}
Expand Down
16 changes: 2 additions & 14 deletions packages/visualisation/src/components/HoverInfoBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,8 @@ const PassengerInfo = ({ data }) => {
<Paragraph>
Namn: <strong>{data.name}</strong>
</Paragraph>
<Paragraph>Resor:</Paragraph>
<Paragraph>
<ul>
{data.bookings &&
data.bookings.map((j) => {
return (
<li>
{j.pickup.departureTime && `(${j.pickup.departureTime}) `}
{j.pickup.name} &gt; {j.destination.name}
</li>
)
})}
</ul>
</Paragraph>
<Paragraph>Bostad: {data.home.name}</Paragraph>
<Paragraph>Arbetsplats: {data.workplace.name}</Paragraph>
<Paragraph>
CO<sub>2</sub>:{' '}
<strong>{Math.ceil((10 * data.co2) / 10) || 0} kg</strong>
Expand Down

0 comments on commit aaec304

Please sign in to comment.