-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/8.0' into fix-cursor-theme-iss…
…ues-8.0
- Loading branch information
Showing
80 changed files
with
1,922 additions
and
2,231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export class CachedResourceObserver { | ||
private loaded = { | ||
networkOrDisk: 0, | ||
memory: 0, | ||
}; | ||
private observer?: PerformanceObserver; | ||
|
||
constructor() { | ||
if (!window.PerformanceObserver) return; | ||
|
||
const cb = (entries: PerformanceObserverEntryList) => { | ||
const e = entries.getEntries(); | ||
e.forEach((entry: Record<string, any>) => { | ||
if (entry.initiatorType === 'script' || entry.initiatorType === 'link') { | ||
// If the resource is fetched from a local cache, or if it is a cross-origin resource, this property returns zero. | ||
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/transferSize | ||
if (entry.name.indexOf(window.location.host) > -1 && entry.transferSize === 0) { | ||
this.loaded.memory++; | ||
} else { | ||
this.loaded.networkOrDisk++; | ||
} | ||
} | ||
}); | ||
}; | ||
this.observer = new PerformanceObserver(cb); | ||
this.observer.observe({ | ||
type: 'resource', | ||
buffered: true, | ||
}); | ||
} | ||
|
||
public getCounts() { | ||
return this.loaded; | ||
} | ||
|
||
public destroy() { | ||
this.observer?.disconnect(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export * from './multilayer_timeaxis'; |
26 changes: 26 additions & 0 deletions
26
src/plugins/charts/common/static/styles/multilayer_timeaxis.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { Position, RecursivePartial, AxisStyle } from '@elastic/charts'; | ||
|
||
export const MULTILAYER_TIME_AXIS_STYLE: RecursivePartial<AxisStyle> = { | ||
tickLabel: { | ||
visible: true, | ||
padding: 0, | ||
rotation: 0, | ||
alignment: { | ||
vertical: Position.Bottom, | ||
horizontal: Position.Left, | ||
}, | ||
}, | ||
tickLine: { | ||
visible: true, | ||
size: 0.0001, | ||
padding: 4, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.