Skip to content

Commit e13c412

Browse files
EugeneElkinignatvilesov
authored andcommitted
Init (#126)
1 parent 0d42bc7 commit e13c412

File tree

5 files changed

+39
-34
lines changed

5 files changed

+39
-34
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.14.1
2+
* Fixed bug with wrongly positioned "group expand/collapse" icon when horizontal scrolling is presented and the icon now has fixed horizontal position as for single "expand/collapse" icons
3+
* Fixed bug with broken removing of some important selectors
4+
15
## 1.14.0
26
* High contrast mode
37
* API 1.13.0

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-visuals-gantt",
3-
"version": "1.14.0",
3+
"version": "1.14.1",
44
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
55
"repository": {
66
"type": "git",

pbiviz.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"visual": {
33
"name": "Gantt",
4-
"displayName": "Gantt 1.14.0",
4+
"displayName": "Gantt 1.14.1",
55
"guid": "Gantt1448688115699",
66
"visualClassName": "Gantt",
7-
"version": "1.14.0",
7+
"version": "1.14.1",
88
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
99
"supportUrl": "https://community.powerbi.com",
1010
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-gantt"

src/gantt.ts

+31-31
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,6 @@ module powerbi.extensibility.visual {
356356
.attr("height", "40px")
357357
.attr("fill", axisBackgroundColor);
358358

359-
this.collapseAllGroup = this.ganttSvg
360-
.append("g")
361-
.classed(Selectors.CollapseAll.className, true);
362-
363-
this.collapseAllGroup
364-
.append("rect")
365-
.attr("width", 110)
366-
.attr("fill", axisBackgroundColor);
367-
368359
// create task lines container
369360
this.lineGroup = this.ganttSvg
370361
.append("g")
@@ -373,6 +364,16 @@ module powerbi.extensibility.visual {
373364
this.lineGroupWrapper = this.lineGroup
374365
.append("rect")
375366
.attr("height", "100%")
367+
.attr("fill", axisBackgroundColor)
368+
.attr("y", this.margin.top);
369+
370+
this.collapseAllGroup = this.lineGroup
371+
.append("g")
372+
.classed(Selectors.CollapseAll.className, true);
373+
374+
this.collapseAllGroup
375+
.append("rect")
376+
.attr("width", 110)
376377
.attr("fill", axisBackgroundColor);
377378

378379
// create legend container
@@ -393,7 +394,7 @@ module powerbi.extensibility.visual {
393394
self.axisGroup
394395
.attr("transform", SVGUtil.translate(taskLabelsWidth + self.margin.left, Gantt.TaskLabelsMarginTop + this.scrollTop));
395396
self.lineGroup
396-
.attr("transform", SVGUtil.translate(this.scrollLeft, self.margin.top))
397+
.attr("transform", SVGUtil.translate(this.scrollLeft, 0))
397398
.attr("height", 20);
398399
}
399400
}, false);
@@ -1534,7 +1535,7 @@ module powerbi.extensibility.visual {
15341535
.append("g")
15351536
.classed(Selectors.Label.className, true)
15361537
.attr({
1537-
transform: (task: GroupedTask) => SVGUtil.translate(0, this.getTaskLabelCoordinateY(task.id))
1538+
transform: (task: GroupedTask) => SVGUtil.translate(0, this.margin.top + this.getTaskLabelCoordinateY(task.id))
15381539
});
15391540

15401541
axisLabelGroup
@@ -1612,6 +1613,14 @@ module powerbi.extensibility.visual {
16121613
this.lineGroupWrapper
16131614
.attr("fill", "transparent");
16141615

1616+
this.collapseAllGroup
1617+
.selectAll("image")
1618+
.remove();
1619+
1620+
this.collapseAllGroup
1621+
.selectAll("rect")
1622+
.remove();
1623+
16151624
this.lineGroup
16161625
.selectAll(Selectors.Label.selectorName)
16171626
.remove();
@@ -1714,21 +1723,6 @@ module powerbi.extensibility.visual {
17141723
.remove();
17151724
}
17161725

1717-
/**
1718-
* Remove all by selector
1719-
* @param taskSelection Task Selection
1720-
* @param selector Selector name
1721-
*/
1722-
private removeBySelectors(
1723-
taskSelection: UpdateSelection<Task>,
1724-
selector: string
1725-
): void {
1726-
1727-
taskSelection
1728-
.selectAll(Selectors[selector].selector)
1729-
.remove();
1730-
}
1731-
17321726
/**
17331727
* Render task progress rect
17341728
* @param taskGroupSelection Task Group Selection
@@ -1841,7 +1835,9 @@ module powerbi.extensibility.visual {
18411835
.remove();
18421836

18431837
} else {
1844-
this.removeBySelectors(taskSelection, "TaskDaysOff");
1838+
taskSelection
1839+
.selectAll(Selectors.TaskDaysOff.selectorName)
1840+
.remove();
18451841
}
18461842
}
18471843

@@ -1881,7 +1877,9 @@ module powerbi.extensibility.visual {
18811877
.exit()
18821878
.remove();
18831879
} else {
1884-
this.removeBySelectors(taskSelection, "TaskProgress");
1880+
taskSelection
1881+
.selectAll(Selectors.TaskProgress.selectorName)
1882+
.remove();
18851883
}
18861884
}
18871885

@@ -1985,7 +1983,9 @@ module powerbi.extensibility.visual {
19851983
.exit()
19861984
.remove();
19871985
} else {
1988-
this.removeBySelectors(taskSelection, "TaskResource");
1986+
taskSelection
1987+
.selectAll(Selectors.TaskResource.selectorName)
1988+
.remove();
19891989
}
19901990
}
19911991

@@ -2236,9 +2236,9 @@ module powerbi.extensibility.visual {
22362236

22372237
translateXValue = (this.ganttDiv.node() as SVGSVGElement).scrollLeft;
22382238
this.lineGroup
2239-
.attr("transform", SVGUtil.translate(translateXValue, margin.top));
2239+
.attr("transform", SVGUtil.translate(translateXValue, 0));
22402240
this.collapseAllGroup
2241-
.attr("transform", SVGUtil.translate(translateXValue, margin.top / 4));
2241+
.attr("transform", SVGUtil.translate(0, margin.top / 4));
22422242
}
22432243

22442244
private getMilestoneLineLength(numOfTasks: number): number {

test/visualBuilder.ts

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module powerbi.extensibility.visual.test {
6767

6868
public get collapseAllRect() {
6969
return this.mainElement
70+
.children("g.task-lines")
7071
.children("g.collapse-all");
7172
}
7273

0 commit comments

Comments
 (0)