Giter Site home page Giter Site logo

ng-gantt's People

Contributors

bitflower avatar mariohmol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-gantt's Issues

Current state of project: Angular 15/16 compatibility

Hi, We are js noobs who are running an angular 15 project, and would like to use ng-gantt. Is there any chance of an upgrade? Should we try to figure out how to raise a PR for the same, or is something is the works.
Is the project actively/ passively maintained?

default option of 'Week' to 'Day'

How to change the default loading option of the gantt chart from showing the 'Week' tab to the 'Day' tab.

Also how can I remove everything but the 'Day' tab?

vEvent

Hi,
i almost customized ng-gantt all and nearly done in my project. but the issue is the vEvent is not working. the vEvent is triggered, but all the current data is missing. seems like the parents component ts is not pass in. when the test method called, the original value of orderNumber is missing. can anybody help?

many thanks,
George

vEvents: {
taskname: this.test,
beforeDraw: () => console.log('before draw listener'),
afterDraw: () => console.log('before after listener')
},
test(event) {
this._orderNumber = "dfgls";
this._currentJobVisitOrDefect = 'po';
this._currentDefectID = event.getAllData().pDataObjec.DefectID;
alert(event.getAllData().pDataObjec.pID);
}

update for Angular 9

2 month ago, angular has released LTS version 9.
Any plan to move ng-gantt on @angular/cli@^9.0?

Default options not working

The initial options are not loading correctly

This is in the html:
<ng-gantt [options]="editorOptions" [data]="gantt_projects" #editor></ng-gantt>

This is in the ts file:
editorOptions = { vShowRes: parseInt('0', 10), vTooltipDelay: 50, vScrollTo: "today", vShowStartDate: parseInt('0', 10), vShowEndDate: parseInt('0', 10), }

None of these options are actually working on startup. I need to manually run for it to work :
this.editor.setOptions(this.editorOptions)

Incorrect dates in monthly view

How to reproduce:
Go to -> https://stackblitz.com/edit/angular-ng-gantt

app.component.ts:
mytest.txt

Daily View:
daily

Monthly View:
mytest

Monthly view produces:

  • A large whitespace between the last two tasks even though they're 1 day apart.
  • Incorrect start/end date visual for multiple tasks (the last task being the most obvious)

Is there a way to improve the visual accuracy of monthly view with inputs like these?

ScrollTo only working on initial load

If i set the data and options inside ngOnInit, everything works fine.
If i call a webservice and populate the data in a subscribe, the data updates the chart but the scrollto has no effect.
I have explicitly set the data in the subscribe to make sure its not a data issue.

