-
Notifications
You must be signed in to change notification settings - Fork 11
feat: log marker indicator in the waterfall view #899
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
Changes from all commits
3b1bb34
1c9d3a1
b1f9976
1bf2d3b
c2f99a6
9a6efc4
a9499a8
091bf28
b927bf4
e8a757b
5e1efc9
2272030
cd1e654
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,10 @@ | |
} | ||
} | ||
|
||
.marker { | ||
cursor: pointer; | ||
} | ||
|
||
.hovered-row { | ||
.backdrop { | ||
fill-opacity: 100; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import { | |
} from '@angular/core'; | ||
import { RecursivePartial, TypedSimpleChanges } from '@hypertrace/common'; | ||
import { minBy } from 'lodash-es'; | ||
import { SequenceOptions, SequenceSegment } from './sequence'; | ||
import { Marker, MarkerDatum, SequenceOptions, SequenceSegment } from './sequence'; | ||
import { SequenceChartService } from './sequence-chart.service'; | ||
import { SequenceObject } from './sequence-object'; | ||
|
||
|
@@ -52,6 +52,9 @@ export class SequenceChartComponent implements OnChanges { | |
SequenceSegment | undefined | ||
>(); | ||
|
||
@Output() | ||
public readonly markerHoveredChange: EventEmitter<MarkerDatum> = new EventEmitter<MarkerDatum>(); | ||
|
||
@ViewChild('chartContainer', { static: true }) | ||
private readonly chartContainer!: ElementRef; | ||
|
||
|
@@ -100,7 +103,8 @@ export class SequenceChartComponent implements OnChanges { | |
barHeight: this.barHeight, | ||
unit: this.unit, | ||
onSegmentSelected: (segment?: SequenceSegment) => this.onSegmentSelected(segment), | ||
onSegmentHovered: (segment?: SequenceSegment) => this.onSegmentHovered(segment) | ||
onSegmentHovered: (segment?: SequenceSegment) => this.onSegmentHovered(segment), | ||
onMarkerHovered: (datum?: MarkerDatum) => this.onMarkerHovered(datum) | ||
}; | ||
} | ||
|
||
|
@@ -115,7 +119,10 @@ export class SequenceChartComponent implements OnChanges { | |
id: segment.id, | ||
start: segment.start - minStart, | ||
end: segment.end - minStart, | ||
color: segment.color | ||
color: segment.color, | ||
markers: segment.markers | ||
.map((marker: Marker) => ({ ...marker, markerTime: marker.markerTime - minStart })) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: some comments would be helpful |
||
.sort((marker1, marker2) => marker1.markerTime - marker2.markerTime) | ||
})); | ||
} | ||
|
||
|
@@ -128,4 +135,8 @@ export class SequenceChartComponent implements OnChanges { | |
this.hovered = segment; | ||
this.hoveredChange.emit(segment); | ||
} | ||
|
||
private onMarkerHovered(datum?: MarkerDatum): void { | ||
this.markerHoveredChange.emit(datum); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { ElementRef } from '@angular/core'; | ||
import { Selection } from 'd3-selection'; | ||
import { SequenceObject } from './sequence-object'; | ||
|
||
|
@@ -6,6 +7,18 @@ export interface SequenceSegment { | |
start: number; | ||
end: number; | ||
color: string; | ||
markers: Marker[]; | ||
} | ||
|
||
export interface Marker { | ||
id: string; | ||
markerTime: number; | ||
timestamps: string[]; | ||
} | ||
|
||
export interface MarkerDatum { | ||
marker: Marker; | ||
origin: ElementRef; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we could use the approach we discussed earlier then that would be great. Mainly, a way to avoid passing an elementRef There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will take a look in this. |
||
} | ||
|
||
/* Internal Types */ | ||
|
@@ -20,6 +33,7 @@ export interface SequenceOptions { | |
unit: string | undefined; | ||
onSegmentSelected(row?: SequenceSegment): void; | ||
onSegmentHovered(row?: SequenceSegment): void; | ||
onMarkerHovered(datum?: MarkerDatum): void; | ||
} | ||
|
||
export interface MarginOptions { | ||
|
Uh oh!
There was an error while loading. Please reload this page.