You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2021/07/07 05:07:17 UTC

[atlas] branch branch-2.0 updated: ATLAS-4345:UI: Lineage issues for when entities are greater than 9k in a given lineage. fixed

This is an automated email from the ASF dual-hosted git repository.

nixon pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new fdf21bf  ATLAS-4345:UI: Lineage issues for when entities are greater than 9k in a given lineage. fixed
fdf21bf is described below

commit fdf21bf7994be7a8b99157fc961bbd86f6390f65
Author: prasad pawar <pr...@freestoneinfotech.com>
AuthorDate: Mon Jul 5 15:36:08 2021 +0530

    ATLAS-4345:UI: Lineage issues for when entities are greater than 9k in a given lineage. fixed
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
    (cherry picked from commit 475a89b30864bd95909837a2b3480779fc7ee5e2)
---
 dashboardv2/public/js/views/graph/LineageLayoutView.js | 17 +++++++++++++++++
 dashboardv3/public/js/views/graph/LineageLayoutView.js | 18 ++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 5ad657e..b106ee6 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -226,6 +226,13 @@ define(['require',
                 this.labelFullText = false;
             },
             onClickSaveSvg: function(e, a) {
+                var that = this;
+                if (that.lineageRelationshipLength >= 1000) {
+                    Utils.notifyInfo({
+                        content: "There was an error in downloading lineage: Lineage exceeds display parameters!"
+                    });
+                    return;
+                }
                 this.LineageHelperRef.exportLineage();
             },
             onClickZoomIn: function() {
@@ -254,6 +261,16 @@ define(['require',
                             return;
                         }
                         data["legends"] = options ? options.legends : true;
+                        // show only main part of lineage current entity is at bottom, so reverse is done
+                        var relationsReverse = data.relations ? data.relations.reverse() : null,
+                            lineageMaxRelationCount = 9000;
+                        if (relationsReverse.length > lineageMaxRelationCount) {
+                            data.relations = relationsReverse.splice(relationsReverse.length - lineageMaxRelationCount, relationsReverse.length - 1);
+                            Utils.notifyInfo({
+                                content: "Lineage exceeds display parameters and hence only upto 9000 relationships from this lineage can be displayed"
+                            });
+                        }
+                        that.lineageRelationshipLength = data.relations.length;
                         that.createGraph(data);
                         that.renderLineageTypeSearch(data);
                     },
diff --git a/dashboardv3/public/js/views/graph/LineageLayoutView.js b/dashboardv3/public/js/views/graph/LineageLayoutView.js
index 954d9af..b106ee6 100644
--- a/dashboardv3/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv3/public/js/views/graph/LineageLayoutView.js
@@ -226,6 +226,13 @@ define(['require',
                 this.labelFullText = false;
             },
             onClickSaveSvg: function(e, a) {
+                var that = this;
+                if (that.lineageRelationshipLength >= 1000) {
+                    Utils.notifyInfo({
+                        content: "There was an error in downloading lineage: Lineage exceeds display parameters!"
+                    });
+                    return;
+                }
                 this.LineageHelperRef.exportLineage();
             },
             onClickZoomIn: function() {
@@ -254,6 +261,16 @@ define(['require',
                             return;
                         }
                         data["legends"] = options ? options.legends : true;
+                        // show only main part of lineage current entity is at bottom, so reverse is done
+                        var relationsReverse = data.relations ? data.relations.reverse() : null,
+                            lineageMaxRelationCount = 9000;
+                        if (relationsReverse.length > lineageMaxRelationCount) {
+                            data.relations = relationsReverse.splice(relationsReverse.length - lineageMaxRelationCount, relationsReverse.length - 1);
+                            Utils.notifyInfo({
+                                content: "Lineage exceeds display parameters and hence only upto 9000 relationships from this lineage can be displayed"
+                            });
+                        }
+                        that.lineageRelationshipLength = data.relations.length;
                         that.createGraph(data);
                         that.renderLineageTypeSearch(data);
                     },
@@ -269,6 +286,7 @@ define(['require',
             createGraph: function(data) {
                 var that = this;
                 $('.resizeGraph').css("height", this.$('.svg').height() + "px");
+
                 this.LineageHelperRef = new LineageHelper.default({
                     entityDefCollection: this.entityDefCollection.fullCollection.toJSON(),
                     data: data,