Skip to content

Commit ac1d316

Browse files
Merge pull request #4 from razorpay/latest_fork
Latest fork
2 parents 814e9cf + e59f984 commit ac1d316

File tree

21 files changed

+180
-79
lines changed

21 files changed

+180
-79
lines changed

projects/observability/src/pages/apis/api-detail/metrics/api-metrics.dashboard.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
272272
}
273273
],
274274
'selection-handler': {
275-
type: 'cartesian-explorer-navigation-handler'
275+
type: 'cartesian-explorer-selection-handler'
276276
}
277277
},
278278
{
@@ -335,7 +335,7 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
335335
}
336336
],
337337
'selection-handler': {
338-
type: 'cartesian-explorer-navigation-handler'
338+
type: 'cartesian-explorer-selection-handler'
339339
}
340340
},
341341
{
@@ -377,7 +377,7 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
377377
}
378378
],
379379
'selection-handler': {
380-
type: 'cartesian-explorer-navigation-handler'
380+
type: 'cartesian-explorer-selection-handler'
381381
}
382382
}
383383
]
@@ -409,7 +409,7 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
409409
}
410410
],
411411
'selection-handler': {
412-
type: 'cartesian-explorer-navigation-handler'
412+
type: 'cartesian-explorer-selection-handler'
413413
}
414414
}
415415
]

projects/observability/src/pages/apis/api-detail/overview/api-overview.dashboard.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
295295
}
296296
}
297297
}
298-
]
298+
],
299+
'selection-handler': {
300+
type: 'cartesian-explorer-selection-handler'
301+
}
299302
},
300303
{
301304
type: 'cartesian-widget',
@@ -389,7 +392,10 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
389392
}
390393
}
391394
}
392-
]
395+
],
396+
'selection-handler': {
397+
type: 'cartesian-explorer-selection-handler'
398+
}
393399
},
394400
{
395401
type: 'cartesian-widget',
@@ -483,7 +489,10 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
483489
}
484490
}
485491
}
486-
]
492+
],
493+
'selection-handler': {
494+
type: 'cartesian-explorer-selection-handler'
495+
}
487496
}
488497
]
489498
},

projects/observability/src/pages/apis/backend-detail/metrics/backend-metrics.dashboard.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,10 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
254254
}
255255
}
256256
}
257-
]
257+
],
258+
'selection-handler': {
259+
type: 'cartesian-explorer-selection-handler'
260+
}
258261
},
259262
{
260263
type: 'container-widget',
@@ -314,7 +317,10 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
314317
type: 'entity-error-percentage-timeseries-data-source'
315318
}
316319
}
317-
]
320+
],
321+
'selection-handler': {
322+
type: 'cartesian-explorer-selection-handler'
323+
}
318324
},
319325
{
320326
type: 'cartesian-widget',
@@ -337,7 +343,10 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
337343
}
338344
}
339345
}
340-
]
346+
],
347+
'selection-handler': {
348+
type: 'cartesian-explorer-selection-handler'
349+
}
341350
}
342351
]
343352
}
@@ -366,7 +375,10 @@ export const backendMetricsDashboard: DashboardDefaultConfiguration = {
366375
}
367376
}
368377
}
369-
]
378+
],
379+
'selection-handler': {
380+
type: 'cartesian-explorer-selection-handler'
381+
}
370382
}
371383
]
372384
}

projects/observability/src/pages/apis/backend-detail/overview/backend-overview.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ export class BackendOverviewComponent {
287287
}
288288
}
289289
}
290-
]
290+
],
291+
'selection-handler': {
292+
type: 'cartesian-explorer-selection-handler'
293+
}
291294
},
292295
{
293296
type: 'cartesian-widget',
@@ -365,7 +368,10 @@ export class BackendOverviewComponent {
365368
}
366369
}
367370
}
368-
]
371+
],
372+
'selection-handler': {
373+
type: 'cartesian-explorer-selection-handler'
374+
}
369375
},
370376
{
371377
type: 'cartesian-widget',
@@ -443,7 +449,10 @@ export class BackendOverviewComponent {
443449
}
444450
}
445451
}
446-
]
452+
],
453+
'selection-handler': {
454+
type: 'cartesian-explorer-selection-handler'
455+
}
447456
}
448457
]
449458
},

projects/observability/src/pages/apis/service-detail/metrics/service-metrics.dashboard.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
270270
}
271271
}
272272
}
273-
]
273+
],
274+
'selection-handler': {
275+
type: 'cartesian-explorer-selection-handler'
276+
}
274277
},
275278
{
276279
type: 'container-widget',
@@ -330,7 +333,10 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
330333
type: 'entity-error-percentage-timeseries-data-source'
331334
}
332335
}
333-
]
336+
],
337+
'selection-handler': {
338+
type: 'cartesian-explorer-selection-handler'
339+
}
334340
},
335341
{
336342
type: 'cartesian-widget',
@@ -369,7 +375,10 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
369375
}
370376
}
371377
}
372-
]
378+
],
379+
'selection-handler': {
380+
type: 'cartesian-explorer-selection-handler'
381+
}
373382
}
374383
]
375384
}
@@ -398,7 +407,10 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
398407
}
399408
}
400409
}
401-
]
410+
],
411+
'selection-handler': {
412+
type: 'cartesian-explorer-selection-handler'
413+
}
402414
}
403415
]
404416
}

