@@ -48,6 +48,8 @@ interface EventGraphProps {
48
48
event : Event | undefined ;
49
49
group : Group ;
50
50
className ?: string ;
51
+ showReleasesAs ?: 'line' | 'bubble' ;
52
+ showSummary ?: boolean ;
51
53
style ?: CSSProperties ;
52
54
}
53
55
@@ -70,7 +72,13 @@ function createSeriesAndCount(stats: EventsStats) {
70
72
) ;
71
73
}
72
74
73
- export function EventGraph ( { group, event, ...styleProps } : EventGraphProps ) {
75
+ export function EventGraph ( {
76
+ group,
77
+ event,
78
+ showReleasesAs,
79
+ showSummary = true ,
80
+ ...styleProps
81
+ } : EventGraphProps ) {
74
82
const theme = useTheme ( ) ;
75
83
const organization = useOrganization ( ) ;
76
84
const location = useLocation ( ) ;
@@ -197,7 +205,7 @@ export function EventGraph({group, event, ...styleProps}: EventGraphProps) {
197
205
198
206
const releaseSeries = useReleaseMarkLineSeries ( {
199
207
group,
200
- releases : hasReleaseBubblesSeries ? [ ] : releases ,
208
+ releases : hasReleaseBubblesSeries && showReleasesAs !== 'line' ? [ ] : releases ,
201
209
} ) ;
202
210
203
211
const {
@@ -207,14 +215,25 @@ export function EventGraph({group, event, ...styleProps}: EventGraphProps) {
207
215
releaseBubbleXAxis,
208
216
releaseBubbleGrid,
209
217
} = useReleaseBubbles ( {
218
+ chartRenderer : ( { start : trimStart , end : trimEnd } ) => {
219
+ return (
220
+ < EventGraph
221
+ group = { group }
222
+ event = { event }
223
+ showSummary = { false }
224
+ showReleasesAs = "line"
225
+ { ...styleProps }
226
+ />
227
+ ) ;
228
+ } ,
210
229
minTime : eventSeries . length && ( eventSeries [ 0 ] ! . name as number ) ,
211
230
maxTime : eventSeries . length && ( eventSeries [ eventSeries . length - 1 ] ! . name as number ) ,
212
231
bubbleSize : 4 ,
213
232
bubblePadding : {
214
233
x : 1 ,
215
234
y : 2 ,
216
235
} ,
217
- releases,
236
+ releases : hasReleaseBubblesSeries && showReleasesAs !== 'line' ? releases : [ ] ,
218
237
} ) ;
219
238
const flagSeries = useFlagSeries ( {
220
239
query : {
@@ -378,28 +397,32 @@ export function EventGraph({group, event, ...styleProps}: EventGraphProps) {
378
397
379
398
return (
380
399
< GraphWrapper { ...styleProps } >
381
- < SummaryContainer >
382
- < GraphButton
383
- onClick = { ( ) =>
384
- visibleSeries === EventGraphSeries . USER &&
385
- setVisibleSeries ( EventGraphSeries . EVENT )
386
- }
387
- isActive = { visibleSeries === EventGraphSeries . EVENT }
388
- disabled = { visibleSeries === EventGraphSeries . EVENT }
389
- label = { tn ( 'Event' , 'Events' , eventCount ) }
390
- count = { String ( eventCount ) }
391
- />
392
- < GraphButton
393
- onClick = { ( ) =>
394
- visibleSeries === EventGraphSeries . EVENT &&
395
- setVisibleSeries ( EventGraphSeries . USER )
396
- }
397
- isActive = { visibleSeries === EventGraphSeries . USER }
398
- disabled = { visibleSeries === EventGraphSeries . USER }
399
- label = { tn ( 'User' , 'Users' , userCount ) }
400
- count = { String ( userCount ) }
401
- />
402
- </ SummaryContainer >
400
+ { showSummary ? (
401
+ < SummaryContainer >
402
+ < GraphButton
403
+ onClick = { ( ) =>
404
+ visibleSeries === EventGraphSeries . USER &&
405
+ setVisibleSeries ( EventGraphSeries . EVENT )
406
+ }
407
+ isActive = { visibleSeries === EventGraphSeries . EVENT }
408
+ disabled = { visibleSeries === EventGraphSeries . EVENT }
409
+ label = { tn ( 'Event' , 'Events' , eventCount ) }
410
+ count = { String ( eventCount ) }
411
+ />
412
+ < GraphButton
413
+ onClick = { ( ) =>
414
+ visibleSeries === EventGraphSeries . EVENT &&
415
+ setVisibleSeries ( EventGraphSeries . USER )
416
+ }
417
+ isActive = { visibleSeries === EventGraphSeries . USER }
418
+ disabled = { visibleSeries === EventGraphSeries . USER }
419
+ label = { tn ( 'User' , 'Users' , userCount ) }
420
+ count = { String ( userCount ) }
421
+ />
422
+ </ SummaryContainer >
423
+ ) : (
424
+ < div />
425
+ ) }
403
426
< ChartContainer role = "figure" >
404
427
< BarChart
405
428
{ ...releaseBubbleEventHandlers }
@@ -481,6 +504,7 @@ function GraphButton({
481
504
const GraphWrapper = styled ( 'div' ) `
482
505
display: grid;
483
506
grid-template-columns: auto 1fr;
507
+ min-height: 100px;
484
508
` ;
485
509
486
510
const SummaryContainer = styled ( 'div' ) `
0 commit comments