Gathering detailed insights and metrics for @dhtmlx/trial-vue-gantt
Gathering detailed insights and metrics for @dhtmlx/trial-vue-gantt
Gathering detailed insights and metrics for @dhtmlx/trial-vue-gantt
Gathering detailed insights and metrics for @dhtmlx/trial-vue-gantt
npm install @dhtmlx/trial-vue-gantt
Typescript
Module System
Node Version
NPM Version
55.7
Supply Chain
98.5
Quality
77.4
Maintenance
100
Vulnerability
99.6
License
Total Downloads
15,103
Last Day
3
Last Week
89
Last Month
499
Last Year
4,716
Minified
Minified + Gzipped
Latest Version
1.1.2
Package Id
@dhtmlx/trial-vue-gantt@1.1.2
Unpacked Size
195.71 kB
Size
50.97 kB
File Count
41
NPM Version
6.14.13
Node Version
14.17.0
Cumulative downloads
Total Downloads
Last Day
-78.6%
3
Compared to previous day
Last Week
4.7%
89
Compared to previous week
Last Month
-19.5%
499
Compared to previous month
Last Year
4.4%
4,716
Compared to previous year
1
30
1npm install @dhtmlx/trial-vue-gantt
This will install trial version, for commercial one, use "@dhx/vue-gantt"
1import { Gantt, DefaultTheme } from "@dhtmlx/trial-vue-gantt"; 2 3export default function GanttBasic() { 4 return ( 5 <DefaultTheme> 6 <Gantt /> 7 </DefaultTheme> 8 ); 9}
You can check the demo of mininal project here - https://stackblitz.com/edit/vue-gantt-basic
Source code of the gantt can be checked in node_modules/@dhtmlx/trial-vue-gantt/src
Package contains two predefined themes - Default and Material.
You can apply theme by wrapping Gantt into DefaultTheme or MaterialTheme tags
1<div> 2 <DefaultTheme> 3 <Gantt /> 4 </DefaultTheme> 5 <MaterialTheme> 6 <Gantt /> 7 </MaterialTheme> 8</div>
or you can just add theme tag on the page and add skin class to one of Gantt's parent tags
1<div> 2 <DefaultTheme /> 3 <MaterialTheme /> 4 5 <div class="wx-default"> 6 <Gantt /> 7 </div> 8 <div class="wx-material"> 9 <Gantt /> 10 </div> 11</div>
You can define scales/columns/tasks/links during Gantt initialization
1<Gantt :scales="scales" :columns="columns" :tasks="tasks" :links="links" />
where data may look like next
1const scales = [ 2 { unit: "month", step: 1, format: "MMMM yyy" }, 3 { unit: "day", step: 1, format: "d" }, 4]; 5 6const columns = [ 7 { name: "text", label: "Task name", width: "100%" }, 8 { name: "start", label: "Start time", align: "center" }, 9 { name: "duration", label: "Duration", width: "70px", align: "center" }, 10 { name: "add-task", label: "", width: "50px", align: "center" }, 11]; 12 13const tasks = [ 14 { 15 id: 1, 16 open: true, 17 start_date: "2020-11-06", 18 duration: 8, 19 text: "vue Gantt Widget", 20 progress: 60, 21 type: "project", 22 }, 23 { 24 id: 2, 25 parent: 1, 26 start_date: "2020-11-06", 27 duration: 4, 28 text: "Lib-Gantt", 29 progress: 80, 30 }, 31]; 32 33const links = [{ source: 2, target: 1, type: 0 }];
Check https://github.com/web-widgets/vue-gantt-demos/blob/master/src/components/GanttBackend.vue
Code defines the action handler through save event. This event will be triggered on any update and may be used to save changes to the persistent storage.
In the above example, the RestDataProvider is used https://github.com/web-widgets/gantt-data-provider/blob/master/src/providers/rest.ts You are not limited to this solution, though, and can extend the provided class or define a custom handler.
We provide 2 demo backends, with nodejs and go
again, you are not limited to this solution. The above RestDataProvider can work with any REST like service and you can implement a fully custom solution ( sockets, graphql, etc. ) through custom save event.
The next elements can be customized through templates
check https://github.com/web-widgets/vue-gantt-demos/blob/master/src/components/GanttText.vue
check https://github.com/web-widgets/vue-gantt-demos/blob/master/src/components/GanttTooltips.vue
1// templates for different elements of gantt 2let templates = {}; 3// array of markers 4let markers = []; 5// supported task types 6let taskTypes = ["task", "project", "milestone"]; 7// tasks data 8let tasks = []; 9// links data 10let links = []; 11// time scales configuration 12let scales = [ 13 { unit: "month", step: 1, format: "MMMM yyy" }, 14 { unit: "day", step: 1, format: "d" }, 15]; 16// grid configuration 17let columns = [ 18 { name: "text", label: "Task name", width: "100%" }, 19 { name: "add-task", label: "", width: "50px", align: "center" }, 20]; 21// time scale start 22let start = null; 23// time scale end 24let end = null; 25// width of scale cell 26let cellWidth = 100; 27// height of chart bar 28let cellHeight = 38; 29// height of scale cell 30let scaleHeight = 30; 31// readonly mode flag 32let readonly = false; 33// show or hide grid 34let grid = true; 35// show or hide tooltips 36let tooltip = null; 37// show or hide borders in the chart area 38let borders = "full";
1// will be called with DataStore value on Gantt initalization 2let store = null; 3// will be called on any action in the Gantt 4let actions = null; 5// will be called on any data modification in the Gantt 6let save = null;
Data modifications ( both action and save events )
UI State ( action event )
1function handler({ action, obj, id }){ 2 if (action === "select-task") 3 console.log(`Task ${id} was selected`); 4} 5 6<Gantt @action="handler"/>
1let store; 2 3<Gantt @store="v => store = v" />
and now you can use store's API to get or modify data.
1interface IStore {
2 getTask(id: number): GanttItemData;
3 updateTask(id: number, obj: any, noSave: boolean): void;
4 updateLink(id: number, obj: any, noSave: boolean): void;
5 action(
6 id: number,
7 action: string,
8 obj: StringHash<any>,
9 noSave?: boolean
10 ): number;
11}
action method can be used to trigger any of above actions
1store.action(taskId, "tasks-toggle");
2store.action(linkId, "delete-link");
3store.action(null, "add-link", { source: 1, target 2, type: 0 });
No vulnerabilities found.
No security vulnerabilities found.