Skip to content

Commit 43f5db9

Browse files
committed
Reverting back comments
1 parent 83cbdec commit 43f5db9

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/app/component/circular-heatmap/circular-heatmap.component.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ export class CircularHeatmapComponent implements OnInit {
5959
this.yaml.setURI('./assets/YAML/generated/generated.yaml');
6060
// Function sets data
6161
this.yaml.getJson().subscribe(data => {
62+
//console.log(this.radial_labels)
6263
this.YamlObject = data;
64+
// console.log(this.YamlObject);
6365

6466
var allDimensionNames = Object.keys(this.YamlObject);
67+
// console.log(allDimensionNames);
6568
for (var i = 0; i < allDimensionNames.length; i++) {
6669
var allSubDimensionInThisDimension = Object.keys(
6770
this.YamlObject[allDimensionNames[i]]
@@ -70,6 +73,7 @@ export class CircularHeatmapComponent implements OnInit {
7073
this.segment_labels.push(allSubDimensionInThisDimension[j]);
7174
}
7275
}
76+
// console.log(this.segment_labels);
7377
for (var l = 0; l < this.maxLevelOfTasks; l++) {
7478
var allDimensionNames = Object.keys(this.YamlObject);
7579
for (var i = 0; i < allDimensionNames.length; i++) {
@@ -126,6 +130,7 @@ export class CircularHeatmapComponent implements OnInit {
126130
}
127131
}
128132
}
133+
// console.log(this.ALL_CARD_DATA);
129134
this.loadState();
130135
this.loadCircularHeatMap(
131136
this.ALL_CARD_DATA,
@@ -138,6 +143,7 @@ export class CircularHeatmapComponent implements OnInit {
138143
}
139144

140145
toggleCheckbox(taskIndex: number) {
146+
//console.log('fo')
141147
let _self = this;
142148
var index = 0;
143149
var cnt = 0;
@@ -155,7 +161,9 @@ export class CircularHeatmapComponent implements OnInit {
155161
} else {
156162
this.ALL_CARD_DATA[index]['Task'][taskIndex]['ifTaskDone'] = true;
157163
}
164+
// console.log(this.data[i]["Task"][taskIndex]["done"])
158165
for (var i = 0; i < this.ALL_CARD_DATA[index]['Task'].length; i++) {
166+
console.log(this.ALL_CARD_DATA[index]['Task'][i]['ifTaskDone']);
159167
if (this.ALL_CARD_DATA[index]['Task'][i]['ifTaskDone']) {
160168
cnt += 1;
161169
}
@@ -169,6 +177,7 @@ export class CircularHeatmapComponent implements OnInit {
169177
if (allSubDimensionInThisDimension[j] == this.cardHeader) {
170178
var taskName =
171179
this.ALL_CARD_DATA[index]['Task'][taskIndex]['taskName'];
180+
// console.log(taskName);
172181
this.YamlObject[allDimensionNames[i]][
173182
allSubDimensionInThisDimension[j]
174183
][taskName]['isImplemented'] =
@@ -179,6 +188,7 @@ export class CircularHeatmapComponent implements OnInit {
179188
}
180189
this.ALL_CARD_DATA[index]['Done%'] =
181190
cnt / this.ALL_CARD_DATA[index]['Task'].length;
191+
// console.log(this.data[index]['Done%'], cnt);
182192
var color = d3
183193
.scaleLinear<string, string>()
184194
.domain([0, 1])
@@ -201,6 +211,9 @@ export class CircularHeatmapComponent implements OnInit {
201211
radial_labels: string[],
202212
segment_labels: string[]
203213
) {
214+
//console.log(segment_labels)
215+
//d3.select(dom_element_to_append_to).selectAll('svg').exit()
216+
//console.log(dataset)
204217
let _self = this;
205218
var margin = {
206219
top: 50,
@@ -260,25 +273,31 @@ export class CircularHeatmapComponent implements OnInit {
260273
svg
261274
.selectAll('path')
262275
.on('click', function (d) {
276+
console.log(d);
263277
try {
264278
curr = d.explicitOriginalTarget.__data__;
265279
} catch {
266280
curr = d.srcElement.__data__;
267281
}
282+
//console.log(curr);
268283
_self.currentDimension = curr.Dimension;
269284
_self.cardSubheader = curr.Level;
270285
_self.tasksData = curr.Task;
271286
_self.cardHeader = curr.SubDimension;
272287
_self.showTaskCard = true;
288+
//console.log(_self.tasksData)
273289
})
274290
.on('mouseover', function (d) {
291+
//console.log(d.toElement.__data__.Name)
275292
try {
276293
curr = d.explicitOriginalTarget.__data__;
277294
} catch {
278295
curr = d.toElement.__data__;
279296
}
297+
//console.log(curr)
280298
// increase the segment height of the one being hovered as well as all others of the same date
281299
// while decreasing the height of all others accordingly
300+
//console.log(d)
282301
if (curr['Done%'] != -1) {
283302
d3.selectAll(
284303
'#segment-' +
@@ -290,6 +309,13 @@ export class CircularHeatmapComponent implements OnInit {
290309
})
291310

292311
.on('mouseout', function (d) {
312+
//console.log(d.explicitOriginalTarget.__data__.Day)
313+
314+
// var time = d.Time;
315+
// var timeCleaned = time.split(":").join("-");
316+
// var segment = d3.select("#segment-"+d.Day +"-"+timeCleaned); //designate selector variable for brevity
317+
// var fillcolor = segment.select("desc").text(); //access original color from desc
318+
// segment.style("fill", fillcolor);
293319
if (curr['Done%'] != -1) {
294320
d3.selectAll(
295321
'#segment-' +
@@ -302,6 +328,7 @@ export class CircularHeatmapComponent implements OnInit {
302328
.domain([0, 1])
303329
.range(['white', 'green']);
304330
// how to access a function within reusable charts
331+
//console.log(color(d.Done));
305332
return color(curr['Done%']);
306333
});
307334
} else {
@@ -333,6 +360,8 @@ export class CircularHeatmapComponent implements OnInit {
333360
var radialLabels = [];
334361
var segmentLabels: any[] = [];
335362

363+
//console.log(segmentLabels)
364+
336365
function chart(selection: any) {
337366
selection.each(function (this: any, data: any) {
338367
var svg = d3.select(this);
@@ -366,6 +395,7 @@ export class CircularHeatmapComponent implements OnInit {
366395
.data(data)
367396
.enter()
368397
.append('path')
398+
// .attr("class","segment")
369399
.attr('class', function (d: any) {
370400
return 'segment-' + d.SubDimension.replace(/ /g, '-');
371401
})
@@ -394,6 +424,7 @@ export class CircularHeatmapComponent implements OnInit {
394424
});
395425

396426
// Unique id so that the text path defs are unique - is there a better way to do this?
427+
// console.log(d3.selectAll(".circular-heat")["_groups"][0].length)
397428
var id = 1;
398429

399430
//Segment labels
@@ -517,8 +548,11 @@ export class CircularHeatmapComponent implements OnInit {
517548
}
518549

519550
noTasktoGrey(): void {
551+
console.log(this.ALL_CARD_DATA);
520552
for (var x = 0; x < this.ALL_CARD_DATA.length; x++) {
521553
if (this.ALL_CARD_DATA[x]['Done%'] == -1) {
554+
console.log(this.ALL_CARD_DATA[x]['SubDimension']);
555+
console.log(this.ALL_CARD_DATA[x]['Level']);
522556
d3.selectAll(
523557
'#segment-' +
524558
this.ALL_CARD_DATA[x]['SubDimension'].replace(/ /g, '-') +
@@ -538,15 +572,19 @@ export class CircularHeatmapComponent implements OnInit {
538572
};
539573
this.yaml.setURI('./assets/YAML/generated/generated.yaml');
540574
this.taskDetails = this.YamlObject[dim][subdim][taskName];
575+
console.log(this.YamlObject);
576+
console.log(this.YamlObject[dim][subdim]);
541577
if (this.taskDetails) {
542578
this.taskDetails.navigationExtras = navigationExtras;
543579
}
580+
console.log(this.taskDetails);
544581
this.showOverlay = true;
545582
}
546583
closeOverlay() {
547584
this.showOverlay = false;
548585
}
549586
SaveEditedYAMLfile() {
587+
//console.log(this.YamlObject);
550588
let yamlStr = yaml.dump(this.YamlObject);
551589
let file = new Blob([yamlStr], { type: 'text/csv;charset=utf-8' });
552590
var link = document.createElement('a');

0 commit comments

Comments
 (0)