projects/observability/src/pages/apis/service-detail/overview/service-overview.dashboard.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
339339
}
340340
}
341341
}
342-
]
342+
],
343+
'selection-handler': {
344+
type: 'cartesian-explorer-selection-handler'
345+
}
343346
},
344347
{
345348
type: 'cartesian-widget',
@@ -433,7 +436,10 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
433436
}
434437
}
435438
}
436-
]
439+
],
440+
'selection-handler': {
441+
type: 'cartesian-explorer-selection-handler'
442+
}
437443
},
438444
{
439445
type: 'cartesian-widget',
@@ -527,7 +533,10 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
527533
}
528534
}
529535
}
530-
]
536+
],
537+
'selection-handler': {
538+
type: 'cartesian-explorer-selection-handler'
539+
}
531540
}
532541
]
533542
},

projects/observability/src/pages/explorer/explorer-dashboard-builder.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ describe('Explorer dashboard builder', () => {
4141
type: 'cartesian-widget',
4242
'selectable-interval': false,
4343
'series-from-data': true,
44-
'legend-position': LegendPosition.Bottom
44+
'legend-position': LegendPosition.Bottom,
45+
'selection-handler': {
46+
type: 'cartesian-explorer-selection-handler'
47+
}
4548
},
4649
onReady: expect.any(Function)
4750
}

projects/observability/src/pages/explorer/explorer-dashboard-builder.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ export class ExplorerDashboardBuilder {
6262
type: 'cartesian-widget',
6363
'selectable-interval': false,
6464
'series-from-data': true,
65-
'legend-position': LegendPosition.Bottom
65+
'legend-position': LegendPosition.Bottom,
66+
'selection-handler': {
67+
type: 'cartesian-explorer-selection-handler'
68+
}
6669
},
6770
onReady: dashboard => {
6871
dashboard.createAndSetRootDataFromModelClass(ExplorerVisualizationCartesianDataSourceModel);

projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { DefaultChartTooltipRenderData } from '../utils/chart-tooltip/default/de
1919
import { MouseLocationData } from '../utils/mouse-tracking/mouse-tracking';
2020
import { Axis, AxisLocation, AxisType, Band, CartesianChart, RenderingStrategy, Series } from './chart';
2121
import { ChartBuilderService } from './chart-builder.service';
22-
import { ChartEvent } from './chart-interactivty';
22+
import { ChartEvent, ChartSelect } from './chart-interactivty';
2323
import { defaultXDataAccessor, defaultYDataAccessor } from './d3/scale/default-data-accessors';
2424

2525
@Component({
@@ -66,7 +66,9 @@ export class CartesianChartComponent<TData> implements OnChanges, OnDestroy {
6666
public readonly selectedIntervalChange: EventEmitter<IntervalValue> = new EventEmitter();
6767

6868
@Output()
69-
public readonly selecteRangeChange: EventEmitter<any> = new EventEmitter();
69+
public readonly selectionChange: EventEmitter<
70+
MouseLocationData<TData, Series<TData> | Band<TData>>[] | ChartSelect
71+
> = new EventEmitter();
7072

7173
@ViewChild('chartContainer', { static: true })
7274
public readonly container!: ElementRef;
@@ -98,9 +100,7 @@ export class CartesianChartComponent<TData> implements OnChanges, OnDestroy {
98100
this.convertToDefaultTooltipRenderData(data)
99101
)
100102
)
101-
.withEventListener(ChartEvent.Select, data => {
102-
this.selecteRangeChange.emit(data);
103-
});
103+
.withEventListener(ChartEvent.Select, selectedData => this.selectionChange.emit(selectedData));
104104

105105
if (this.bands) {
106106
this.chart.withBands(...this.bands);

projects/observability/src/shared/components/cartesian/chart-interactivty.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@ export const enum ChartEvent {
88
Select
99
}
1010

11-
export type ChartEventListener<TData> = (data: MouseLocationData<TData, Series<TData> | Band<TData>>[]) => void;
11+
export type ChartEventListener<TData> = (
12+
data: MouseLocationData<TData, Series<TData> | Band<TData>>[] | ChartSelect
13+
) => void;
1214

1315
export interface ChartTooltipTrackingOptions {
1416
followSingleAxis?: AxisType;
1517
radius?: number;
1618
}
19+
20+
export interface ChartSelect {
21+
// tslint:disable-next-line
22+
series: any;
23+
start: [number, number];
24+
end: [number, number];
25+
}

0 commit comments

Comments
 (0)