This is an automated email from the ASF dual-hosted git repository.
MartijnVisser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 292f36fecbd [FLINK-40044][runtime-web] Replace unmaintained dagre with
@dagrejs/dagre 3.x (#28600)
292f36fecbd is described below
commit 292f36fecbd821e4215642e666e3dc6080927eb1
Author: Purushottam Sinha <[email protected]>
AuthorDate: Thu Jul 2 23:31:30 2026 +0530
[FLINK-40044][runtime-web] Replace unmaintained dagre with @dagrejs/dagre
3.x (#28600)
The [email protected] package used for the job DAG layout is unmaintained. Switch
to the maintained @dagrejs/dagre 3.x fork, which keeps the same graphlib /
layout API and ships its own TypeScript types (so @types/dagre is dropped).
- graph.ts: import from @dagrejs/dagre; the type entry no longer exports
GraphEdge, so use the equivalent EdgeLabel that graph.edge() returns.
- angular.json: drop the now-obsolete allowedCommonJsDependencies entry for
dagre; @dagrejs/dagre and @dagrejs/graphlib are consumed as ESM and
produce
no CommonJS warning.
- Regenerate the NOTICE entries: dagre/graphlib/lodash (dagre-only
transitives)
removed, @dagrejs/dagre and @dagrejs/graphlib added.
Generated-by: Claude Code (claude-opus-4-8)
---
.../src/main/resources/META-INF/NOTICE | 148 +++++++--------------
flink-runtime-web/web-dashboard/angular.json | 3 -
flink-runtime-web/web-dashboard/package-lock.json | 50 +++----
flink-runtime-web/web-dashboard/package.json | 3 +-
.../src/app/components/dagre/graph.ts | 18 +--
5 files changed, 74 insertions(+), 148 deletions(-)
diff --git a/flink-runtime-web/src/main/resources/META-INF/NOTICE
b/flink-runtime-web/src/main/resources/META-INF/NOTICE
index d653e23787f..15445cdcbcd 100644
--- a/flink-runtime-web/src/main/resources/META-INF/NOTICE
+++ b/flink-runtime-web/src/main/resources/META-INF/NOTICE
@@ -41,6 +41,8 @@ The Apache Software Foundation (http://www.apache.org/).
| @antv/util | 2.0.17 | ISC |
| @babel/runtime | 7.29.2 | MIT |
| @ctrl/tinycolor | 3.6.1 | MIT |
+| @dagrejs/dagre | 3.0.0 | MIT |
+| @dagrejs/graphlib | 4.0.1 | MIT |
| @standard-schema/spec | 1.1.0 | MIT |
| @types/d3-timer | 2.0.3 | MIT |
| commander | 7.2.0 | MIT |
@@ -83,17 +85,14 @@ The Apache Software Foundation (http://www.apache.org/).
| d3-tip | 0.9.1 | MIT |
| d3-transition | 3.0.1 | ISC |
| d3-zoom | 3.0.0 | ISC |
-| dagre | 0.8.5 | MIT |
| date-fns | 2.30.0 | MIT |
| delaunator | 5.1.0 | ISC |
| detect-browser | 5.3.0 | MIT |
| entities | 8.0.0 | BSD-2-Clause |
| fecha | 4.2.3 | MIT |
| gl-matrix | 3.4.4 | MIT |
-| graphlib | 2.1.8 | MIT |
| iconv-lite | 0.6.3 | MIT |
| internmap | 2.0.3 | ISC |
-| lodash | 4.18.1 | MIT |
| monaco-editor | 0.31.1 | MIT |
| ng-zorro-antd | 21.3.2 | MIT |
| parse5 | 8.0.1 | MIT |
@@ -593,6 +592,52 @@ The above copyright notice and this permission notice
shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+---
+@dagrejs/[email protected]
+---
+Copyright (c) 2012-2014 Chris Pettitt
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the
"Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+---
+@dagrejs/[email protected]
+---
+Copyright (c) 2012-2014 Chris Pettitt
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the
"Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
---
@standard-schema/[email protected]
---
@@ -1634,29 +1679,6 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
----
[email protected]
----
-Copyright (c) 2012-2014 Chris Pettitt
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the
"Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
---
[email protected]
---
@@ -1789,29 +1811,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
----
[email protected]
----
-Copyright (c) 2012-2014 Chris Pettitt
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the
"Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
---
[email protected]
---
@@ -1854,57 +1853,6 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
----
[email protected]
----
-Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
-
-Based on Underscore.js, copyright Jeremy Ashkenas,
-DocumentCloud and Investigative Reporters & Editors
<http://underscorejs.org/>
-
-This software consists of voluntary contributions made by many
-individuals. For exact contribution history, see the revision history
-available at https://github.com/lodash/lodash
-
-The following license applies to all parts of this software except as
-documented below:
-
-====
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-====
-
-Copyright and related rights for sample code are waived via CC0. Sample
-code is defined as all source code displayed within the prose of the
-documentation.
-
-CC0: http://creativecommons.org/publicdomain/zero/1.0/
-
-====
-
-Files located in the node_modules and vendor directories are externally
-maintained libraries used by this software which have their own
-licenses; we recommend you read them, as their terms may differ from the
-terms above.
-
---
[email protected]
---
diff --git a/flink-runtime-web/web-dashboard/angular.json
b/flink-runtime-web/web-dashboard/angular.json
index c8926afd80c..48bec4fcff2 100644
--- a/flink-runtime-web/web-dashboard/angular.json
+++ b/flink-runtime-web/web-dashboard/angular.json
@@ -35,9 +35,6 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
- "allowedCommonJsDependencies": [
- "dagre"
- ],
"outputPath": "web",
"index": "src/index.html",
"main": "src/main.ts",
diff --git a/flink-runtime-web/web-dashboard/package-lock.json
b/flink-runtime-web/web-dashboard/package-lock.json
index 2284849fbc6..04ffe6206f5 100644
--- a/flink-runtime-web/web-dashboard/package-lock.json
+++ b/flink-runtime-web/web-dashboard/package-lock.json
@@ -17,11 +17,11 @@
"@angular/platform-browser-dynamic": "^21.2.17",
"@angular/router": "^21.2.17",
"@antv/g2": "^4.2.12",
+ "@dagrejs/dagre": "^3.0.0",
"core-js": "^3.49.0",
"d3": "^7.9.0",
"d3-flame-graph": "^4.1.3",
"d3-tip": "^0.9.1",
- "dagre": "^0.8.5",
"monaco-editor": "^0.31.1",
"ng-zorro-antd": "^21.3.2",
"rxjs": "^7.5.7",
@@ -39,7 +39,6 @@
"@angular/cli": "^21.2.17",
"@angular/compiler-cli": "^21.2.17",
"@types/d3": "^7.4.3",
- "@types/dagre": "^0.7.54",
"@types/jasmine": "~3.10.19",
"@types/jasminewd2": "~2.0.13",
"@types/node": "^22.16.0",
@@ -3680,6 +3679,21 @@
"node": ">=10"
}
},
+ "node_modules/@dagrejs/dagre": {
+ "version": "3.0.0",
+ "resolved":
"https://registry.npmjs.org/@dagrejs/dagre/-/dagre-3.0.0.tgz",
+ "integrity":
"sha512-ZzhnTy1rfuoew9Ez3EIw4L2znPGnYYhfn8vc9c4oB8iw6QAsszbiU0vRhlxWPFnmmNSFAkrYeF1PhM5m4lAN0Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@dagrejs/graphlib": "4.0.1"
+ }
+ },
+ "node_modules/@dagrejs/graphlib": {
+ "version": "4.0.1",
+ "resolved":
"https://registry.npmjs.org/@dagrejs/graphlib/-/graphlib-4.0.1.tgz",
+ "integrity":
"sha512-IvcV6FduIIAmLwnH+yun+QtV36SC7mERqa86aClNqmMN09WhmPPYU8ckHrZBozErf+UvHPWOTJYaGYiIcs0DgA==",
+ "license": "MIT"
+ },
"node_modules/@discoveryjs/json-ext": {
"version": "0.6.3",
"resolved":
"https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.6.3.tgz",
@@ -7708,13 +7722,6 @@
"@types/d3-selection": "*"
}
},
- "node_modules/@types/dagre": {
- "version": "0.7.54",
- "resolved": "https://registry.npmjs.org/@types/dagre/-/dagre-0.7.54.tgz",
- "integrity":
"sha512-QjcRY+adGbYvBFS7cwv5txhVIwX1XXIUswWl+kSQTbI6NjgZydrZkEKX/etzVd7i+bCsCb40Z/xlBY5eoFuvWQ==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/@types/eslint": {
"version": "9.6.1",
"resolved":
"https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz",
@@ -10519,16 +10526,6 @@
"node": ">=12"
}
},
- "node_modules/dagre": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz",
- "integrity":
"sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==",
- "license": "MIT",
- "dependencies": {
- "graphlib": "^2.1.8",
- "lodash": "^4.17.15"
- }
- },
"node_modules/data-view-buffer": {
"version": "1.0.2",
"resolved":
"https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
@@ -12630,15 +12627,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/graphlib": {
- "version": "2.1.8",
- "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz",
- "integrity":
"sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==",
- "license": "MIT",
- "dependencies": {
- "lodash": "^4.17.15"
- }
- },
"node_modules/handle-thing": {
"version": "2.0.1",
"resolved":
"https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz",
@@ -14393,12 +14381,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/lodash": {
- "version": "4.18.1",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
- "integrity":
"sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
- "license": "MIT"
- },
"node_modules/lodash.debounce": {
"version": "4.0.8",
"resolved":
"https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
diff --git a/flink-runtime-web/web-dashboard/package.json
b/flink-runtime-web/web-dashboard/package.json
index d310d59737c..a438dc0d120 100644
--- a/flink-runtime-web/web-dashboard/package.json
+++ b/flink-runtime-web/web-dashboard/package.json
@@ -20,11 +20,11 @@
"@angular/platform-browser-dynamic": "^21.2.17",
"@angular/router": "^21.2.17",
"@antv/g2": "^4.2.12",
+ "@dagrejs/dagre": "^3.0.0",
"core-js": "^3.49.0",
"d3": "^7.9.0",
"d3-flame-graph": "^4.1.3",
"d3-tip": "^0.9.1",
- "dagre": "^0.8.5",
"monaco-editor": "^0.31.1",
"ng-zorro-antd": "^21.3.2",
"rxjs": "^7.5.7",
@@ -42,7 +42,6 @@
"@angular/cli": "^21.2.17",
"@angular/compiler-cli": "^21.2.17",
"@types/d3": "^7.4.3",
- "@types/dagre": "^0.7.54",
"@types/jasmine": "~3.10.19",
"@types/jasminewd2": "~2.0.13",
"@types/node": "^22.16.0",
diff --git a/flink-runtime-web/web-dashboard/src/app/components/dagre/graph.ts
b/flink-runtime-web/web-dashboard/src/app/components/dagre/graph.ts
index 3d0e6da83fb..188c5339c99 100644
--- a/flink-runtime-web/web-dashboard/src/app/components/dagre/graph.ts
+++ b/flink-runtime-web/web-dashboard/src/app/components/dagre/graph.ts
@@ -16,10 +16,9 @@
* limitations under the License.
*/
+import { EdgeLabel, graphlib, layout } from '@dagrejs/dagre';
import { NodesItemCorrect, NodesItemLink } from
'@flink-runtime-web/interfaces';
import { curveLinear, line } from 'd3';
-import * as dagre from 'dagre';
-import { GraphEdge, graphlib } from 'dagre';
import Graph = graphlib.Graph;
@@ -91,7 +90,7 @@ export class NzGraph {
* @param opt
*/
createGraph(opt: CreateGraphOpt = {}): void {
- this.graph = new dagre.graphlib.Graph(opt);
+ this.graph = new graphlib.Graph(opt);
this.graph.setGraph({
rankdir: 'LR',
...this.config
@@ -144,7 +143,7 @@ export class NzGraph {
this.layoutLinks = [];
this.copyLayoutLinks = [];
- dagre.layout(this.graph);
+ layout(this.graph);
const generatedGraph = this.graph.graph();
if (generatedGraph.width! < generatedGraph.height!) {
this.graph.setGraph({
@@ -156,7 +155,7 @@ export class NzGraph {
edge.height = edge.width;
edge.width = null;
});
- dagre.layout(this.graph);
+ layout(this.graph);
}
this.graph.nodes().forEach(id => {
@@ -175,7 +174,7 @@ export class NzGraph {
});
this.graph.edges().forEach(e => {
- const edge = this.graph.edge(e) as LayoutLink & GraphEdge;
+ const edge = this.graph.edge(e) as LayoutLink & EdgeLabel;
const initLine = this.generateLine(edge.points) as string;
const link: LayoutLink = {
id: edge.id,
@@ -205,9 +204,10 @@ export class NzGraph {
*
* @param edge
*/
- getDominantBaseline(edge: GraphEdge): string {
- const firstPoint = edge.points[0];
- const lastPoint = edge.points[edge.points.length - 1];
+ getDominantBaseline(edge: EdgeLabel): string {
+ const points = edge.points!;
+ const firstPoint = points[0];
+ const lastPoint = points[points.length - 1];
return lastPoint.x < firstPoint.x ? 'rtl' : 'ltr';
}