Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconfigure custering of events to occur at 1 min interval #1182

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions client/app/services/resource-details/resource-details.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ function ComponentController ($state, $stateParams, VmsService, lodash, EventNot
vm.tlOptions = {
start: new Date(start.setHours(start.getHours() - 2)),
end: new Date(end.setHours(end.getHours() + 2)),
eventShape: '\uf140',
eventHover: tlTooltip,
eventGrouping: 1000,
eventClick: tlTooltip,
eventGrouping: 60000,
minScale: 0.234,
maxScale: 1440
}
Expand Down Expand Up @@ -454,7 +453,7 @@ function ComponentController ($state, $stateParams, VmsService, lodash, EventNot
.append('div')
.attr('class', 'popover fade bottom in')
.attr('role', 'tooltip')
.on('mouseout', () => {
.on('mouseleave', () => {
d3.select('body').selectAll('.popover').remove()
})
const rightOrLeftLimit = fontSize * tooltipWidth
Expand All @@ -469,16 +468,23 @@ function ComponentController ($state, $stateParams, VmsService, lodash, EventNot
minute: 'numeric',
second: 'numeric'
}
const event = item.details.item

function eventDetails (event) {
return `
<div>Event Type: ${event.details.item.event_type}</div>
<div>Message: ${event.details.item.message}</div>
<div>Created On: ${event.date.toLocaleDateString('en-US', options)}</div>
`
}

tooltip.html(
`
<div class="arrow"></div>
<div class="popover-content">
<div>Event Type: ${event.event_type}</div>
<div>Message: ${event.message}</div>
<div>Created On: ${item.date.toLocaleDateString('en-US', options)}</div>
${item.events ? `<b>Group of ${item.events.length} events</b> ${item.events.map(event => `${eventDetails(event)}<hr>`).join('\n')}`
: `${eventDetails(item)}`}
</div>
`
`
)
tooltip
.style('left', `${left}px`)
Expand Down