mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `7.17`: - [[ML][APM] Fix Cytoscape listener typing, Update Cytoscape versions (#205726)](https://github.com/elastic/kibana/pull/205726) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gonçalo Rica Pais da Silva","email":"goncalo.rica@elastic.co"},"sourceCommit":{"committedDate":"2025-01-08T09:16:17Z","message":"[ML][APM] Fix Cytoscape listener typing, Update Cytoscape versions (#205726)\n\n## Summary\r\n\r\nUpdates Cytoscape to newer versions, requiring one change with some\r\n`removeListener` usage no longer being valid typing.\r\n\r\nSupersedes #205444\r\n\r\n## How to test\r\n\r\n- Passes CI with no type errors or failed CI jobs for ML\r\n- Job Map or wherever cytoscape is being used on ML doesn't leak event\r\nlisteners.\r\n- Usages in APM also do not break.","sha":"7363f03d81835f70f39caa27e7096b8a0361ae69","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:all-open","Team:obs-ux-infra_services"],"title":"[ML][APM] Fix Cytoscape listener typing, Update Cytoscape versions","number":205726,"url":"https://github.com/elastic/kibana/pull/205726","mergeCommit":{"message":"[ML][APM] Fix Cytoscape listener typing, Update Cytoscape versions (#205726)\n\n## Summary\r\n\r\nUpdates Cytoscape to newer versions, requiring one change with some\r\n`removeListener` usage no longer being valid typing.\r\n\r\nSupersedes #205444\r\n\r\n## How to test\r\n\r\n- Passes CI with no type errors or failed CI jobs for ML\r\n- Job Map or wherever cytoscape is being used on ML doesn't leak event\r\nlisteners.\r\n- Usages in APM also do not break.","sha":"7363f03d81835f70f39caa27e7096b8a0361ae69"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205726","number":205726,"mergeCommit":{"message":"[ML][APM] Fix Cytoscape listener typing, Update Cytoscape versions (#205726)\n\n## Summary\r\n\r\nUpdates Cytoscape to newer versions, requiring one change with some\r\n`removeListener` usage no longer being valid typing.\r\n\r\nSupersedes #205444\r\n\r\n## How to test\r\n\r\n- Passes CI with no type errors or failed CI jobs for ML\r\n- Job Map or wherever cytoscape is being used on ML doesn't leak event\r\nlisteners.\r\n- Usages in APM also do not break.","sha":"7363f03d81835f70f39caa27e7096b8a0361ae69"}}]}] BACKPORT-->
This commit is contained in:
parent
8c5bfe7826
commit
828e49db66
7 changed files with 26 additions and 40 deletions
|
@ -212,8 +212,8 @@
|
|||
"copy-to-clipboard": "^3.0.8",
|
||||
"core-js": "^3.19.1",
|
||||
"cronstrue": "^1.51.0",
|
||||
"cytoscape": "^3.10.0",
|
||||
"cytoscape-dagre": "^2.2.2",
|
||||
"cytoscape": "^3.30.4",
|
||||
"cytoscape-dagre": "^2.5.0",
|
||||
"d3": "3.5.17",
|
||||
"d3-array": "1.2.4",
|
||||
"d3-cloud": "1.2.5",
|
||||
|
@ -514,7 +514,7 @@
|
|||
"@types/cmd-shim": "^2.0.0",
|
||||
"@types/color": "^3.0.0",
|
||||
"@types/compression-webpack-plugin": "^2.0.2",
|
||||
"@types/cytoscape": "^3.14.0",
|
||||
"@types/cytoscape": "^3.21.8",
|
||||
"@types/d3": "^3.5.43",
|
||||
"@types/d3-array": "^1.2.7",
|
||||
"@types/d3-interpolate": "^2.0.0",
|
||||
|
|
|
@ -86,7 +86,7 @@ function useDebugDownloadUrl(cy?: cytoscape.Core) {
|
|||
|
||||
return () => {
|
||||
if (cy) {
|
||||
cy.off('add remove', undefined, elementsHandler);
|
||||
cy.off('add remove', elementsHandler);
|
||||
}
|
||||
};
|
||||
}, [cy, debug]);
|
||||
|
@ -127,7 +127,7 @@ export function Controls() {
|
|||
|
||||
return () => {
|
||||
if (cy) {
|
||||
cy.off('zoom', undefined, zoomHandler);
|
||||
cy.off('zoom', zoomHandler);
|
||||
}
|
||||
};
|
||||
}, [cy]);
|
||||
|
|
|
@ -106,7 +106,7 @@ export function Popover({ focusedServiceName, environment, kuery, start, end }:
|
|||
if (cy) {
|
||||
cy.removeListener('select', 'node', selectHandler);
|
||||
cy.removeListener('unselect', 'node', deselect);
|
||||
cy.removeListener('viewport', undefined, deselect);
|
||||
cy.removeListener('viewport', deselect);
|
||||
cy.removeListener('drag', 'node', deselect);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -178,15 +178,12 @@ const getStyle = (theme: EuiTheme): cytoscape.Stylesheet[] => {
|
|||
'source-arrow-shape': isIE11 ? 'none' : 'triangle',
|
||||
'source-arrow-color': lineColor,
|
||||
'target-arrow-shape': isIE11 ? 'none' : 'triangle',
|
||||
// @ts-expect-error
|
||||
'source-distance-from-node': isIE11 ? undefined : parseInt(theme.eui.paddingSizes.xs, 10),
|
||||
'target-distance-from-node': isIE11 ? undefined : parseInt(theme.eui.paddingSizes.xs, 10),
|
||||
},
|
||||
},
|
||||
{
|
||||
selector: 'edge[isInverseEdge]',
|
||||
// @ts-expect-error DefinitelyTyped says visibility is "none" but it's
|
||||
// actually "hidden"
|
||||
style: { visibility: 'hidden' },
|
||||
},
|
||||
{
|
||||
|
|
|
@ -47,8 +47,6 @@ function getLayoutOptions({
|
|||
}): cytoscape.LayoutOptions {
|
||||
const animationOptions = getAnimationOptions(theme);
|
||||
|
||||
// @ts-expect-error Some of the dagre-specific layout options don't work with
|
||||
// the types.
|
||||
return {
|
||||
animationDuration: animationOptions.duration,
|
||||
animationEasing: animationOptions.easing,
|
||||
|
@ -62,7 +60,7 @@ function getLayoutOptions({
|
|||
rankSep: 128,
|
||||
rankDir: 'LR',
|
||||
ranker: 'network-simplex',
|
||||
};
|
||||
} as cytoscape.LayoutOptions;
|
||||
}
|
||||
|
||||
function setCursor(cursor: string, event: cytoscape.EventObjectCore) {
|
||||
|
@ -202,19 +200,18 @@ export function useCytoscapeEventHandlers({
|
|||
if (cy) {
|
||||
cy.removeListener(
|
||||
'custom:data drag dragfree layoutstop select tapstart tapend unselect',
|
||||
undefined,
|
||||
debugHandler
|
||||
);
|
||||
cy.removeListener('custom:data', undefined, dataHandler);
|
||||
cy.removeListener('layoutstop', undefined, layoutstopHandler);
|
||||
cy.removeListener('custom:data', dataHandler);
|
||||
cy.removeListener('layoutstop', layoutstopHandler);
|
||||
cy.removeListener('mouseover', 'edge, node', mouseoverHandler);
|
||||
cy.removeListener('mouseout', 'edge, node', mouseoutHandler);
|
||||
cy.removeListener('select', 'node', selectHandler);
|
||||
cy.removeListener('unselect', 'node', unselectHandler);
|
||||
cy.removeListener('drag', 'node', dragHandler);
|
||||
cy.removeListener('dragfree', 'node', dragfreeHandler);
|
||||
cy.removeListener('tapstart', undefined, tapstartHandler);
|
||||
cy.removeListener('tapend', undefined, tapendHandler);
|
||||
cy.removeListener('tapstart', tapstartHandler);
|
||||
cy.removeListener('tapend', tapendHandler);
|
||||
}
|
||||
};
|
||||
}, [cy, serviceName, trackApmEvent, theme]);
|
||||
|
|
|
@ -105,7 +105,7 @@ export function Cytoscape({
|
|||
|
||||
return () => {
|
||||
if (cy) {
|
||||
cy.removeListener('data', undefined, dataHandler as cytoscape.EventHandler);
|
||||
cy.removeListener('data', dataHandler);
|
||||
}
|
||||
};
|
||||
}, [cy, elements, height, width]);
|
||||
|
|
36
yarn.lock
36
yarn.lock
|
@ -5504,10 +5504,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.2.tgz#66ad9331f63fe8a3d3d9d8c6e3906dd10f6446e8"
|
||||
integrity sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==
|
||||
|
||||
"@types/cytoscape@^3.14.0":
|
||||
version "3.14.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/cytoscape/-/cytoscape-3.14.0.tgz#346b5430a7a1533784bcf44fcbe6c5255b948d36"
|
||||
integrity sha512-qOhhZFGb35457vmCu9YHqwjqleraSAEikaIFmMUPWzTC7FrwkS7VR/6ymqRHW7Z8wivHuzsZDYCoePIepd69qg==
|
||||
"@types/cytoscape@^3.21.8":
|
||||
version "3.21.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/cytoscape/-/cytoscape-3.21.8.tgz#6166a2eabd66d3ae3259024875e037492adb8db6"
|
||||
integrity sha512-6Bo9ZDrv0vfwe8Sg/ERc5VL0yU0gYvP4dgZi0fAXYkKHfyHaNqWRMcwYm3mu4sLsXbB8ZuXE75sR7qnaOL5JgQ==
|
||||
|
||||
"@types/d3-array@^1.2.7":
|
||||
version "1.2.7"
|
||||
|
@ -10768,20 +10768,17 @@ cypress@^13.3.0:
|
|||
untildify "^4.0.0"
|
||||
yauzl "^2.10.0"
|
||||
|
||||
cytoscape-dagre@^2.2.2:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/cytoscape-dagre/-/cytoscape-dagre-2.2.2.tgz#5f32a85c0ba835f167efee531df9e89ac58ff411"
|
||||
integrity sha512-zsg36qNwua/L2stJSWkcbSDcvW3E6VZf6KRe6aLnQJxuXuz89tMqI5EVYVKEcNBgzTEzFMFv0PE3T0nD4m6VDw==
|
||||
cytoscape-dagre@^2.5.0:
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/cytoscape-dagre/-/cytoscape-dagre-2.5.0.tgz#47d9835ab64dd0b596d9c94731f070282f82fc5a"
|
||||
integrity sha512-VG2Knemmshop4kh5fpLO27rYcyUaaDkRw+6PiX4bstpB+QFt0p2oauMrsjVbUamGWQ6YNavh7x2em2uZlzV44g==
|
||||
dependencies:
|
||||
dagre "^0.8.2"
|
||||
dagre "^0.8.5"
|
||||
|
||||
cytoscape@^3.10.0:
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/cytoscape/-/cytoscape-3.10.0.tgz#3b462e0d35121ecd2d2702f470915fd6dae01777"
|
||||
integrity sha512-lWOnG4HJQD0cy+tCiBmbV/QRknInuZ8HvjcUifQZ7E4LWmKMvl6d5eP0LaaRLfBJAplXWcJfwc17ZJ/nwPeaYg==
|
||||
dependencies:
|
||||
heap "^0.2.6"
|
||||
lodash.debounce "^4.0.8"
|
||||
cytoscape@^3.30.4:
|
||||
version "3.30.4"
|
||||
resolved "https://registry.yarnpkg.com/cytoscape/-/cytoscape-3.30.4.tgz#3404da0a159c00a1a3df2c85b2b43fdc66a0e28e"
|
||||
integrity sha512-OxtlZwQl1WbwMmLiyPSEBuzeTIQnwZhJYYWFzZ2PhEHVFwpeaqNIkUzSiso00D98qk60l8Gwon2RP304d3BJ1A==
|
||||
|
||||
"d3-array@1 - 3", "d3-array@2 - 3", "d3-array@2.10.0 - 3", "d3-array@2.5.0 - 3", d3-array@3.2.2, d3-array@^3.2.2:
|
||||
version "3.2.2"
|
||||
|
@ -11022,7 +11019,7 @@ d@1, d@^1.0.1, d@^1.0.2:
|
|||
es5-ext "^0.10.64"
|
||||
type "^2.7.2"
|
||||
|
||||
dagre@^0.8.2:
|
||||
dagre@^0.8.5:
|
||||
version "0.8.5"
|
||||
resolved "https://registry.yarnpkg.com/dagre/-/dagre-0.8.5.tgz#ba30b0055dac12b6c1fcc247817442777d06afee"
|
||||
integrity sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==
|
||||
|
@ -15095,11 +15092,6 @@ he@^1.2.0:
|
|||
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
|
||||
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
|
||||
|
||||
heap@^0.2.6:
|
||||
version "0.2.6"
|
||||
resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac"
|
||||
integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=
|
||||
|
||||
hexoid@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz#ad10c6573fb907de23d9ec63a711267d9dc9bc18"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue