Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 5736

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 27, 20242024-11-27T12:02:10+00:00 2024-11-27T12:02:10+00:00

Building a tree Gantt

  • 60k

What is a tree Gantt?

The tree Gantt is a component where every row is considered either a tree or a leaf. Tree rows have branches linking to other rows that can be trees or leaves. The leaf row is always the most granular and has no further link.

As a developer, working with tree Gantts can be a tedious task, as most of the algorithms use recursion to visit all the vertices.

Tree Gantt

Implementing a tree Gantt

To implement a Gantt component in ScheduleJS, the first requirement is to extend the right GanttComponentBase. To build a tree Gantt architecture, your Angular component must extend the DefaultScheduleTreeGanttComoponentBase instead of the regular DefaultScheduleGanttComponentBase.

// Create a new tree gantt component  export class MyTreeGanttComponent extends DefaultScheduleTreeGanttComponentBase<MyRow, DefaultScheduleGanttGraphicTreeComponent<MyRow>> { } 
Enter fullscreen mode Exit fullscreen mode

Storing activities in ScheduleJS always involves an ActivityRepository. There are two different types of repositories:

  • The IntervalTreeActivityRepository
  • The ListActivityRepository

In the case of a tree Gantt, the default ActivityRepository is an IntervalTreeActivityRepository. It allows your application to perform binary search and ensures higher performance when processing a large number of activities.

Image description

Using a tree Gantt component is very similar to using a regular Gantt component, the only difference is that you have to manually call the

gantt.refreshTreeRows() 
Enter fullscreen mode Exit fullscreen mode

method once you are done with modifying your rows. This is done to avoid redundancy in calling this function as it may lead to lower performance.

The ScheduleJS Viewer activity schedule use case

Now we will have a closer look at the HTML file of the ScheduleJS Viewer main component which implements a tree Gantt: the ScheduleJsViewerActivitySchedule. Let’s explain the typical template implemented for the tree Gantt use case.

<!-- Activity schedule component -->  <div class="schedule-js-viewer-activity-schedule-container"      [class.loading]="gantt.isLoading">    <!-- Schedule timeline & Tree table header cells -->    <schedule-js-viewer-activity-schedule-timeline-block [gantt]="gantt"                                                        [scheduleInfoColumns]="scheduleInfoColumns"                                                        [cellsHost]="this">   </schedule-js-viewer-activity-schedule-timeline-block>    <!-- Gantt Graphics -->    <default-schedule-gantt-graphic-tree class="schedule-js-viewer-activity-schedule-graphics"                                        [gantt]="gantt"                                        [ganttNgDoCheckBoundingState]="isTabUsingActivitySchedule()"                                        [ganttContainerElement]="nativeElement"                                        [viewportAdditionalLoadCount]="getAdditionalLoadCount()"                                        [rowInfoTemplate]="rowInfoTemplate"                                        (rowExpandedChange)="gantt.refreshTreeRows()">      <!-- Info columns -->      <ng-template #rowInfoTemplate                  let-treeNodeContext>       <schedule-js-viewer-activity-schedule-info-column [cellsHost]="this"                                                         [scheduleInfoColumns]="scheduleInfoColumns"                                                         [gantt]="gantt"                                                         [treeNodeContext]="asTreeNodeContext(treeNodeContext)"                                                         [row]="treeNodeContext.value"                                                         [parenthoodColors]="parenthoodColors">       </schedule-js-viewer-activity-schedule-info-column>     </ng-template>    </default-schedule-gantt-graphic-tree>    <!-- Sub schedules -->    <div *ngFor="let projectFileData of scheduleJsViewerStateService.projectFiles; let index = index">     <schedule-js-viewer-activity-sub-schedule *ngIf="projectFileData"                                               [file]="projectFileData"                                               [index]="index"                                               (timelineSyncChange)="onTimelineSubscription($event, index)">     </schedule-js-viewer-activity-sub-schedule>   </div>  </div> 
Enter fullscreen mode Exit fullscreen mode

There's a lot more to say, but if you'd like to see the rest of the article, I suggest you go to ScheduleJS

javascriptnodetypescriptwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    ES6 - A beginners guide - Template Literals

    • 0 Answers
  • Author

    Understanding Higher Order Functions in JavaScript.

    • 0 Answers
  • Author

    Build a custom video chat app with Daily and Vue.js

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.