ngOnInit() {

this.projectsObservable = this.projectService.getProjectPlans(0);
this.projectsObservable.subscribe(projects => {
this.data = [{example data goes here}]

	this.editorOptions = {
		vFormat: 'month',
		vScrollTo: '2019-01-01',
	}

}
Im guessing the scroll has already run before teh data has loaded.
Is there anyway to force the scroll to run again after the data has loaded?

Any click event on the gantt chart?

Do you have the click event on the bar of gantt chart? if I select one task and I would like to open another detail panel. thanks, George

editor property of GanttEditorComponent doesn't have 'options' field

Inside ngOnInit function, we attribute this.editor.options to optionsBefore but the value this.editor.options is actually undefined if we use console to check the value.
This causes some problems when we try updating our data since the option before is undefined and the jsgantt will, therefore, use some default options.
Here is a screenshot when I access the editor.options from the parent component. As we can see, all these options are already parts of the editor not inside editor.options
undefined

Highlight current day/week/month depending on the year

Currently there is a class added for weekend dates, but can we add one for the current date as well? The use case is to be able to style the current day/week/month depending on the format. The issue is that from html/css, there is no way to figure out the current date based on the contents of the table

Refer to the below screenshot where the header of the current day cell is highlighted which is what I want to achieve:
image

Reading Data from API renders chart read only

When I read my data via JSON variable, as shown in all the examples, all works well. When I read the same data in from my API, the gantt chart is rendered read only. I've dumped the data provided to ng-gantt at the dumb component hosting the chart, the JSON.stringify output is exactly the same in both cases. Perhaps the stringify is not telling the whole story.

I'm not sure this is an issue, it may be a stupid user trick. (I mention the state management as some postulated the issue was due to the immutable state, both scenarios use the same state components and calls all the way to the service that calls the API)

Environment: Angular 10, Nx monorepo and state management. Postgres database called via API.

Data Workflow: A resolver kicks off a loadRequestTasks action on the state. The loadRequestTasks action pulls data from the same getAll method in either case using the same effects path. I have been switching back and forth in the service call shown below to test. The data is loaded into the state by the same effect and reducer in either case. A smart component subscribes to the facade and provides the data to the dumb component hosting the ng-gantt chart.

 getAll(requestnbr: number): Observable<ScheduleTask[]> {
    // return this.http.get<ScheduleTask[]>(
    //   `${this.API_PATH}/${requestnbr.toString()}/task`
    // );
    return this.initialData();
  }

editor options

this.editorOptions = {
        vFormat: 'week',
        vEditable: true,
        vUseSort: true,
        vEvents: {
          taskname: this.clickValue.bind(this, this.data),
          res: console.log,
          dur: console.log,
          comp: console.log,
          start: console.log,
          end: console.log,
          planstart: console.log,
          planend: console.log,
          cost: console.log
        },
        vEventsChange: {
          taskname: this.editValue.bind(this, this.data),
          res: this.editValue.bind(this, this.data),
          dur: this.editValue.bind(this, this.data),
          comp: this.editValue.bind(this, this.data),
          start: this.editValue.bind(this, this.data),
          end: this.editValue.bind(this, this.data),
          planstart: this.editValue.bind(this, this.data),
          planend: this.editValue.bind(this, this.data),
          cost: this.editValue.bind(this, this.data)
        }
      };

html

<mat-expansion-panel expanded="true">
  <mat-expansion-panel-header>
    <mat-panel-title>
      Schedule
    </mat-panel-title>
  </mat-expansion-panel-header>
  <form class="flex flex-col">
    <div class="flex flex-col md:flex-row md:flex-wrap md:-mx-2">
      <ng-gantt [options]="editorOptions" [data]="data" #editor></ng-gantt>
    </div>
  </form>
</mat-expansion-panel>

I've cast the dates back and forth, it makes no difference in either case. The JSON in the attached file is what is returned at the dumb component and is precisely the same whether the data is from the JSON variable or the API call.

I'm hoping that I am missing something easy. Thanks in advance.

fromAPI.txt

Clear Data

How do I clear my gantt data? When I add a new setting to a date it updates, but when I pass an empty value nothing happens.

Cannot access 'GanttEditorOptions' before initialization

I'm facing this issue on an Angular v8 app. I'm using the component in my app.component and have imported the Module too.

Uncaught ReferenceError: Cannot access 'GanttEditorOptions' before initialization
    at Module../node_modules/ng-gantt/fesm2015/ng-gantt.js (ng-gantt.js:63)
    at __webpack_require__ (bootstrap:83)
    at Module../src/app/app.module.ts (app.component.ts:13)
    at __webpack_require__ (bootstrap:83)
    at Module../src/main.ts (main.ts:1)
    at __webpack_require__ (bootstrap:83)
    at Object.0 (main.ts:12)
    at __webpack_require__ (bootstrap:83)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)

Following are the versions I'm at:

"jsgantt-improved": "^2.4.4",
"ng-gantt": "^2.4.3",

How to redraw the chart on data change?

When the data is updated, like from a modal popup then the chart is not redrawn. I saw there is a method g.draw() in the documentation for pure javascript but what method to call in angular to redraw the chart when the data has got updated from another component.

How custom the class .gmainleft

I need custom the width of the chart, in FULL DOCUMENTATION of jsgantt-improved said that in css i can edit the class .gmainleft, but when i try to edit the width it not change.

How can I hide particular column?

I saw method named : setShowComp in jsgantt-improved documentation, but I am not getting how to use this method in angular with ng-gantt.

Compatibility with angular 7

I want to integrate this with my angular 7 application, but
On line -
@ViewChild(GanttEditorComponent,{ static:true }) editor: GanttEditorComponent;

I got an error "Argument of type '{ static: boolean; }' is not assignable to parameter of type '{ read?: any; }'.
Object literal may only specify known properties, and 'static' does not exist in type '{ read?: any; }'.
(property) static: boolean
"

So, when I change it to -
@ViewChild(GanttEditorComponent) editor: GanttEditorComponent;
I get following error -
ERROR Error: "Uncaught (in promise): Error: Can't resolve all parameters for SchedularComponent: ([object Object], ?, [object Object]).
syntaxError@http://localhost:4200/vendor.js:16940:22
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getDependenciesMetadata@http://localhost:4200/vendor.js:33494:35
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getTypeMetadata@http://localhost:4200/vendor.js:33387:26
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata@http://localhost:4200/vendor.js:33006:24
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getEntryComponentMetadata@http://localhost:4200/vendor.js:33590:28
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getEntryComponentsFromProvider/<@http://localhost:4200/vendor.js:33581:31
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getEntryComponentsFromProvider@http://localhost:4200/vendor.js:33580:30
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getProvidersMetadata/<@http://localhost:4200/vendor.js:33553:138
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getProvidersMetadata@http://localhost:4200/vendor.js:33516:19
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getProvidersMetadata/<@http://localhost:4200/vendor.js:33518:23
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype._getProvidersMetadata@http://localhost:4200/vendor.js:33516:19
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.getNgModuleMetadata/<@http://localhost:4200/vendor.js:33139:118
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.getNgModuleMetadata@http://localhost:4200/vendor.js:33130:49
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.getNgModuleSummary@http://localhost:4200/vendor.js:33065:35
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.getNgModuleMetadata/<@http://localhost:4200/vendor.js:33152:55
./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.getNgModuleMetadata@http://localhost:4200/vendor.js:33130:49
./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype._loadModules@http://localhost:4200/vendor.js:40539:51
./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype._compileModuleAndComponents@http://localhost:4200/vendor.js:40520:36
./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype.compileModuleAsync@http://localhost:4200/vendor.js:40480:37
./node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js/CompilerImpl.prototype.compileModuleAsync@http://localhost:4200/vendor.js:73464:31
./node_modules/@angular/core/fesm5/core.js/SystemJsNgModuleLoader.prototype.loadAndCompile/<@http://localhost:4200/vendor.js:60357:60
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invoke@http://localhost:4200/polyfills.js:7698:26
onInvoke@http://localhost:4200/vendor.js:59294:33
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invoke@http://localhost:4200/polyfills.js:7697:52
./node_modules/zone.js/dist/zone.js/</Zone.prototype.run@http://localhost:4200/polyfills.js:7457:43
scheduleResolveOrReject/<@http://localhost:4200/polyfills.js:8196:34
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.js:7730:31
onInvokeTask@http://localhost:4200/vendor.js:59285:33
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.js:7729:60
./node_modules/zone.js/dist/zone.js/</Zone.prototype.runTask@http://localhost:4200/polyfills.js:7502:47
drainMicroTaskQueue@http://localhost:4200/polyfills.js:7908:35

How do I integrate it with my angular 7 application?

importing from jsgantt-imporved

hi team
here its importing GanttChart instead of JSGantt where as jsgantt-improved module is exporting JSGantt
import { JSGantt } from 'jsgantt-improved';
var /** @type {?} */ g = this.editor = new JSGantt(this.ganttEditorContainer.nativeElement, 'week');

importing this is working fine instead of importing and getting an issue with module 1. 1.module.exports = jsGantt.JSGantt;
error: Uncaught TypeError: Cannot assign to read only property 'exports' of object '[object Object]'
2.import { GanttChart } from 'jsgantt-improved';
var /** @type {?} */ g = this.editor = new GanttChart(this.ganttEditorContainer.nativeElement, 'week');

it will work fine in locally but in pcf its getting fail

vScrollTo not working

I'm trying to make the option vScrollTo to work but its never working.

This is my options setting:

editorOptions = { vScrollTo: "today", }

and to set the options i'm using :
this.editor.setOptions(this.editorOptions)

That being said, its not working.

Is it possible to add custom language (Angular 8+)? Need ukraininan lang

Is it possible to add custom language (Angular 8+)? Need ukraininan lang
ua = {
'january': 'Січень',
'february': 'Лютий',
'march': 'Березень',
'april': 'Квітень',
'maylong': 'Травень',
'june': 'Червень',
'july': 'Липень',
'august': 'Серпень',
'september': 'Вересень',
'october': 'Жовтень',
'november': 'Листопад',
'december': 'Грудень',
'jan': 'Січ',
'feb': 'Лют',
'mar': 'Бер',
'apr': 'Кві',
'may': 'Тра',
'jun': 'Чер',
'jul': 'Лип',
'aug': 'Сер',
'sep': 'Вер',
'oct': 'Жов',
'nov': 'Лис',
'dec': 'Гру',
'sunday': 'Неділя',
'monday': 'Понеділок',
'tuesday': 'Вівторок',
'wednesday': 'Середа',
'thursday': 'Четвер',
'friday': 'П'ятниця',
'saturday': 'Субота',
'sun': ' Нд',
'mon': 'Пн',
'tue': ' Вт',
'wed': 'Ср',
'thu': ' Чт',
'fri': ' Пт',
'sat': ' Сб',
'res': 'Ресурс',
'dur': 'Тривалість',
'comp': '% виконання',
'completion': 'Виконано',
'startdate': 'Поч. дата',
'planstartdate': 'План Поч. дата',
'enddate': 'Кін. дата',
'planenddate': 'План Кін. дата',
'cost': 'Вартість',
'moreinfo': 'Деталі',
'nodata': 'Нічого не знайдено',
'notes': 'Нотатки',
'format': 'Формат',
'hour': 'Година',
'day': 'День',
'week': 'Тиждень',
'month': 'Місяць',
'quarter': 'Кварт',
'hours': 'Годин',
'days': 'Днів',
'weeks': 'Тижнів',
'months': 'Місяців',
'quarters': 'Кварталів',
'hr': 'г.',
'dy': 'дн.',
'wk': 'тиж.',
'mth': 'міс.',
'qtr': 'кв.',
'hrs': 'г.',
'dys': 'дн.',
'wks': 'тиж.',
'mths': 'міс.',
'qtrs': 'кв.',
'tooltipLoading': 'Загрузка...'
}

Dynamic Data for Gantt Chart Hierarchy does not work

Good day,

I am working with ng-Gantt to present programme pulled from an api. the api has two end nodes that I pull data from the first is wbs for the work breakdown structure and results need to be presented in hierarchy
The second node is activity which will fit below one of the WBS codes mentioned above.
The hierarchy or the parent child relationships do not work when the data comes dynamically from the api. but it works as expected if I hard coded the data.

Can you please direct me on how to resolve this issue.

initialData() {

    var temp1 = [];
    var temp2 = [];

    if (this.wbss.length > 0) {
      for (var i = 0; i < this.wbss.length; i++) {
        var dataObj = {
          'pID': "7a2930e2-c9f4-4a43-98f4-f970420b7e49",
          'pName': 'ggg',
          'pStart': '2017-02-20',
          'pEnd': '2017-02-28',
          'pClass': 'ggroupblack',
          'pLink': '',
          'pMile': 0,
          'pRes': 'WBS',
          'pComp': 100,
          'pGroup': 1,
          'pParent': '0',
          'pOpen': 0,
          'pDepend': '',
          'pCaption': '',
          'pCode': '',
          'pNotes': 'Some text'
        };

        var public_id = this.wbss[i].public_id;
        var parent_public_id = this.wbss[i].parent_public_id;

        dataObj.pID = public_id;
        dataObj.pName = this.wbss[i].name;

        dataObj.pParent = (parent_public_id == null) ? '0' : parent_public_id;
        dataObj.pCode = this.wbss[i].code;
        dataObj.pGroup = 0;
        console.log(dataObj)
        temp1.push(dataObj);
      }
    }

    if (this.activitys.length > 0) {
      for (var i = 0; i < this.activitys.length; i++) {
        var dataObj = {
          'pID': "7a2930e2-c9f4-4a43-98f4-f970420b7e49",
          'pName': 'ggg',
          'pStart': '2017-02-20',
          'pEnd': '2017-02-28',
          'pClass': 'ggroupblack',
          'pLink': '',
          'pMile': 0,
          'pRes': 'WBS',
          'pComp': 100,
          'pGroup': 1,
          'pParent': '0',
          'pOpen': 0,
          'pDepend': '',
          'pCaption': '',
          'pCode': '',
          'pNotes': 'Some text'
        };
        
        dataObj.pID = this.activitys[i].public_id;
        dataObj.pName = this.activitys[i].title;

        dataObj.pParent = this.activitys[i].wbs_public_id;
        dataObj.pCode = this.activitys[i].code;
        dataObj.pGroup = 0;
        dataObj.pStart = this.activitys[i].start;
        dataObj.pEnd = this.activitys[i].finish;
        console.log(dataObj);
        temp2.push(dataObj);
      }
    }

    var temp = temp1.concat(temp2);
    this.data = temp;
    
    this.data1 = [{
      'pID': "7a2930e2-c9f4-4a43-98f4-f970420b7e49",
      'pName': 'ggg',
      'pStart': '2017-02-20',
      'pEnd': '2017-02-28',
      'pClass': 'ggroupblack',
      'pLink': '',
      'pMile': 1,
      'pRes': 'WBS',
      'pComp': 100,
      'pGroup': 1,
      'pParent': '0',
      'pOpen': 0,
      'pDepend': '',
      'pCaption': '',
      'pCode': '',
      'pNotes': 'Some text'
    }, {
      'pID': "ede60398-5674-499d-83b3-b1878f8b8952",
      'pName': 'gggss',
      'pStart': '2017-02-20',
      'pEnd': '2017-02-28',
      'pClass': 'ggroupblack',
      'pLink': '',
      'pMile': 1,
      'pRes': 'WBS',
      'pComp': 100,
      'pGroup': 1,
      'pParent': "7a2930e2-c9f4-4a43-98f4-f970420b7e49",
      'pOpen': 1,
      'pDepend': '',
      'pCaption': '',
      'pCode': '',
      'pNotes': 'Some text'
    }, {
      'pID': "92903e24-897a-4f9c-8d35-97392bb3fc7c",
      'pName': 'gasgg',
      'pStart': '2017-02-20',
      'pEnd': '2017-02-28',
      'pClass': 'ggroupblack',
      'pLink': '',
      'pMile': 1,
      'pRes': 'WBS',
      'pComp': 100,
      'pGroup': 1,
      'pParent': "0",
      'pOpen': 1,
      'pDepend': '',
      'pCaption': '',
      'pCode': '',
      'pNotes': 'Some text'
    }];
    console.log(this.data);
    console.log(this.data1);
  }

Minutes View

Hi..i was wondering if there was an attribute to show the timeline in a minutes view, similar to the 'hour' tag....

Support for Angular 10 and 11

Hello,
Would ng-gantt work with Angular 10.x and 11.x ? We are using 10.x and 11.x and would like to try out ng-gantt

Angular 12 How to get the Selected task data on individual task click

Hi Team,

Angular 12 How to get the Selected task data on individual task click .Can you please suggest which event is require to implement.I have gone through on existing issues but not able to get it . how to do this.Is this doable using this library or Not?
My sample code
<ng-gantt
[options]="editorOptions"
[data]="data"
#editor (click)="test($event)"
>

Timelines

Is there anyway to have two or more tasks or milestones in the same line, as timelines, each one with their own attributes, links to other tasks included?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.