Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
1efb57bc
Commit
1efb57bc
authored
Jun 16, 2015
by
Vishal Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HDPDGI-69:Dileep:Use details api to get LoadProcess name
parent
d54a5981
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
5 deletions
+53
-5
lineageController.js
dashboard/v2/public/modules/lineage/lineageController.js
+53
-5
No files found.
dashboard/v2/public/modules/lineage/lineageController.js
View file @
1efb57bc
...
@@ -18,8 +18,9 @@
...
@@ -18,8 +18,9 @@
'use strict'
;
'use strict'
;
angular
.
module
(
'dgc.lineage'
).
controller
(
'LineageController'
,
[
'$element'
,
'$scope'
,
'$state'
,
'$stateParams'
,
'lodash'
,
'LineageResource'
,
'd3'
,
angular
.
module
(
'dgc.lineage'
).
controller
(
'LineageController'
,
[
'$element'
,
'$scope'
,
'$state'
,
'$stateParams'
,
'lodash'
,
'LineageResource'
,
'd3'
,
'DetailsResource'
,
'$q'
,
function
(
$element
,
$scope
,
$state
,
$stateParams
,
_
,
LineageResource
,
d3
)
{
function
(
$element
,
$scope
,
$state
,
$stateParams
,
_
,
LineageResource
,
d3
,
DetailsResource
,
$q
)
{
var
guidsList
=
[];
function
getLineageData
(
tableData
,
callRender
)
{
function
getLineageData
(
tableData
,
callRender
)
{
LineageResource
.
get
({
LineageResource
.
get
({
...
@@ -27,15 +28,38 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
...
@@ -27,15 +28,38 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
type
:
tableData
.
type
type
:
tableData
.
type
},
function
lineageSuccess
(
response
)
{
},
function
lineageSuccess
(
response
)
{
if
(
!
_
.
isEmpty
(
response
.
results
.
values
.
vertices
))
{
if
(
!
_
.
isEmpty
(
response
.
results
.
values
.
vertices
))
{
var
allGuids
=
loadProcess
(
response
.
results
.
values
.
edges
,
response
.
results
.
values
.
vertices
);
allGuids
.
then
(
function
(
res
)
{
guidsList
=
JSON
.
parse
(
res
);
$scope
.
lineageData
=
transformData
(
response
.
results
);
$scope
.
lineageData
=
transformData
(
response
.
results
);
if
(
callRender
)
{
if
(
callRender
)
{
render
();
render
();
}
}
});
}
}
$scope
.
requested
=
false
;
$scope
.
requested
=
false
;
});
});
}
}
function
loadProcess
(
edges
,
vertices
)
{
var
urlCalls
=
[];
var
deferred
=
$q
.
defer
();
for
(
var
guid
in
edges
)
{
if
(
!
vertices
.
hasOwnProperty
(
guid
))
{
urlCalls
.
push
(
DetailsResource
.
get
({
id
:
guid
}).
$promise
);
}
}
$q
.
all
(
urlCalls
)
.
then
(
function
(
results
)
{
deferred
.
resolve
(
JSON
.
stringify
(
results
));
});
return
deferred
.
promise
;
}
$scope
.
type
=
$element
.
parent
().
attr
(
'data-table-type'
);
$scope
.
type
=
$element
.
parent
().
attr
(
'data-table-type'
);
$scope
.
requested
=
false
;
$scope
.
requested
=
false
;
...
@@ -67,10 +91,24 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
...
@@ -67,10 +91,24 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
nodes
=
{};
nodes
=
{};
function
getNode
(
guid
)
{
function
getNode
(
guid
)
{
var
name
,
type
;
if
(
vertices
.
hasOwnProperty
(
guid
))
{
name
=
vertices
[
guid
].
values
.
name
;
type
=
vertices
[
guid
].
values
.
vertexId
.
values
.
typeName
;
}
else
{
var
loadProcess
=
getLoadProcessTypes
(
guid
);
if
(
typeof
loadProcess
!==
"undefined"
)
{
name
=
loadProcess
.
name
;
type
=
loadProcess
.
typeName
;
}
else
{
name
=
'Load Process'
;
type
=
'Load Process'
;
}
}
var
vertex
=
{
var
vertex
=
{
guid
:
guid
,
guid
:
guid
,
name
:
vertices
.
hasOwnProperty
(
guid
)
?
vertices
[
guid
].
values
.
name
:
'Load Process'
,
name
:
name
,
type
:
vertices
.
hasOwnProperty
(
guid
)
?
vertices
[
guid
].
values
.
vertexId
.
values
.
typeName
:
'LoadProcess'
type
:
type
};
};
if
(
!
nodes
.
hasOwnProperty
(
guid
))
{
if
(
!
nodes
.
hasOwnProperty
(
guid
))
{
nodes
[
guid
]
=
vertex
;
nodes
[
guid
]
=
vertex
;
...
@@ -78,6 +116,17 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
...
@@ -78,6 +116,17 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
return
nodes
[
guid
];
return
nodes
[
guid
];
}
}
function
getLoadProcessTypes
(
guid
)
{
var
procesRes
=
[];
angular
.
forEach
(
guidsList
,
function
(
value
)
{
if
(
value
.
id
.
id
===
guid
)
{
procesRes
.
name
=
value
.
values
.
name
;
procesRes
.
typeName
=
value
.
typeName
;
}
});
return
procesRes
;
}
function
attachParent
(
edge
,
node
)
{
function
attachParent
(
edge
,
node
)
{
edge
.
forEach
(
function
eachPoint
(
childGuid
)
{
edge
.
forEach
(
function
eachPoint
(
childGuid
)
{
var
childNode
=
getNode
(
childGuid
);
var
childNode
=
getNode
(
childGuid
);
...
@@ -172,7 +221,6 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
...
@@ -172,7 +221,6 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
.
attr
(
"y"
,
"-18px"
)
.
attr
(
"y"
,
"-18px"
)
.
attr
(
"width"
,
"34px"
)
.
attr
(
"width"
,
"34px"
)
.
attr
(
"height"
,
"34px"
);
.
attr
(
"height"
,
"34px"
);
nodeEnter
.
append
(
'text'
)
nodeEnter
.
append
(
'text'
)
.
attr
(
'x'
,
function
(
d
)
{
.
attr
(
'x'
,
function
(
d
)
{
return
d
.
children
||
d
.
_children
?
return
d
.
children
||
d
.
_children
?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment