Skip to content

Commit 3a705e3

Browse files
savvinsergeyignatvilesov
authored andcommitted
Added the ability to use sub tasks (#92)
1 parent c2ed900 commit 3a705e3

10 files changed

+457
-29
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.9.0
2+
* Added ability to use sub tasks
13
## 1.8.6
24
* Added option to data labels which cut them up to the width of the task
35
## 1.8.5

capabilities.json

+59
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
"displayNameKey": "Role_Task",
1313
"kind": "Grouping"
1414
},
15+
{
16+
"name": "Parent",
17+
"displayName": "Parent",
18+
"displayNameKey": "Role_Parent",
19+
"kind": "Grouping"
20+
},
1521
{
1622
"name": "StartDate",
1723
"displayName": "Start Date",
@@ -71,6 +77,10 @@
7177
"min": 1,
7278
"max": 1
7379
},
80+
"Parent": {
81+
"min": 0,
82+
"max": 1
83+
},
7484
"StartDate": {
7585
"min": 0,
7686
"max": 0
@@ -101,6 +111,10 @@
101111
"min": 1,
102112
"max": 1
103113
},
114+
"Parent": {
115+
"min": 0,
116+
"max": 1
117+
},
104118
"StartDate": {
105119
"min": 0,
106120
"max": 1
@@ -131,6 +145,10 @@
131145
"min": 0,
132146
"max": 1
133147
},
148+
"Parent": {
149+
"min": 0,
150+
"max": 1
151+
},
134152
"StartDate": {
135153
"min": 0,
136154
"max": 1
@@ -161,6 +179,11 @@
161179
"in": "Task"
162180
}
163181
},
182+
{
183+
"for": {
184+
"in": "Parent"
185+
}
186+
},
164187
{
165188
"for": {
166189
"in": "StartDate"
@@ -254,6 +277,42 @@
254277
}
255278
}
256279
},
280+
"subTasks": {
281+
"displayName": "Sub tasks",
282+
"displayNameKey": "Visual_SubTasks",
283+
"properties": {
284+
"inheritParentLegend": {
285+
"displayName": "Inherit parent legend",
286+
"displayNameKey": "Visual_InheritParentLegend",
287+
"type": {
288+
"bool": true
289+
}
290+
},
291+
"parentDurationByChildren": {
292+
"displayName": "Parent duration by children",
293+
"displayNameKey": "Visual_ParentDurationByChildren",
294+
"type": {
295+
"bool": true
296+
}
297+
},
298+
"parentCompletionByChildren": {
299+
"displayName": "Parent completion by children",
300+
"displayNameKey": "Visual_ParentCompletionByChildren",
301+
"type": {
302+
"bool": true
303+
}
304+
}
305+
}
306+
},
307+
"collapsedTasks": {
308+
"properties": {
309+
"list": {
310+
"type": {
311+
"text": true
312+
}
313+
}
314+
}
315+
},
257316
"daysOff": {
258317
"displayName": "DaysOff",
259318
"displayNameKey": "Visual_DaysOff",

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.8.6",
3+
"version": "1.9.0",
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Gantt",
55
"guid": "Gantt1448688115699",
66
"visualClassName": "Gantt",
7-
"version": "1.8.6",
7+
"version": "1.9.0",
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": "http://community.powerbi.com",
1010
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-gantt"

src/behavior.ts

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ module powerbi.extensibility.visual {
4646
(d3.event as MouseEvent).stopPropagation();
4747
});
4848

49+
options.subTasksCollapse.selection.on("click", (d: GroupedTask) => {
50+
if (!_.flatten(d.tasks.map(task => task.children)).length) {
51+
return;
52+
}
53+
54+
(d3.event as MouseEvent).stopPropagation();
55+
options.subTasksCollapse.callback(d);
56+
});
57+
4958
clearCatcher.on("click", () => {
5059
selectionHandler.handleClearSelection();
5160
});

src/columns.ts

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ module powerbi.extensibility.visual {
7272
// Data Roles
7373
public Legend: T = null;
7474
public Task: T = null;
75+
public Parent: T = null;
7576
public StartDate: T = null;
7677
public Duration: T = null;
7778
public Completion: T = null;

0 commit comments

Comments
 (0)