forked from expovin/DataLineage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataLineage.js
More file actions
209 lines (157 loc) · 5.75 KB
/
Copy pathDataLineage.js
File metadata and controls
209 lines (157 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
define( [ "qlik",
"jquery",
"text!./template.html",
"text!./css/myStyle.css",
"./js/CustomDirective",
// "./js/DataLineage.Services",
"./js/DataLineage.controller",
"./js/settings/GeneralSettings", // Variable with the General settings
"./js/settings/ImageSettings",
"./js/getHyperCube",
"./js/getLevel1HyperCube",
"./js/getLevel2HyperCube",
"./js/getLevel3HyperCube",
"./js/getLevel4HyperCube",
"./js/getLevel5HyperCube",
"./js/getLevel6HyperCube",
"./js/getLevel7HyperCube",
"./js/getLevel8HyperCube"
],
function ( qlik, $, template, boot,cssContent ) {
"use strict";
$( '<style>' ).html( boot ).appendTo( 'head' ); // Adding scoped bootstrap to head
$( '<style>' ).html( cssContent ).appendTo( 'head' ); // Adding scopped style to head
$( '<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css">' ).appendTo( 'head' ); // Font Awesome CDN
$( '<link rel="stylesheet" href="/extensions/switchtable/css/scoped-bootstrap.css">' ).appendTo( 'head' ); // Font Awesome CDN
$( '<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>' ).appendTo( 'body' ); // Bootstrap.js CDN
// $( '<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css">' ).appendTo( 'head' ); // Font Awesome CDN
// $( '<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">' ).appendTo( 'head' ); // Font Awesome CDN
// $( '<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>' ).appendTo( 'body' ); // Bootstrap.js CDN
var AdditionalInfo=[];
var flagPageRafrash=false;
var call=0
var me = {
template: template,
initialProperties: {
version: 1.2,
qHyperCubeDef: {
qDimensions: [],
qMeasures: [],
qInitialDataFetch: [{
qWidth: 9,
qHeight: 1000
}]
}
},
definition : {
type : "items",
component : "accordion",
items : {
dimensions : {
uses : "dimensions",
min : 1,
max : 8
},
measures : {
uses : "measures",
min : 0
},
sorting : {
uses : "sorting"
},
settings : {},
image : {}
}
},
support: {
snapshot: true,
export: true,
exportData: false
}
};
// Get Engine API app for Selections
me.app = qlik.currApp(this);
me.definition.items.settings = generalSettings;
me.definition.items.image = imageSettings;
me.controller = mainController;
me.init = function(){
flagPageRafrash = true;
//console.log("Init, Page Refresh :"+flagPageRafrash);
};
me.paint = function($element,layout) {
this.$scope.numOfElements = layout.qHyperCube.qDataPages[0].qMatrix.length;
var _this=this;
var addInfosArray = [];
// _this.$scope.MoreInfo=[];
this.$scope.limits = layout.settings.image.limits;
if(layout.qHyperCube.qDataPages[0].qMatrix.length < layout.settings.image.limits.maxObjs){
var Metadata = splitObject(layout.qHyperCube.qDataPages[0].qMatrix);
//console.log("Paint, Page Refresh :"+flagPageRafrash);
if(!flagPageRafrash) {
me.app.createCube(varLvl1Data,funLvl1Data);
function funLvl1Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
me.app.createCube(varLvl2Data,funLvl2Data);
});
}
function funLvl2Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
me.app.createCube(varLvl3Data,funLvl3Data);
});
}
function funLvl3Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
me.app.createCube(varLvl4Data,funLvl4Data);
});
}
function funLvl4Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
me.app.createCube(varLvl5Data,funLvl5Data);
});
}
function funLvl5Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
me.app.createCube(varLvl6Data,funLvl6Data);
});
}
function funLvl6Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
me.app.createCube(varLvl7Data,funLvl7Data);
});
}
function funLvl7Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
me.app.createCube(varLvl8Data,funLvl8Data);
});
}
function funLvl8Data(reply, app){
makeAdditionalInfo(reply,function(replay){
addInfosArray.push(replay);
});
}
_this.$scope.MoreInfo = addInfosArray;
}
}
else {
console.log(this.$scope.numOfElements," are too much elements to drow. Please make a selection!");
}
this.$scope.realSize = getElementContentWidth(document.getElementById("ExtObj_Container"));
console.log(this.$scope.realSize);
this.$scope.elePosition = makeElementPosition(this.$scope.realSize, Metadata[0], layout.settings,layout.qHyperCube.qDimensionInfo);
this.$scope.arrowPosition = makeArrowsPosition(Metadata[1],this.$scope.elePosition);
this.$scope.QlikApp = qlik.currApp();
if ( !this.$scope.table ) {
this.$scope.table = qlik.table( this );
}
flagPageRafrash = false;
return qlik.Promise.resolve();
};
return me;
});