Skip to content

Commit

Permalink
[7.x] [Endpoint] use rbush to only render to DOM resolver nodes that …
Browse files Browse the repository at this point in the history
…are in view (#68957) (#70072)

* [Endpoint] use rbush to only render resolver nodes that are in view in the DOM

* Add related events code back

* Change processNodePositionsAndEdgeLineSegments selector to return a function that takes optional bounding box

* Refactor selectors to not break original, and not run as often

* Memoize rtree search selector, fix tests

* Update node styles to use style hook, update jest tests

* Fix type change issue in jest test

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
kqualters-elastic and elasticmachine authored Jun 29, 2020
1 parent b6a7080 commit daacd09
Show file tree
Hide file tree
Showing 20 changed files with 527 additions and 72 deletions.
6 changes: 4 additions & 2 deletions x-pack/plugins/security_solution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"@types/md5": "^2.2.0"
},
"dependencies": {
"@types/rbush": "^3.0.0",
"@types/seedrandom": ">=2.0.0 <4.0.0",
"lodash": "^4.17.15",
"querystring": "^0.2.0",
"redux-devtools-extension": "^2.13.8",
"@types/seedrandom": ">=2.0.0 <4.0.0"
"rbush": "^3.0.1",
"redux-devtools-extension": "^2.13.8"
}
}
14 changes: 14 additions & 0 deletions x-pack/plugins/security_solution/public/resolver/lib/aabb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import * as vector2 from './vector2';
import { AABB } from '../types';

/**
* Return a boolean indicating if 2 vector objects are equal.
*/
export function isEqual(a: AABB, b: AABB): boolean {
return vector2.isEqual(a.minimum, b.minimum) && vector2.isEqual(a.maximum, b.maximum);
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ export function applyMatrix3([x, y]: Vector2, [m11, m12, m13, m21, m22, m23]: Ma
return [x * m11 + y * m12 + m13, x * m21 + y * m22 + m23];
}

/**
* Returns a boolean indicating equality of two vectors.
*/
export function isEqual([x1, y1]: Vector2, [x2, y2]: Vector2): boolean {
return x1 === x2 && y1 === y2;
}

/**
* Returns the distance between two vectors
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ function isValue(field: string | string[], value: string) {
}
}

export function isTerminatedProcess(passedEvent: ResolverEvent) {
return eventType(passedEvent) === 'processTerminated';
}

/**
* Returns a custom event type for a process event based on the event's metadata.
*/
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit daacd09

Please sign in to comment.