You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sc...@apache.org on 2018/02/20 21:28:26 UTC
[4/5] nifi git commit: NIFI-3502: - Upgrading to D3 version 4.
NIFI-3502:
- Upgrading to D3 version 4.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/9cd631f9
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/9cd631f9
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/9cd631f9
Branch: refs/heads/master
Commit: 9cd631f963a0df85ed03ca046780bb762626d848
Parents: 91e98aa
Author: Matt Gilman <ma...@gmail.com>
Authored: Wed Feb 7 08:36:34 2018 -0500
Committer: Scott Aslan <sc...@gmail.com>
Committed: Tue Feb 20 14:51:44 2018 -0500
----------------------------------------------------------------------
nifi-assembly/LICENSE | 31 ++
.../src/main/resources/META-INF/LICENSE | 31 ++
.../nifi-framework/nifi-web/nifi-web-ui/pom.xml | 6 +-
.../nifi-web-ui/src/main/frontend/package.json | 3 +-
.../src/main/resources/META-INF/LICENSE | 31 ++
.../src/main/webapp/WEB-INF/pages/canvas.jsp | 3 +-
.../main/webapp/WEB-INF/pages/provenance.jsp | 3 +-
.../src/main/webapp/WEB-INF/pages/summary.jsp | 1 -
.../src/main/webapp/WEB-INF/pages/users.jsp | 1 -
.../nifi-web-ui/src/main/webapp/css/graph.css | 2 +-
.../src/main/webapp/css/navigation.css | 2 +-
.../src/main/webapp/css/status-history.css | 2 +-
.../nf-ng-canvas-navigate-controller.js | 42 +-
.../nf-ng-canvas-toolbox-controller.js | 4 +-
.../components/nf-ng-processor-component.js | 2 +-
.../src/main/webapp/js/nf/canvas/nf-actions.js | 11 +-
.../src/main/webapp/js/nf/canvas/nf-birdseye.js | 41 +-
.../main/webapp/js/nf/canvas/nf-canvas-utils.js | 57 ++-
.../src/main/webapp/js/nf/canvas/nf-canvas.js | 410 ++++++++++---------
.../main/webapp/js/nf/canvas/nf-connectable.js | 14 +-
.../main/webapp/js/nf/canvas/nf-connection.js | 189 +++++----
.../js/nf/canvas/nf-controller-service.js | 6 +-
.../js/nf/canvas/nf-controller-services.js | 4 +-
.../main/webapp/js/nf/canvas/nf-draggable.js | 12 +-
.../src/main/webapp/js/nf/canvas/nf-funnel.js | 38 +-
.../src/main/webapp/js/nf/canvas/nf-graph.js | 4 +-
.../src/main/webapp/js/nf/canvas/nf-label.js | 56 ++-
.../src/main/webapp/js/nf/canvas/nf-port.js | 62 +--
.../webapp/js/nf/canvas/nf-process-group.js | 173 ++++----
.../main/webapp/js/nf/canvas/nf-processor.js | 128 +++---
.../js/nf/canvas/nf-remote-process-group.js | 100 +++--
.../src/main/webapp/js/nf/canvas/nf-settings.js | 4 +-
.../webapp/js/nf/canvas/nf-variable-registry.js | 2 +-
.../src/main/webapp/js/nf/nf-status-history.js | 259 +++++-------
.../js/nf/provenance/nf-provenance-lineage.js | 106 ++---
.../js/nf/provenance/nf-provenance-table.js | 2 +-
36 files changed, 982 insertions(+), 860 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-assembly/LICENSE
----------------------------------------------------------------------
diff --git a/nifi-assembly/LICENSE b/nifi-assembly/LICENSE
index 0edf519..69a03dc 100644
--- a/nifi-assembly/LICENSE
+++ b/nifi-assembly/LICENSE
@@ -234,6 +234,37 @@ The source is available under an MIT LICENSE.
This product bundles 'Javascript D3 Library' which is available under a
"3-clause BSD" license.
+ Copyright 2010-2017 Mike Bostock
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This product bundles 'Javascript D3 Selection Multi Library' which is available under a
+"3-clause BSD" license.
+
Copyright (c) 2010-2016, Michael Bostock
All rights reserved.
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/src/main/resources/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/src/main/resources/META-INF/LICENSE b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/src/main/resources/META-INF/LICENSE
index 78eb4c1..e72b324 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/src/main/resources/META-INF/LICENSE
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/src/main/resources/META-INF/LICENSE
@@ -263,6 +263,37 @@ licenses.
This product bundles 'Javascript D3 Library' which is available under a
"3-clause BSD" license.
+ Copyright 2010-2017 Mike Bostock
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This product bundles 'Javascript D3 Selection Multi Library' which is available under a
+"3-clause BSD" license.
+
Copyright (c) 2010-2016, Michael Bostock
All rights reserved.
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
index c88a851..699e55d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
@@ -151,8 +151,11 @@
<filtering>false</filtering>
<includes>
<!-- D3 -->
- <include>d3/d3.min.js*</include>
+ <include>d3/build/d3.min.js*</include>
<include>d3/LICENSE</include>
+ <!-- D3 selection multi -->
+ <include>d3-selection-multi/build/d3-selection-multi.min.js*</include>
+ <include>d3-selection-multi/LICENSE</include>
<!-- angular -->
<include>angular/angular.min.js*</include>
<include>angular/LICENSE.md</include>
@@ -895,7 +898,6 @@
<exclude>nbactions.xml</exclude>
<exclude>src/main/frontend/package.json</exclude>
<exclude>src/main/webapp/js/jquery/jquery.base64.js</exclude>
- <exclude>src/main/webapp/js/d3/d3.min.js</exclude>
<exclude>src/main/webapp/js/codemirror/</exclude>
<exclude>src/main/webapp/fonts/**/*</exclude>
</excludes>
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/frontend/package.json
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/frontend/package.json b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/frontend/package.json
index 4e56011..9670209 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/frontend/package.json
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/frontend/package.json
@@ -14,7 +14,8 @@
"jsonlint": "1.6.2",
"JSON2": "0.1.0",
"reset.css": "2.0.2",
- "d3": "3.5.17",
+ "d3": "4.13.0",
+ "d3-selection-multi": "1.0.1",
"url-search-params": "0.6.1"
},
"description": "Apache NiFi 3rd party client side resources.",
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/META-INF/LICENSE b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/META-INF/LICENSE
index 6d29fb0..2aced50 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/META-INF/LICENSE
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/META-INF/LICENSE
@@ -211,6 +211,37 @@ licenses.
This product bundles 'Javascript D3 Library' which is available under a
"3-clause BSD" license.
+ Copyright 2010-2017 Mike Bostock
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This product bundles 'Javascript D3 Selection Multi Library' which is available under a
+"3-clause BSD" license.
+
Copyright (c) 2010-2016, Michael Bostock
All rights reserved.
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp
index 52fc43c..0d14cd2 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp
@@ -46,7 +46,8 @@
</script>
<script type="text/javascript" src="assets/url-search-params/build/url-search-params.js"></script>
<script type="text/javascript" src="js/codemirror/lib/codemirror-compressed.js"></script>
- <script type="text/javascript" src="assets/d3/d3.min.js"></script>
+ <script type="text/javascript" src="assets/d3/build/d3.min.js"></script>
+ <script type="text/javascript" src="assets/d3-selection-multi/build/d3-selection-multi.min.js"></script>
<script type="text/javascript" src="assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="assets/jquery-ui-dist/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.base64.js"></script>
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp
index b4eb6a0..d4bcccc 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp
@@ -33,7 +33,8 @@
<link rel="stylesheet" href="fonts/flowfont/flowfont.css" type="text/css" />
<link rel="stylesheet" href="assets/angular-material/angular-material.min.css" type="text/css" />
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css" type="text/css" />
- <script type="text/javascript" src="assets/d3/d3.min.js"></script>
+ <script type="text/javascript" src="assets/d3/build/d3.min.js"></script>
+ <script type="text/javascript" src="assets/d3-selection-multi/build/d3-selection-multi.min.js"></script>
<script type="text/javascript" src="assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.base64.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script>
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp
index 1746e6b..cc5ae43 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp
@@ -39,7 +39,6 @@
<link rel="stylesheet" href="assets/angular-material/angular-material.min.css" type="text/css" />
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css" type="text/css" />
<script type="text/javascript" src="js/codemirror/lib/codemirror-compressed.js"></script>
- <script type="text/javascript" src="assets/d3/d3.min.js"></script>
<script type="text/javascript" src="assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="assets/jquery-ui-dist/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.base64.js"></script>
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp
index 42d0791..2444baa 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp
@@ -32,7 +32,6 @@
<link rel="stylesheet" href="css/slick-nifi-theme.css" type="text/css" />
<link rel="stylesheet" href="fonts/flowfont/flowfont.css" type="text/css" />
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css" type="text/css" />
- <script type="text/javascript" src="assets/d3/d3.min.js"></script>
<script type="text/javascript" src="assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="assets/jquery-ui-dist/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.base64.js"></script>
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css
index 4c77066..95fbbbd 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css
@@ -150,7 +150,7 @@ g.component.connectable-destination rect.border {
stroke-width: 3;
}
-rect.selection, rect.drag-selection, rect.label-drag {
+rect.component-selection, rect.drag-selection, rect.label-drag {
stroke: #444444;
stroke-opacity: 0.5;
fill: transparent;
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/navigation.css
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/navigation.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/navigation.css
index 17200d7..0c23683 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/navigation.css
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/navigation.css
@@ -225,7 +225,7 @@ div.button-spacer-large {
border: 1px solid #e5ebed;
}
-.brush .extent {
+.brush .selection {
stroke: #666;
fill-opacity: .125;
shape-rendering: crispEdges;
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/status-history.css
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/status-history.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/status-history.css
index e421f61..57a5baa 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/status-history.css
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/status-history.css
@@ -167,7 +167,7 @@ div.legend-label {
stroke-width: 2.5px;
}
-.brush .extent {
+.brush .selection {
stroke: #666;
fill-opacity: .125;
shape-rendering: crispEdges;
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js
index 46dc70f..4eb27a5 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js
@@ -44,66 +44,34 @@
* Zoom in on the canvas.
*/
this.zoomIn = function () {
- nfCanvasUtils.zoomCanvasViewIn();
-
- // hide the context menu
- nfContextMenu.hide();
-
- // refresh the canvas
- nfCanvasUtils.refreshCanvasView({
- transition: true
- });
+ nfCanvasUtils.zoomInCanvas();
};
/**
* Zoom out on the canvas.
*/
this.zoomOut = function () {
- nfCanvasUtils.zoomCanvasViewOut();
-
- // hide the context menu
- nfContextMenu.hide();
-
- // refresh the canvas
- nfCanvasUtils.refreshCanvasView({
- transition: true
- });
+ nfCanvasUtils.zoomOutCanvas();
};
/**
* Zoom fit on the canvas.
*/
this.zoomFit = function () {
- nfCanvasUtils.fitCanvasView();
-
- // hide the context menu
- nfContextMenu.hide();
-
- // refresh the canvas
- nfCanvasUtils.refreshCanvasView({
- transition: true
- });
+ nfCanvasUtils.fitCanvas();
};
/**
* Zoom actual size on the canvas.
*/
this.zoomActualSize = function () {
- nfCanvasUtils.actualSizeCanvasView();
-
- // hide the context menu
- nfContextMenu.hide();
-
- // refresh the canvas
- nfCanvasUtils.refreshCanvasView({
- transition: true
- });
+ nfCanvasUtils.actualSizeCanvas();
};
}
NavigateCtrl.prototype = {
constructor: NavigateCtrl
- }
+ };
var navigateCtrl = new NavigateCtrl();
return navigateCtrl;
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js
index f6b45f9..911063f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js
@@ -130,8 +130,8 @@
nfContextMenu.hide();
},
stop: function (e, ui) {
- var translate = nfCanvasUtils.translateCanvasView();
- var scale = nfCanvasUtils.scaleCanvasView();
+ var translate = nfCanvasUtils.getCanvasTranslate();
+ var scale = nfCanvasUtils.getCanvasScale();
var mouseX = e.originalEvent.pageX;
var mouseY = e.originalEvent.pageY - nfCanvasUtils.getCanvasOffset();
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js
index 3af00da..55adc4d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js
@@ -512,7 +512,7 @@
text: 'all groups',
value: ''
}];
- groups.forEach(function (group) {
+ groups.each(function (group) {
options.push({
text: group,
value: group
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
index 64b0eab..2b09d14 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
@@ -493,11 +493,6 @@
// center on the component
nfCanvasUtils.centerBoundingBox(box);
-
- // refresh the canvas
- nfCanvasUtils.refreshCanvasView({
- transition: true
- });
}
},
@@ -996,7 +991,7 @@
});
// remove all the non connections in the snippet first
- components.forEach(function (type, ids) {
+ components.each(function (ids, type) {
if (type !== 'Connection') {
nfCanvasUtils.getComponentByType(type).remove(ids);
}
@@ -1709,8 +1704,8 @@
paste: function (selection, evt) {
if (nfCommon.isDefinedAndNotNull(evt)) {
// get the current scale and translation
- var scale = nfCanvasUtils.scaleCanvasView();
- var translate = nfCanvasUtils.translateCanvasView();
+ var scale = nfCanvasUtils.getCanvasScale();
+ var translate = nfCanvasUtils.getCanvasTranslate();
var mouseX = evt.pageX;
var mouseY = evt.pageY - nfCanvasUtils.getCanvasOffset();
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
index 4355e05..6cacb7f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
@@ -53,8 +53,8 @@
// refreshes the birdseye
var refresh = function (components) {
- var translate = nfCanvasUtils.translateCanvasView();
- var scale = nfCanvasUtils.scaleCanvasView();
+ var translate = nfCanvasUtils.getCanvasTranslate();
+ var scale = nfCanvasUtils.getCanvasScale();
// scale the translation
translate = [translate[0] / scale, translate[1] / scale];
@@ -148,7 +148,7 @@
// update the brush
d3.select('rect.birdseye-brush')
- .attr({
+ .attrs({
'width': screenWidth,
'height': screenHeight,
'stroke-width': (2 / birdseyeScale),
@@ -272,17 +272,14 @@
.attr('pointer-events', 'none');
// define the brush drag behavior
- var brush = d3.behavior.drag()
- .origin(function (d) {
+ var brush = d3.drag()
+ .subject(function (d) {
return {
x: d.x,
- y: d.y
+ y: d.y,
+ source: 'birdseye'
};
})
- .on('dragstart', function () {
- // hide the context menu
- nfContextMenu.hide();
- })
.on('drag', function (d) {
d.x += d3.event.dx;
d.y += d3.event.dy;
@@ -291,25 +288,11 @@
d3.select(this).attr('transform', function () {
return 'translate(' + d.x + ', ' + d.y + ')';
});
- // get the current transformation
- var scale = nfCanvasUtils.scaleCanvasView();
- var translate = nfCanvasUtils.translateCanvasView();
-
- // update the translation according to the delta
- translate = [(-d3.event.dx * scale) + translate[0], (-d3.event.dy * scale) + translate[1]];
-
- // record the current transforms
- nfCanvasUtils.translateCanvasView(translate);
-
- // refresh the canvas
- nfCanvasUtils.refreshCanvasView({
- persist: false,
- transition: false,
- refreshComponents: false,
- refreshBirdseye: false
- });
+
+ // transform the canvas
+ nfCanvasUtils.translateCanvas([-d3.event.dx, -d3.event.dy]);
})
- .on('dragend', function () {
+ .on('end', function () {
// update component visibility
nfGraph.updateVisibility();
@@ -322,7 +305,7 @@
// context area
birdseyeGroup.append('g')
- .attr({
+ .attrs({
'pointer-events': 'all',
'class': 'birdseye-brush-container'
})
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
index 162da36..3dce37e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
@@ -115,7 +115,7 @@
});
// refresh all component types as necessary (handle components that have been removed)
- componentMap.forEach(function (type, ids) {
+ componentMap.each(function (ids, type) {
nfCanvasUtils.getComponentByType(type).remove(ids);
});
@@ -576,7 +576,10 @@
* @param {type} boundingBox
*/
centerBoundingBox: function (boundingBox) {
- var scale = nfCanvas.View.scale();
+ var scale = nfCanvas.View.getScale();
+ if (nfCommon.isDefinedAndNotNull(boundingBox.scale)) {
+ scale = boundingBox.scale;
+ }
// get the canvas normalized width and height
var canvasContainer = $('#canvas-container');
@@ -587,7 +590,7 @@
var center = [(screenWidth / 2) - (boundingBox.width / 2), (screenHeight / 2) - (boundingBox.height / 2)];
// calculate the difference between the center point and the position of this component and convert to screen space
- nfCanvas.View.translate([(center[0] - boundingBox.x) * scale, (center[1] - boundingBox.y) * scale]);
+ nfCanvas.View.transform([(center[0] - boundingBox.x) * scale, (center[1] - boundingBox.y) * scale], scale);
},
/**
@@ -701,7 +704,7 @@
var line = [];
var tspan = selection.append('tspan')
- .attr({
+ .attrs({
'x': x,
'y': y,
'width': width
@@ -726,7 +729,7 @@
// create the tspan for the next line
tspan = selection.append('tspan')
- .attr({
+ .attrs({
'x': x,
'dy': '1.2em',
'width': width
@@ -1560,9 +1563,9 @@
var name = config.storage.namePrefix + nfCanvas.getGroupId();
// create the item to store
- var translate = nfCanvas.View.translate();
+ var translate = nfCanvas.View.getTranslate();
var item = {
- scale: nfCanvas.View.scale(),
+ scale: nfCanvas.View.getScale(),
translateX: translate[0],
translateY: translate[1]
};
@@ -1652,13 +1655,7 @@
if (nfCommon.isDefinedAndNotNull(item)) {
if (isFinite(item.scale) && isFinite(item.translateX) && isFinite(item.translateY)) {
// restore previous view
- nfCanvas.View.translate([item.translateX, item.translateY]);
- nfCanvas.View.scale(item.scale);
-
- // refresh the canvas
- nfCanvas.View.refresh({
- transition: true
- });
+ nfCanvas.View.transform([item.translateX, item.translateY], item.scale);
// mark the view was restore
viewRestored = true;
@@ -1902,57 +1899,53 @@
},
/**
- * Refreshes the view based on the configured translation and scale.
- *
- * @param {object} options Options for the refresh operation
+ * Gets the current scale.
*/
- refreshCanvasView: function (options) {
- return nfCanvas.View.refresh(options);
+ getCanvasScale: function () {
+ return nfCanvas.View.getScale();
},
/**
- * Sets/gets the current scale.
- *
- * @param {number} scale The new scale
+ * Gets the current translation.
*/
- scaleCanvasView: function (scale) {
- return nfCanvas.View.scale(scale);
+ getCanvasTranslate: function () {
+ return nfCanvas.View.getTranslate();
},
/**
- * Sets/gets the current translation.
+ * Translate the canvas by the specified [x, y]
*
- * @param {array} translate [x, y]
+ * @param {array} translate [x, y] to translate by
*/
- translateCanvasView: function (translate) {
- return nfCanvas.View.translate(translate);
+ translateCanvas: function (translate) {
+ nfCanvas.View.translate(translate);
},
/**
* Zooms to fit the entire graph on the canvas.
*/
- fitCanvasView: function () {
+ fitCanvas: function () {
return nfCanvas.View.fit();
},
/**
* Zooms in a single zoom increment.
*/
- zoomCanvasViewIn: function () {
+ zoomInCanvas: function () {
return nfCanvas.View.zoomIn();
},
/**
* Zooms out a single zoom increment.
*/
- zoomCanvasViewOut: function () {
+ zoomOutCanvas: function () {
return nfCanvas.View.zoomOut();
},
/**
* Zooms to the actual size (1 to 1).
*/
- actualSizeCanvasView: function () {
+ actualSizeCanvas: function () {
return nfCanvas.View.actualSize();
},
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index 00dd4a8..3f72123 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -91,7 +91,6 @@
var canvas = null;
var canvasClicked = false;
- var panning = false;
var config = {
urls: {
@@ -305,7 +304,7 @@
defs.selectAll('marker')
.data(['normal', 'ghost', 'unauthorized', 'full'])
.enter().append('marker')
- .attr({
+ .attrs({
'id': function (d) {
return d;
},
@@ -332,7 +331,7 @@
// filter for drop shadow
var componentDropShadowFilter = defs.append('filter')
- .attr({
+ .attrs({
'id': 'component-drop-shadow',
'height': '140%',
'y': '-20%'
@@ -340,7 +339,7 @@
// blur
componentDropShadowFilter.append('feGaussianBlur')
- .attr({
+ .attrs({
'in': 'SourceAlpha',
'stdDeviation': 3,
'result': 'blur'
@@ -348,7 +347,7 @@
// offset
componentDropShadowFilter.append('feOffset')
- .attr({
+ .attrs({
'in': 'blur',
'dx': 0,
'dy': 1,
@@ -357,7 +356,7 @@
// color/opacity
componentDropShadowFilter.append('feFlood')
- .attr({
+ .attrs({
'flood-color': '#000000',
'flood-opacity': 0.4,
'result': 'offsetColor'
@@ -365,7 +364,7 @@
// combine
componentDropShadowFilter.append('feComposite')
- .attr({
+ .attrs({
'in': 'offsetColor',
'in2': 'offsetBlur',
'operator': 'in',
@@ -381,7 +380,7 @@
// filter for drop shadow
var connectionFullDropShadowFilter = defs.append('filter')
- .attr({
+ .attrs({
'id': 'connection-full-drop-shadow',
'height': '140%',
'y': '-20%'
@@ -389,7 +388,7 @@
// blur
connectionFullDropShadowFilter.append('feGaussianBlur')
- .attr({
+ .attrs({
'in': 'SourceAlpha',
'stdDeviation': 3,
'result': 'blur'
@@ -397,7 +396,7 @@
// offset
connectionFullDropShadowFilter.append('feOffset')
- .attr({
+ .attrs({
'in': 'blur',
'dx': 0,
'dy': 1,
@@ -406,7 +405,7 @@
// color/opacity
connectionFullDropShadowFilter.append('feFlood')
- .attr({
+ .attrs({
'flood-color': '#ba554a',
'flood-opacity': 1,
'result': 'offsetColor'
@@ -414,7 +413,7 @@
// combine
connectionFullDropShadowFilter.append('feComposite')
- .attr({
+ .attrs({
'in': 'offsetColor',
'in2': 'offsetBlur',
'operator': 'in',
@@ -430,7 +429,7 @@
// create the canvas element
canvas = svg.append('g')
- .attr({
+ .attrs({
'transform': 'translate(' + TRANSLATE + ') scale(' + SCALE + ')',
'pointer-events': 'all',
'id': 'canvas'
@@ -455,14 +454,14 @@
.attr('ry', 6)
.attr('x', position[0])
.attr('y', position[1])
- .attr('class', 'selection')
+ .attr('class', 'component-selection')
.attr('width', 0)
.attr('height', 0)
.attr('stroke-width', function () {
- return 1 / nfCanvas.View.scale();
+ return 1 / nfCanvas.View.getScale();
})
.attr('stroke-dasharray', function () {
- return 4 / nfCanvas.View.scale();
+ return 4 / nfCanvas.View.getScale();
})
.datum(position);
@@ -474,106 +473,100 @@
d3.event.preventDefault();
}
})
- .on('mousemove.selection', function () {
- // update selection box if shift is held down
- if (d3.event.shiftKey) {
- // get the selection box
- var selectionBox = d3.select('rect.selection');
- if (!selectionBox.empty()) {
- // get the original position
- var originalPosition = selectionBox.datum();
- var position = d3.mouse(canvas.node());
-
- var d = {};
- if (originalPosition[0] < position[0]) {
- d.x = originalPosition[0];
- d.width = position[0] - originalPosition[0];
- } else {
- d.x = position[0];
- d.width = originalPosition[0] - position[0];
- }
+ .on('mousemove.selection', function () {
+ // update selection box if shift is held down
+ if (d3.event.shiftKey) {
+ // get the selection box
+ var selectionBox = d3.select('rect.component-selection');
+ if (!selectionBox.empty()) {
+ // get the original position
+ var originalPosition = selectionBox.datum();
+ var position = d3.mouse(canvas.node());
+
+ var d = {};
+ if (originalPosition[0] < position[0]) {
+ d.x = originalPosition[0];
+ d.width = position[0] - originalPosition[0];
+ } else {
+ d.x = position[0];
+ d.width = originalPosition[0] - position[0];
+ }
- if (originalPosition[1] < position[1]) {
- d.y = originalPosition[1];
- d.height = position[1] - originalPosition[1];
- } else {
- d.y = position[1];
- d.height = originalPosition[1] - position[1];
- }
+ if (originalPosition[1] < position[1]) {
+ d.y = originalPosition[1];
+ d.height = position[1] - originalPosition[1];
+ } else {
+ d.y = position[1];
+ d.height = originalPosition[1] - position[1];
+ }
- // update the selection box
- selectionBox.attr(d);
+ // update the selection box
+ selectionBox.attrs(d);
- // prevent further propagation (to parents)
- d3.event.stopPropagation();
- }
- }
- })
- .on('mouseup.selection', function () {
- // ensure this originated from clicking the canvas, not a component.
- // when clicking on a component, the event propagation is stopped so
- // it never reaches the canvas. we cannot do this however on up events
- // since the drag events break down
- if (canvasClicked === false) {
- return;
+ // prevent further propagation (to parents)
+ d3.event.stopPropagation();
}
+ }
+ })
+ .on('mouseup.selection', function () {
+ // ensure this originated from clicking the canvas, not a component.
+ // when clicking on a component, the event propagation is stopped so
+ // it never reaches the canvas. we cannot do this however on up events
+ // since the drag events break down
+ if (canvasClicked === false) {
+ return;
+ }
- // reset the canvas click flag
- canvasClicked = false;
+ // reset the canvas click flag
+ canvasClicked = false;
+
+ // get the selection box
+ var selectionBox = d3.select('rect.component-selection');
+ if (!selectionBox.empty()) {
+ var selectionBoundingBox = {
+ x: parseInt(selectionBox.attr('x'), 10),
+ y: parseInt(selectionBox.attr('y'), 10),
+ width: parseInt(selectionBox.attr('width'), 10),
+ height: parseInt(selectionBox.attr('height'), 10)
+ };
+
+ // see if a component should be selected or not
+ d3.selectAll('g.component').classed('selected', function (d) {
+ // consider it selected if its already selected or enclosed in the bounding box
+ return d3.select(this).classed('selected') ||
+ d.position.x >= selectionBoundingBox.x && (d.position.x + d.dimensions.width) <= (selectionBoundingBox.x + selectionBoundingBox.width) &&
+ d.position.y >= selectionBoundingBox.y && (d.position.y + d.dimensions.height) <= (selectionBoundingBox.y + selectionBoundingBox.height);
+ });
- // get the selection box
- var selectionBox = d3.select('rect.selection');
- if (!selectionBox.empty()) {
- var selectionBoundingBox = {
- x: parseInt(selectionBox.attr('x'), 10),
- y: parseInt(selectionBox.attr('y'), 10),
- width: parseInt(selectionBox.attr('width'), 10),
- height: parseInt(selectionBox.attr('height'), 10)
- };
+ // see if a connection should be selected or not
+ d3.selectAll('g.connection').classed('selected', function (d) {
+ // consider all points
+ var points = [d.start].concat(d.bends, [d.end]);
- // see if a component should be selected or not
- d3.selectAll('g.component').classed('selected', function (d) {
- // consider it selected if its already selected or enclosed in the bounding box
- return d3.select(this).classed('selected') ||
- d.position.x >= selectionBoundingBox.x && (d.position.x + d.dimensions.width) <= (selectionBoundingBox.x + selectionBoundingBox.width) &&
- d.position.y >= selectionBoundingBox.y && (d.position.y + d.dimensions.height) <= (selectionBoundingBox.y + selectionBoundingBox.height);
+ // determine the bounding box
+ var x = d3.extent(points, function (pt) {
+ return pt.x;
});
-
- // see if a connection should be selected or not
- d3.selectAll('g.connection').classed('selected', function (d) {
- // consider all points
- var points = [d.start].concat(d.bends, [d.end]);
-
- // determine the bounding box
- var x = d3.extent(points, function (pt) {
- return pt.x;
- });
- var y = d3.extent(points, function (pt) {
- return pt.y;
- });
-
- // consider it selected if its already selected or enclosed in the bounding box
- return d3.select(this).classed('selected') ||
- x[0] >= selectionBoundingBox.x && x[1] <= (selectionBoundingBox.x + selectionBoundingBox.width) &&
- y[0] >= selectionBoundingBox.y && y[1] <= (selectionBoundingBox.y + selectionBoundingBox.height);
+ var y = d3.extent(points, function (pt) {
+ return pt.y;
});
- // remove the selection box
- selectionBox.remove();
+ // consider it selected if its already selected or enclosed in the bounding box
+ return d3.select(this).classed('selected') ||
+ x[0] >= selectionBoundingBox.x && x[1] <= (selectionBoundingBox.x + selectionBoundingBox.width) &&
+ y[0] >= selectionBoundingBox.y && y[1] <= (selectionBoundingBox.y + selectionBoundingBox.height);
+ });
- // update URL deep linking params
- nfCanvasUtils.setURLParameters();
- } else if (panning === false) {
- // deselect as necessary if we are not panning
- nfCanvasUtils.getSelection().classed('selected', false);
+ // remove the selection box
+ selectionBox.remove();
- // update URL deep linking params
- nfCanvasUtils.setURLParameters();
- }
+ // update URL deep linking params
+ nfCanvasUtils.setURLParameters();
+ }
- // inform Angular app values have changed
- nfNgBridge.digest();
- });
+ // inform Angular app values have changed
+ nfNgBridge.digest();
+ });
// define a function for update the graph dimensions
var updateGraphSize = function () {
@@ -594,7 +587,7 @@
'height': canvasHeight + 'px',
'bottom': bottom + 'px'
});
- svg.attr({
+ svg.attrs({
'height': canvasContainer.height(),
'width': $(window).width()
});
@@ -972,22 +965,63 @@
// initialize the zoom behavior
var behavior;
+ var x = 0, y = 0, k = SCALE;
return {
+
init: function () {
var refreshed;
+
var zoomed = false;
+ var panning = false;
+
+ // filters zoom events as programmatically modifying the translate or scale now triggers the handlers
+ var isBirdseyeEvent = function(sourceEvent) {
+ if (nfCommon.isDefinedAndNotNull(sourceEvent)) {
+ if (nfCommon.isDefinedAndNotNull(sourceEvent.subject)) {
+ return sourceEvent.subject.source === 'birdseye';
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ };
+
+ // see if the scale has changed during this zoom event,
+ // we want to only transition when zooming in/out as running
+ // the transitions during pan events is undesirable
+ var shouldTransition = function(sourceEvent) {
+ if (nfCommon.isDefinedAndNotNull(sourceEvent)) {
+ if (isBirdseyeEvent(sourceEvent)) {
+ return false;
+ }
+
+ return sourceEvent.type === 'wheel' || sourceEvent.type === 'mousewheel';
+ } else {
+ return true;
+ }
+ };
// define the behavior
- behavior = d3.behavior.zoom()
+ behavior = d3.zoom()
.scaleExtent([MIN_SCALE, MAX_SCALE])
- .translate(TRANSLATE)
- .scale(SCALE)
- .on('zoomstart', function () {
+ .on('start', function () {
// hide the context menu
nfContextMenu.hide();
})
.on('zoom', function () {
+ // update the current translation and scale
+ if (!isNaN(d3.event.transform.x)) {
+ x = d3.event.transform.x;
+ }
+ if (!isNaN(d3.event.transform.y)) {
+ y = d3.event.transform.y;
+ }
+ if (!isNaN(d3.event.transform.k)) {
+ k = d3.event.transform.k;
+ }
+
// if we have zoomed, indicate that we are panning
// to prevent deselection elsewhere
if (zoomed) {
@@ -996,34 +1030,39 @@
zoomed = true;
}
- // see if the scale has changed during this zoom event,
- // we want to only transition when zooming in/out as running
- // the transitions during pan events is
- var transition = d3.event.sourceEvent.type === 'wheel' || d3.event.sourceEvent.type === 'mousewheel';
-
// refresh the canvas
refreshed = nfCanvas.View.refresh({
persist: false,
- transition: transition,
+ transition: shouldTransition(d3.event.sourceEvent),
refreshComponents: false,
refreshBirdseye: false
});
})
- .on('zoomend', function () {
- // ensure the canvas was actually refreshed
- if (nfCommon.isDefinedAndNotNull(refreshed)) {
- nfGraph.updateVisibility();
-
- // refresh the birdseye
- refreshed.done(function () {
- nfBirdseye.refresh();
- });
+ .on('end', function () {
+ if (!isBirdseyeEvent(d3.event.sourceEvent)) {
+ // ensure the canvas was actually refreshed
+ if (nfCommon.isDefinedAndNotNull(refreshed)) {
+ nfGraph.updateVisibility();
+
+ // refresh the birdseye
+ refreshed.done(function () {
+ nfBirdseye.refresh();
+ });
- // persist the users view
- nfCanvasUtils.persistUserView();
+ // persist the users view
+ nfCanvasUtils.persistUserView();
- // reset the refreshed deferred
- refreshed = null;
+ // reset the refreshed deferred
+ refreshed = null;
+ }
+
+ if (panning === false) {
+ // deselect as necessary if we are not panning
+ nfCanvasUtils.getSelection().classed('selected', false);
+
+ // update URL deep linking params
+ nfCanvasUtils.setURLParameters();
+ }
}
panning = false;
@@ -1040,91 +1079,71 @@
* @returns {Boolean}
*/
shouldRenderPerScale: function () {
- return nfCanvas.View.scale() >= MIN_SCALE_TO_RENDER;
+ return nfCanvas.View.getScale() >= MIN_SCALE_TO_RENDER;
},
/**
- * Sets/gets the current translation.
+ * Translates by the specified [x, y].
*
- * @param {array} translate [x, y]
+ * @param {array} translate [x, y] to translate by
*/
translate: function (translate) {
- if (nfCommon.isUndefined(translate)) {
- return behavior.translate();
- } else {
- behavior.translate(translate);
- }
+ behavior.translateBy(svg, translate[0], translate[1]);
},
/**
- * Sets/gets the current scale.
+ * Scales by the specified scale.
*
- * @param {number} scale The new scale
+ * @param {number} scale The factor to scale by
*/
scale: function (scale) {
- if (nfCommon.isUndefined(scale)) {
- return behavior.scale();
- } else {
- behavior.scale(scale);
- }
+ behavior.scaleBy(svg, scale);
},
/**
- * Zooms in a single zoom increment.
+ * Sets the current transform.
+ *
+ * @param translate
+ * @param scale
*/
- zoomIn: function () {
- var translate = nfCanvas.View.translate();
- var scale = nfCanvas.View.scale();
- var newScale = Math.min(scale * INCREMENT, MAX_SCALE);
+ transform: function (translate, scale) {
+ behavior.transform(svg, d3.zoomIdentity.translate(translate[0], translate[1]).scale(scale));
+ },
- // get the canvas normalized width and height
- var canvasContainer = $('#canvas-container');
- var screenWidth = canvasContainer.width() / scale;
- var screenHeight = canvasContainer.height() / scale;
+ /**
+ * Gets the current translate.
+ */
+ getTranslate: function () {
+ return [x, y];
+ },
- // adjust the scale
- nfCanvas.View.scale(newScale);
+ /**
+ * Gets the current scale.
+ */
+ getScale: function () {
+ return k;
+ },
- // center around the center of the screen accounting for the translation accordingly
- nfCanvasUtils.centerBoundingBox({
- x: (screenWidth / 2) - (translate[0] / scale),
- y: (screenHeight / 2) - (translate[1] / scale),
- width: 1,
- height: 1
- });
+ /**
+ * Zooms in a single zoom increment.
+ */
+ zoomIn: function () {
+ nfCanvas.View.scale(INCREMENT);
},
/**
* Zooms out a single zoom increment.
*/
zoomOut: function () {
- var translate = nfCanvas.View.translate();
- var scale = nfCanvas.View.scale();
- var newScale = Math.max(scale / INCREMENT, MIN_SCALE);
-
- // get the canvas normalized width and height
- var canvasContainer = $('#canvas-container');
- var screenWidth = canvasContainer.width() / scale;
- var screenHeight = canvasContainer.height() / scale;
-
- // adjust the scale
- nfCanvas.View.scale(newScale);
-
- // center around the center of the screen accounting for the translation accordingly
- nfCanvasUtils.centerBoundingBox({
- x: (screenWidth / 2) - (translate[0] / scale),
- y: (screenHeight / 2) - (translate[1] / scale),
- width: 1,
- height: 1
- });
+ nfCanvas.View.scale(1 / INCREMENT);
},
/**
* Zooms to fit the entire graph on the canvas.
*/
fit: function () {
- var translate = nfCanvas.View.translate();
- var scale = nfCanvas.View.scale();
+ var translate = nfCanvas.View.getTranslate();
+ var scale = nfCanvas.View.getScale();
var newScale;
// get the canvas normalized width and height
@@ -1139,7 +1158,6 @@
var graphLeft = graphBox.left / scale;
var graphTop = (graphBox.top - nfCanvas.CANVAS_OFFSET) / scale;
-
// adjust the scale to ensure the entire graph is visible
if (graphWidth > canvasWidth || graphHeight > canvasHeight) {
newScale = Math.min(canvasWidth / graphWidth, canvasHeight / graphHeight);
@@ -1154,15 +1172,13 @@
graphTop -= 50;
}
- // set the new scale
- nfCanvas.View.scale(newScale);
-
// center as appropriate
nfCanvasUtils.centerBoundingBox({
x: graphLeft - (translate[0] / scale),
y: graphTop - (translate[1] / scale),
width: canvasWidth / newScale,
- height: canvasHeight / newScale
+ height: canvasHeight / newScale,
+ scale: newScale
});
},
@@ -1170,15 +1186,12 @@
* Zooms to the actual size (1 to 1).
*/
actualSize: function () {
- var translate = nfCanvas.View.translate();
- var scale = nfCanvas.View.scale();
+ var translate = nfCanvas.View.getTranslate();
+ var scale = nfCanvas.View.getScale();
// get the first selected component
var selection = nfCanvasUtils.getSelection();
- // set the updated scale
- nfCanvas.View.scale(1);
-
// box to zoom towards
var box;
@@ -1192,7 +1205,8 @@
x: (selectionBox.left / scale) - (translate[0] / scale),
y: ((selectionBox.top - nfCanvas.CANVAS_OFFSET) / scale) - (translate[1] / scale),
width: selectionBox.width / scale,
- height: selectionBox.height / scale
+ height: selectionBox.height / scale,
+ scale: 1
};
} else {
// get the offset
@@ -1207,7 +1221,8 @@
x: (screenWidth / 2) - (translate[0] / scale),
y: (screenHeight / 2) - (translate[1] / scale),
width: 1,
- height: 1
+ height: 1,
+ scale: 1
};
}
@@ -1246,14 +1261,17 @@
nfCanvasUtils.persistUserView();
}
+ var t = nfCanvas.View.getTranslate();
+ var s = nfCanvas.View.getScale();
+
// update the canvas
if (transition === true) {
canvas.transition()
.duration(500)
.attr('transform', function () {
- return 'translate(' + behavior.translate() + ') scale(' + behavior.scale() + ')';
+ return 'translate(' + t + ') scale(' + s + ')';
})
- .each('end', function () {
+ .on('end', function () {
// refresh birdseye if appropriate
if (refreshBirdseye === true) {
nfBirdseye.refresh();
@@ -1263,7 +1281,7 @@
});
} else {
canvas.attr('transform', function () {
- return 'translate(' + behavior.translate() + ') scale(' + behavior.scale() + ')';
+ return 'translate(' + t + ') scale(' + s + ')';
});
// refresh birdseye if appropriate
http://git-wip-us.apache.org/repos/asf/nifi/blob/9cd631f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
index 91d29f6..0418bef 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
@@ -57,7 +57,7 @@
* @returns {boolean}
*/
var allowConnection = function () {
- return !d3.event.shiftKey && d3.select('rect.drag-selection').empty() && d3.select('rect.selection').empty();
+ return !d3.event.shiftKey && d3.select('rect.drag-selection').empty() && d3.select('rect.component-selection').empty();
};
return {
@@ -65,15 +65,15 @@
canvas = d3.select('#canvas');
// dragging behavior for the connector
- connect = d3.behavior.drag()
- .origin(function (d) {
+ connect = d3.drag()
+ .subject(function (d) {
origin = d3.mouse(canvas.node());
return {
x: origin[0],
y: origin[1]
};
})
- .on('dragstart', function (d) {
+ .on('start', function (d) {
// stop further propagation
d3.event.sourceEvent.stopPropagation();
@@ -98,7 +98,7 @@
'x': position[0],
'y': position[1]
})
- .attr({
+ .attrs({
'class': 'connector',
'd': function (pathDatum) {
return 'M' + pathDatum.x + ' ' + pathDatum.y + 'L' + pathDatum.x + ' ' + pathDatum.y;
@@ -168,7 +168,7 @@
}
});
})
- .on('dragend', function (d) {
+ .on('end', function (d) {
// stop further propagation
d3.event.sourceEvent.stopPropagation();
@@ -243,7 +243,7 @@
origY: y
})
.call(connect)
- .attr({
+ .attrs({
'class': 'add-connect',
'transform': 'translate(' + x + ', ' + y + ')'
})