VibeFox JS Gantt — عرض توضيحي
البدء السريع
HTML بسيط
مهمة ملخّصة مع مهامها الفرعية، ومعلم، وروابط، وأيام العمل فقط، والمسار الحرج. اسحب شريط Build نحو اليمين: تتحرك Testing وLaunch معه.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', {
...look,
data: tasks,
links,
resources,
workdaysOnly: true,
showCriticalPath: true,
});المفاهيم الأساسية
الأحداث
يُبلَّغ عن كل تغيير كحدث واحد مع كائن حمولة واحد؛ وتُعرض آخر الأحداث أسفل المخطط. حرّك شريطاً أو غيّر حجمه، أو اسحب مقبض تقدّمه، أو انقر على صف.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const out = document.createElement('p');
document.getElementById('app').after(out);
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true });
const say = (text) => { out.textContent = text; };
say('Events appear here.');
gantt.on('taskChange', (e) => e.task && say('taskChange: ' + e.task.name + ' ' + e.task.start + ' – ' + e.task.end + ' (' + e.source + ')'));
gantt.on('progressChange', (e) => e.task && say('progressChange: ' + e.task.name + ' ' + e.task.progress + '%'));
gantt.on('selectionChange', (e) => say('selectionChange: ' + (e.task ? e.task.name : 'none')));
gantt.on('dependencyCreate', (e) => say('dependencyCreate: ' + e.link.from + ' → ' + e.link.to + ' ' + e.link.type));لقطات الحالة
احفظ العرض، ثم غيّر التكبير أو اطوِ المهمة الملخّصة أو رتّب حسب عمود، ثم استعده: تُعيد getState() / setState() التكبيرَ والصفوفَ المطوية والترتيبَ وموضعَ التمرير.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true });
let saved = gantt.getState();
button('Save view', () => { saved = gantt.getState(); });
button('Restore view', () => gantt.setState(saved));
button('Zoom out', () => gantt.zoomOut());
button('Collapse all', () => gantt.collapseAll());التراجع والإعادة
حرّك عدة أشرطة أو غيّر مدة في الجدول، ثم تراجع عن الخطوات وأعِدها باستخدام الأزرار أو شريط الأدوات أو بالمفاتيح Ctrl+Z / Ctrl+Y.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true });
button('Undo', () => gantt.undo());
button('Redo', () => gantt.redo());المهام والروابط
العمل مع المهام
انقر على صف واستخدم الأزرار: أضف مهمة بعده، أو أزِحها للداخل لتصبح تحت المهمة التي فوقها، أو أزِحها للخارج، أو احذفها.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true });
let selected = null;
gantt.on('selectionChange', (e) => { selected = e.task ? e.task.id : null; });
let n = 0;
button('Add task', () => {
const after = selected != null ? gantt.getTask(selected) : null;
const task = { name: 'New task ' + (++n), parent: after ? after.parent : 1, start: after ? after.start : '2026-10-26', duration: 2 };
gantt.addTask(task, after ? { after: selected } : undefined);
});
button('Indent', () => selected != null && gantt.indentTask(selected));
button('Outdent', () => selected != null && gantt.outdentTask(selected));
button('Remove', () => selected != null && gantt.removeTask(selected));الروابط
أنواع الروابط الأربعة: من الانتهاء إلى البدء مع تأخير قدره يوم واحد، ومن البدء إلى البدء، ومن الانتهاء إلى الانتهاء، ومن البدء إلى الانتهاء. اسحب من النقطة عند نهاية الشريط إلى شريط آخر لإضافة رابط.
const gantt = VibeFoxJSGantt.createGantt('#app', {
data: [
{ id: 1, name: 'Foundation', start: '2026-10-26', duration: 2 },
{ id: 2, name: 'Walls (FS +1)', start: '2026-10-29', duration: 3 },
{ id: 3, name: 'Wiring (SS)', start: '2026-10-29', duration: 2 },
{ id: 4, name: 'Inspection (FF)', start: '2026-10-30', duration: 2 },
{ id: 5, name: 'Handover (SF)', start: '2026-10-29', duration: 2 },
],
links: [
{ from: 1, to: 2, type: 'FS', lag: 1 },
{ from: 2, to: 3, type: 'SS' },
{ from: 2, to: 4, type: 'FF' },
{ from: 4, to: 5, type: 'SF' },
],
workdaysOnly: true,
columns: ['name', 'duration'], gridWidth: 290,
});تقسيم المهام
يُقسَّم Build إلى جزأين للعمل مع استراحة بينهما؛ ويُقسَّم Painting باستخدام splitTask(). اسحب أحد الجزأين على طول الجدول الزمني.
const gantt = VibeFoxJSGantt.createGantt('#app', {
data: [
{ id: 1, name: 'Design', start: '2026-10-26', duration: 2 },
{ id: 2, name: 'Build', segments: [{ start: '2026-10-28', duration: 2 }, { start: '2026-11-02', duration: 3 }] },
{ id: 3, name: 'Painting', start: '2026-10-28', duration: 4 },
],
links: [{ from: 1, to: 2 }],
workdaysOnly: true,
columns: ['name', 'duration'], gridWidth: 290,
});
gantt.splitTask(3, '2026-10-30', 1); // the rest starts 1 working day laterالجدولة
الجدولة التلقائية وأوقات العمل
المدد بأيام العمل، وتُظلَّل عطلات نهاية الأسبوع. أطِل Design بسحب نهاية شريطه: تُدفع Build وTesting وLaunch إلى الأمام وتتخطى عطلة نهاية الأسبوع.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', {
...look,
data: tasks,
links,
resources,
autoSchedule: true,
workdaysOnly: true,
workingDays: [1, 2, 3, 4, 5],
weekendHighlight: true,
});مهام الساعات
المهام المخططة بالساعات ضمن ساعات العمل 08:00–12:00 و13:00–17:00، عند استخدام مقياس الساعات. اسحب شريطاً: يُحاذى إلى 15 دقيقة ويتخطى استراحة الغداء والليل.
const gantt = VibeFoxJSGantt.createGantt('#app', {
data: [
{ id: 1, name: 'Unpack the server', start: '2026-10-26 08:00', duration: 2, durationUnit: 'hour' },
{ id: 2, name: 'Install the system', start: '2026-10-26 10:00', duration: 3, durationUnit: 'hour' },
{ id: 3, name: 'Copy the data', start: '2026-10-26 14:00', duration: 4, durationUnit: 'hour' },
{ id: 4, name: 'Switch over', start: '2026-10-27 09:00', type: 'milestone' },
],
links: [{ from: 1, to: 2 }, { from: 2, to: 3 }, { from: 3, to: 4 }],
zoom: 0,
workdaysOnly: true,
workHours: ['08:00-12:00', '13:00-17:00'],
snapMinutes: 15,
columns: ['name', 'start', 'duration'], gridWidth: 375,
dateFormat: 'DD.MM',
});
gantt.scrollToDate('2026-10-26 08:00');قيود الجدولة والمواعيد النهائية
لا يجوز أن تبدأ Testing قبل 5 نوفمبر (SNET)، وموعدها النهائي هو 5 نوفمبر: تُظهر العلامات القيد والموعد النهائي الذي فات، وتُعرض التعارضات أسفل المخطط. اسحب Testing نحو اليسار: يتحرك تاريخ القيد معه (moveConstraintOnDrag).
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const out = document.createElement('p');
document.getElementById('app').after(out);
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, showConstraints: true });
gantt.setConstraint(5, 'SNET', '2026-11-05');
gantt.setDeadline(5, '2026-11-05');
const show = () => {
out.textContent = gantt.getConflicts().map((c) => c.kind + ' of ' + gantt.getTask(c.task).name + ': ' + c.date + ', finishes ' + c.required).join('; ') || 'No conflicts';
};
gantt.on('constraintConflict', show);
show();المسار الحرج والهامش وصحة الجدول الزمني
الأشرطة الحمراء تحدد نهاية المشروع، والجزء المظلَّل بعد Content هو هامشه. إذا جعلت Content أطول من هامشه، يصبح حرجاً هو الآخر.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const out = document.createElement('p');
document.getElementById('app').after(out);
const gantt = VibeFoxJSGantt.createGantt('#app', {
...look, data: tasks, links, resources, workdaysOnly: true,
showCriticalPath: true,
showSlack: true,
});
const show = () => {
const { slack } = gantt.getCriticalPath();
out.textContent = 'Slack of Content: ' + slack[3] + ' days. Schedule health: ' + gantt.getScheduleHealth().score + ' / 100';
};
gantt.on('taskChange', show);
show();التقويمات
للمشروع تقويم «Office» فيه عطلة يوم 2 نوفمبر، وجمعة قصيرة؛ أما المهمة Server move فتستخدم تقويمها الخاص الذي يعمل أيضاً يوم السبت. تُظلَّل العطلات وتتخطاها المدد: تستغرق Migration أربعة أيام عمل، مع تخطي العطلة.
const gantt = VibeFoxJSGantt.createGantt('#app', {
data: [
{ id: 1, name: 'Planning', start: '2026-10-26', duration: 2 },
{ id: 2, name: 'Migration', start: '2026-10-28', duration: 4 },
{ id: 3, name: 'Server move', start: '2026-10-28', duration: 4, calendar: 'weekend-shift' },
{ id: 4, name: 'Go live', start: '2026-11-04', type: 'milestone' },
],
links: [{ from: 1, to: 2 }, { from: 2, to: 4 }],
workdaysOnly: true,
calendars: [
{ id: 'office', name: 'Office', workingDays: [1, 2, 3, 4, 5], hours: ['09:00-13:00', '14:00-18:00'],
dayHours: { 5: ['09:00-14:00'] },
holidays: [{ date: '2026-11-02', name: 'Company day' }] },
{ id: 'weekend-shift', name: 'Weekend shift', parent: 'office', workingDays: [1, 2, 3, 4, 5, 6] },
],
calendar: 'office',
columns: ['name', 'calendar'], gridWidth: 340,
});الموارد والتسوية
الموارد والتعيينات
تعرض لوحة الموارد أسفل المخطط حمل كل شخص؛ وتعمل Eva على Content وReview في الوقت نفسه فتتجاوز حملها (باللون الأحمر). اسحب Review لاحقاً لإزالة التحميل الزائد.
const gantt = VibeFoxJSGantt.createGantt('#app', {
data: [
{ id: 1, name: 'Design', start: '2026-10-26', duration: 3, resources: ['ann'] },
{ id: 2, name: 'Content', start: '2026-10-26', duration: 4, resources: ['eva'] },
{ id: 3, name: 'Build', start: '2026-10-29', duration: 5, resources: ['bob', { id: 'ann', units: 50 }] },
{ id: 4, name: 'Review', start: '2026-10-28', duration: 2, resources: ['eva'] },
],
links: [{ from: 1, to: 3 }],
resources: [
{ id: 'ann', name: 'Ann', capacity: 100 },
{ id: 'bob', name: 'Bob', capacity: 100 },
{ id: 'eva', name: 'Eva', capacity: 100 },
],
workdaysOnly: true,
showResourceHistogram: true,
showResourceNames: true,
resourceColumns: ['name', 'peak', 'work'],
columns: ['name', 'duration', 'resources'], gridWidth: 430,
});تسوية الموارد
Eva متجاوزة لحملها. يعرض Preview التواريخ المقترحة كأشرطة شبحية مع التقرير؛ ينقل Apply المهام، ويعيدها Undo إلى مواضعها.
const gantt = VibeFoxJSGantt.createGantt('#app', {
data: [
{ id: 1, name: 'Content', start: '2026-10-26', duration: 3, resources: ['eva'] },
{ id: 2, name: 'Review', start: '2026-10-27', duration: 2, resources: ['eva'] },
{ id: 3, name: 'Translations', start: '2026-10-28', duration: 2, resources: ['eva'] },
{ id: 4, name: 'Build', start: '2026-10-26', duration: 5, resources: ['bob'] },
],
resources: [{ id: 'eva', name: 'Eva' }, { id: 'bob', name: 'Bob' }],
workdaysOnly: true,
showResourceHistogram: true,
columns: ['name', 'duration'], gridWidth: 290,
});
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const out = document.createElement('p');
document.getElementById('app').after(out);
button('Preview', () => { out.textContent = gantt.previewLeveling({ withinSlack: false }).text; });
button('Apply', () => { gantt.applyPreview(); out.textContent = 'Applied.'; });
button('Undo', () => { gantt.clearPreview(); gantt.undo(); out.textContent = ''; });التحرير
انقر نقراً مزدوجاً على اسم لتحريره في الجدول، وانقر نقراً مزدوجاً على شريط لفتح محرر المهمة (مع حقل Owner إضافي)، وانقر بزر الفأرة الأيمن على شريط لفتح القائمة السياقية مع عنصر إضافي.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const out = document.createElement('p');
document.getElementById('app').after(out);
tasks[4].owner = 'QA team';
const gantt = VibeFoxJSGantt.createGantt('#app', {
...look, data: tasks, links, resources, workdaysOnly: true,
cellEditing: true,
taskEditor: { fields: [{ field: 'owner', label: 'Owner', type: 'text', tab: 'general' }] },
contextMenu: {
task: [{ id: 'mail', label: 'Send to owner', action: (ctx) => { out.textContent = 'Send ' + ctx.task.name + ' to ' + (ctx.task.owner || 'nobody'); } }],
},
});الجدول الزمني والعروض
التكبير والتمرير
اختر مقياساً من الساعات إلى الأرباع، أو استخدم شريط الأدوات العائم في المخطط؛ تنتقل الأزرار إلى مهمة أو تاريخ.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, zoom: 2 });
const zoom = document.createElement('select');
['Hours', 'Days', 'Weeks', 'Months', 'Quarters'].forEach((name, i) => zoom.add(new Option(name, i)));
zoom.value = 2;
zoom.onchange = () => gantt.setZoom(+zoom.value);
gantt.on('zoomChange', (e) => { zoom.value = e.zoom; });
bar.append(zoom, ' ');
button('Scroll to Launch', () => gantt.scrollToTask(6));
button('Scroll to 26 Oct', () => gantt.scrollToDate('2026-10-26'));جدول المهام
أرقام WBS، وأعمدة مختارة تشمل الموارد، وتنسيق تاريخ بالصيغة day.month، وجدول أعرض. اسحب الفاصل بين الجدول والمخطط؛ وانقر على عنوان لترتيب الصفوف.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', {
...look, data: tasks, links, resources, workdaysOnly: true,
columns: ['name', 'start', 'end', 'duration', 'progress', 'resources'],
showWBS: true,
dateFormat: 'DD.MM.YYYY',
gridWidth: 520,
});ما يعرضه الجدول الزمني
خطوط الأساس (التواريخ المخططة) أسفل الأشرطة، وعطلات نهاية الأسبوع، ووضع التركيز: انقر على Build لتعتيم كل ما هو خارج سلسلة تبعياته، وانقر عليه مرة أخرى للخروج.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
tasks[1].baselineStart = '2026-10-26'; tasks[1].baselineEnd = '2026-10-27';
tasks[3].baselineStart = '2026-10-28'; tasks[3].baselineEnd = '2026-11-02';
tasks[4].baselineStart = '2026-11-03'; tasks[4].baselineEnd = '2026-11-04';
const gantt = VibeFoxJSGantt.createGantt('#app', {
...look, data: tasks, links, resources, workdaysOnly: true,
showBaseline: true,
weekendHighlight: true,
todayLine: true,
focusMode: true,
});خط التقدم ومنحنى S وPERT
يُظهر خط التقدم، انطلاقاً من تاريخ الحالة 30 أكتوبر، المهام المتأخرة (إلى اليسار) أو المتقدمة. بدّل العرض إلى شبكة PERT أو منحنى S.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const gantt = VibeFoxJSGantt.createGantt('#app', {
...look, data: tasks, links, resources, workdaysOnly: true,
showProgressLine: true,
statusDate: '2026-10-30',
});
const view = document.createElement('select');
for (const v of ['gantt', 'pert', 'scurve']) view.add(new Option(v));
view.onchange = () => gantt.setView(view.value);
bar.append('View: ', view);التصفية والفرز والبحث
اعرض مهام شخص واحد فقط (تبقى مهمته الملخّصة كسياق)، أو رتّب حسب عمود، أو ابحث في الأسماء: تُبرز الصفوف التي يُعثر عليها.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true });
const who = document.createElement('select');
for (const r of ['all', 'ann', 'bob', 'eva']) who.add(new Option(r));
who.onchange = () => (who.value === 'all' ? gantt.clearFilter()
: gantt.setFilter((t) => (t.resources || []).some((r) => r.id === who.value), { showAncestors: true }));
const sort = document.createElement('select');
for (const f of ['none', 'start', 'duration', 'name']) sort.add(new Option(f));
sort.onchange = () => (sort.value === 'none' ? gantt.clearSort() : gantt.setSort(sort.value, 'asc'));
const find = document.createElement('input');
find.placeholder = 'Search';
find.oninput = () => (find.value ? gantt.search(find.value) : gantt.clearSearch());
bar.append('Resource: ', who, ' Sort: ', sort, ' ', find);سيناريوهات «ماذا لو»
يقلّص سيناريو «Faster build» مدة Build إلى يومين ويعيد جدولة الخطة دون المساس بالخطة الرئيسية؛ تُظهر الأشرطة الشبحية الخطة الرئيسية، والخط أسفل المخطط يُظهر الفرق. بدّل بين الخطط.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const out = document.createElement('p');
document.getElementById('app').after(out);
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true });
const s = gantt.createScenario('Faster build', { activate: true });
gantt.updateTask(4, { duration: 2 });
gantt.scheduleProject({ compact: true }); // successors move earlier too
const diff = gantt.compareScenario(s.id);
out.textContent = 'Project end: ' + diff.projectEnd[0] + ' → ' + diff.projectEnd[1] + ' (' + diff.projectEndDelta + ' working days)';
button('Main plan', () => { gantt.setActiveScenario(null); gantt.clearComparison(); });
button('Faster build', () => { gantt.setActiveScenario(s.id); gantt.compareScenario(s.id); });المزامنة مع الخادم
يحمّل مدير CRUD الخطة ويرسل كل تغيير ضمن دفعة واحدة؛ والخادم هنا دالة وهمية في المثال (transport)، لذلك تُعرض الطلبات أسفل المخطط. حرّك شريطاً أو أضف مهمة.
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const out = document.createElement('p');
document.getElementById('app').after(out);
// a stub server instead of fetch(): a real app gives url: '/api/plan'
let nextId = 100;
const server = async (req) => {
if (req.type === 'load') {
return { status: 200, data: { success: true, revision: 1,
tasks: { rows: [
{ id: 1, name: 'Design', start: '2026-10-26', end: '2026-10-28' },
{ id: 2, name: 'Build', start: '2026-10-29', end: '2026-11-03' },
] },
dependencies: { rows: [{ id: 1, from: 1, to: 2, type: 'FS' }] } } };
}
const body = JSON.parse(req.body);
const t = body.tasks || {};
out.textContent = 'POST sync: ' + (t.added || []).length + ' added, ' + (t.updated || []).length + ' updated, ' + (t.removed || []).length + ' removed';
const rows = (t.added || []).map((r) => ({ $PhantomId: r.$PhantomId, id: nextId++ }));
if (rows.length) out.textContent += '; server ids ' + rows.map((r) => r.id).join(', ');
return { status: 200, data: { success: true, revision: body.revision + 1, tasks: { rows } } };
};
const gantt = VibeFoxJSGantt.createGantt('#app', {
workdaysOnly: true,
columns: ['name', 'duration'], gridWidth: 290,
crud: { transport: server, autoLoad: true, autoSyncDelay: 300 },
});
gantt.getCrudManager().on('syncStatusChange', (e) => { bar.lastChild.textContent = ' Status: ' + e.status; });
button('Add task', () => gantt.addTask({ name: 'New task', start: '2026-11-04', duration: 2 }));
bar.append(' Status: idle');المساعد
يفهم المساعد الأوامر دون اتصال بالشبكة. هنا يُعرض الأمر «move Build by 2 days» كمعاينة بأشرطة شبحية؛ انقر على ✦ في شريط الأدوات لرؤية الرد مع زرَّي Apply وCancel، أو اكتب أمرك الخاص، مثلاً «add task Docs 3 days after Testing».
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, assistant: true });
gantt.ask('move Build by 2 days'); // a preview: confirmAssistant() applies it, cancelAssistant() drops itالخطط الكبيرة
10٬000 مهمة في 500 مجموعة مع روابط: لا يُرسم إلا الصفوف المرئية والجزء المرئي من الجدول الزمني. مرّر الجدول أو المخطط.
const data = [];
const links = [];
for (let g = 0; g < 500; g++) {
const parent = g * 20 + 1;
data.push({ id: parent, name: 'Group ' + (g + 1) });
for (let i = 1; i < 20; i++) {
const id = parent + i;
const day = 2 + ((g * 3 + i * 2) % 26);
data.push({ id, name: 'Task ' + id, parent, start: '2026-10-' + String(day).padStart(2, '0'), duration: 1 + (i % 4), progress: (i * 13) % 100 });
if (i > 1 && i % 3) links.push({ from: id - 1, to: id });
}
}
const gantt = VibeFoxJSGantt.createGantt('#app', {
data, links, virtualize: true, autoSchedule: false,
columns: ['name', 'duration'], gridWidth: 290,
});Scheduler: العروض والأحداث
العروض والتنقل
عرض الشهر مع خريطة حرارية للأيام المزدحمة. بدّل العرض والفترة من شريط الأدوات: month، week، day، agenda، year.
const events = [
{ id: 1, title: 'Stand-up', start: '2026-11-02 09:00', end: '2026-11-02 09:30', rrule: 'FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR' },
{ id: 2, title: 'Design review', start: '2026-11-03 11:00', end: '2026-11-03 12:30', color: 'green' },
{ id: 3, title: 'Client call', start: '2026-11-04 14:00', end: '2026-11-04 15:00', color: 'orange' },
{ id: 4, title: 'Workshop', start: '2026-11-05 10:00', end: '2026-11-05 13:00', color: 'purple' },
{ id: 5, title: 'Release', start: '2026-11-06', end: '2026-11-06', allDay: true, color: 'red' },
];
const calendar = VibeFoxJSGantt.createScheduler('#app', {
view: 'month',
date: '2026-11-04',
data: events,
showHeat: true,
views: ['month', 'week', 'day', 'agenda', 'year'],
});الأحداث
اسحب في فترة فارغة لإنشاء حدث، واسحب الحدث لنقله، واسحب حافته السفلية لتغيير حجمه، وانقر عليه لتحريره. يُعرض آخر تغيير أسفل التقويم.
const events = [
{ id: 1, title: 'Stand-up', start: '2026-11-02 09:00', end: '2026-11-02 09:30', rrule: 'FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR' },
{ id: 2, title: 'Design review', start: '2026-11-03 11:00', end: '2026-11-03 12:30', color: 'green' },
{ id: 3, title: 'Client call', start: '2026-11-04 14:00', end: '2026-11-04 15:00', color: 'orange' },
{ id: 4, title: 'Workshop', start: '2026-11-05 10:00', end: '2026-11-05 13:00', color: 'purple' },
{ id: 5, title: 'Release', start: '2026-11-06', end: '2026-11-06', allDay: true, color: 'red' },
];
const out = document.createElement('p');
document.getElementById('app').after(out);
const calendar = VibeFoxJSGantt.createScheduler('#app', {
view: 'week',
date: '2026-11-04',
data: events,
editable: true,
snapMinutes: 30,
dayStart: 8,
dayEnd: 18,
});
calendar.on('eventCreate', (e) => { out.textContent = 'eventCreate: ' + e.event.start + ' – ' + e.event.end; });
calendar.on('eventChange', (e) => { if (e.event) out.textContent = 'eventChange: ' + e.event.title + ' ' + e.event.start + ' – ' + e.event.end + ' (' + e.source + ')'; });الإضافة السريعة والفترات الحرة والتعارضات
يتداخل حدثان يوم الأربعاء ويحصلان على شارات التعارض. اكتب حدثاً في حقل الإضافة السريعة في شريط الأدوات، مثلاً «Lunch 12:00-13:00 #green»، أو ابحث عن أول ساعة فارغة.
const events = [
{ id: 1, title: 'Stand-up', start: '2026-11-02 09:00', end: '2026-11-02 09:30', rrule: 'FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR' },
{ id: 2, title: 'Design review', start: '2026-11-03 11:00', end: '2026-11-03 12:30', color: 'green' },
{ id: 3, title: 'Client call', start: '2026-11-04 14:00', end: '2026-11-04 15:00', color: 'orange' },
{ id: 4, title: 'Workshop', start: '2026-11-05 10:00', end: '2026-11-05 13:00', color: 'purple' },
{ id: 5, title: 'Release', start: '2026-11-06', end: '2026-11-06', allDay: true, color: 'red' },
];
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const out = document.createElement('p');
document.getElementById('app').after(out);
events.push({ id: 6, title: 'Budget', start: '2026-11-04 14:30', end: '2026-11-04 15:30', color: 'teal' });
const calendar = VibeFoxJSGantt.createScheduler('#app', {
view: 'week', date: '2026-11-04', data: events, dayStart: 8, dayEnd: 18,
quickAdd: true,
showConflicts: true,
});
button('Find a free hour', () => {
const slot = calendar.findFreeSlot(60, { from: '2026-11-04', withinDays: 5 });
out.textContent = slot ? 'Free: ' + slot.start + ' – ' + slot.end : 'No free slot';
});Scheduler: التكرار والمناطق الزمنية
الأحداث المتكررة
اجتماع مجلس الإدارة في ثاني يوم اثنين من كل شهر، ومزامنة أسبوعية يومي الثلاثاء والخميس بلا تاريخ واحد، واجتماع متابعة يومي. انقر على مثيل لتغييره: هذا المثيل فقط أو المثيلات التي تليه.
const calendar = VibeFoxJSGantt.createScheduler('#app', {
view: 'month',
date: '2026-11-04',
data: [
{ id: 'board', title: 'Board', start: '2026-11-09 10:00', end: '2026-11-09 12:00', rrule: { freq: 'monthly', byDay: '2MO', count: 10 }, color: 'purple' },
{ id: 'sync', title: 'Sync', start: '2026-11-03 15:00', end: '2026-11-03 15:30', rrule: 'FREQ=WEEKLY;BYDAY=TU,TH', exdate: ['2026-11-19 15:00'], color: 'teal' },
{ id: 'check', title: 'Check-in', start: '2026-11-16 09:00', end: '2026-11-16 09:15', rrule: 'FREQ=DAILY;COUNT=5', color: 'orange' },
],
recurrenceEditMode: 'ask',
});المناطق الزمنية
يُعرض التقويم بتوقيت برلين، مع مقياس ساعات ثانٍ لنيويورك؛ تُخزَّن المكالمة بتوقيت نيويورك وتظهر في ساعة برلين الصحيحة.
const calendar = VibeFoxJSGantt.createScheduler('#app', {
view: 'week',
date: '2026-11-04',
timeZone: 'Europe/Berlin',
secondTimeZone: 'America/New_York',
dayStart: 8,
dayEnd: 20,
data: [
{ id: 1, title: 'Team meeting', start: '2026-11-03 10:00', end: '2026-11-03 11:00' },
{ id: 2, title: 'Call with New York', start: '2026-11-04 10:00', end: '2026-11-04 11:00', timeZone: 'America/New_York', color: 'orange' },
],
});Scheduler: الموارد والجدول الزمني
عرض الجدول الزمني: صف واحد لكل مورد، مجمّعة حسب الفريق؛ Ann في إجازة يوم الجمعة (مُظلَّل). اسحب حدثاً إلى صف آخر لإسناده إلى مورد آخر.
const calendar = VibeFoxJSGantt.createScheduler('#app', {
view: 'timeline',
date: '2026-11-04',
timelineScale: 'week',
resourceGroupBy: 'team',
resources: [
{ id: 'r1', name: 'Room A', team: 'Rooms' },
{ id: 'r2', name: 'Room B', team: 'Rooms' },
{ id: 'ann', name: 'Ann', team: 'People', unavailable: [{ start: '2026-11-06', name: 'Vacation' }] },
{ id: 'bob', name: 'Bob', team: 'People' },
],
data: [
{ id: 1, title: 'Workshop', start: '2026-11-03 10:00', end: '2026-11-03 16:00', resource: ['r1', 'ann'] },
{ id: 2, title: 'Interviews', start: '2026-11-04 09:00', end: '2026-11-04 17:00', resource: 'r2', color: 'green' },
{ id: 3, title: 'Training', start: '2026-11-05 09:00', end: '2026-11-05 17:00', resource: 'bob', color: 'orange' },
],
});التقويمات المشتركة مع Gantt
يتبع Scheduler أسفل الخطة تقاويم Gantt: تُظلَّل العطلة يوم 28 أكتوبر في الموضعين، ويتخطاها Planning. وتظهر العطلات المضافة إلى Gantt في Scheduler أيضاً.
const app = document.getElementById('app');
const plan = document.createElement('div');
const week = document.createElement('div');
plan.style.height = '160px';
app.append(plan, week);
const gantt = VibeFoxJSGantt.createGantt(plan, {
data: [
{ id: 1, name: 'Planning', start: '2026-10-26', duration: 3 },
{ id: 2, name: 'Build', start: '2026-10-29', duration: 4 },
],
links: [{ from: 1, to: 2 }],
workdaysOnly: true,
holidays: [{ date: '2026-10-28', name: 'Company day' }],
columns: ['name', 'duration'], gridWidth: 290,
});
const calendar = VibeFoxJSGantt.createScheduler(week, {
view: 'week', date: '2026-10-28', dayStart: 8, dayEnd: 14,
data: [{ id: 1, title: 'Planning meeting', start: '2026-10-27 09:00', end: '2026-10-27 10:30' }],
});
calendar.useGanttCalendars(gantt, { follow: true, resources: true });Scheduler: الاستيراد والتصدير والطباعة
تُقرأ الأحداث من نص iCalendar باستخدام importICS()، بما في ذلك قاعدة أسبوعية؛ وتصدّر الأزرار التقويم كملف .ics أو PNG أو PDF.
const bar = document.createElement('p');
document.getElementById('app').before(bar);
const button = (label, onclick) => { const b = document.createElement('button'); b.textContent = label; b.onclick = onclick; bar.append(b, ' '); };
const calendar = VibeFoxJSGantt.createScheduler('#app', { view: 'week', date: '2026-11-04', dayStart: 8, dayEnd: 18 });
const ics = [
'BEGIN:VCALENDAR', 'VERSION:2.0', 'PRODID:-//Example//EN',
'BEGIN:VEVENT', 'UID:1@example', 'SUMMARY:Planning', 'DTSTART:20261102T100000', 'DTEND:20261102T113000',
'RRULE:FREQ=WEEKLY;BYDAY=MO', 'END:VEVENT',
'BEGIN:VEVENT', 'UID:2@example', 'SUMMARY:Customer visit', 'DTSTART:20261104T130000', 'DTEND:20261104T160000', 'END:VEVENT',
'END:VCALENDAR',
].join('\r\n');
calendar.importICS(ics);
button('Export .ics', () => calendar.exportICS('week.ics'));
button('Export PNG', () => calendar.exportPNG('week.png'));
button('Export PDF', () => calendar.exportPDF('week.pdf', { pageSize: 'A4' }));السمات والأنماط
السمات
اختر سمة من القائمة فوق المخطط: السمات المدمجة الفاتحة والداكنة وعالية التباين، أو سمة من vibefox-js-themes.css (مرتبطة هنا).
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, showCriticalPath: true });
const picker = document.createElement('select');
for (const name of ['light', 'dark', 'high-contrast', 'paper', 'ocean', 'forest', 'sunset', 'glass', 'graphite-dark']) picker.add(new Option(name));
picker.onchange = () => gantt.setTheme(picker.value);
document.getElementById('app').before(picker);متغيرات CSS
صفوف أطول، ورأس ملوّن، وأشرطة خضراء، ومسار حرج أحمر، مُعيَّنة كمتغيرات CSS لهذا المخطط فقط (في style لعنصره؛ وتعمل قاعدة CSS للعنصر بالطريقة نفسها).
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
document.getElementById('app').style.cssText = `
--vfjs-gantt-row-height: 40px;
--vfjs-gantt-header-bg: #1e3a8a;
--vfjs-gantt-header-fg: #ffffff;
--vfjs-gantt-scale-fg: #ffffff;
--vfjs-gantt-bar-bg: #16a34a;
--vfjs-gantt-critical: #dc2626;`;
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, showCriticalPath: true });الأنماط الجاهزة
اختر أحد الأنماط الجاهزة الخمسة؛ يعمل كل نمط مع كل سمة وكثافة.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, style: 'rounded' });
const picker = document.createElement('select');
for (const name of VibeFoxJSGantt.GANTT_STYLES) picker.add(new Option(name));
picker.value = 'rounded';
picker.onchange = () => gantt.setOptions({ style: picker.value });
document.getElementById('app').before(picker);الكثافة والحجم
بدّل كثافة الحاوية: صفوف وحشوات مضغوطة أو عادية أو مريحة.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const app = document.getElementById('app');
app.setAttribute('data-vfjs-density', 'compact');
const gantt = VibeFoxJSGantt.createGantt(app, { ...look, data: tasks, links, resources, workdaysOnly: true });
const picker = document.createElement('select');
for (const name of ['compact', 'normal', 'comfortable']) picker.add(new Option(name));
picker.onchange = () => app.setAttribute('data-vfjs-density', picker.value);
app.before(picker);التوطين ودعم RTL
اللغات
الروسية من حزمة اللغة vibefox-js-gantt.ru.js، تُحمَّل بعد المكتبة: عناوين الجدول ومقياس الزمن وشريط الأدوات. بدّل اللغة من القائمة.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, locale: 'ru' });
const picker = document.createElement('select');
for (const name of ['ru', 'en']) picker.add(new Option(name));
picker.onchange = () => gantt.setOptions({ locale: picker.value });
document.getElementById('app').before(picker);من اليمين إلى اليسار
مع rtl: true يكون الجدول على اليمين، ويمتد الجدول الزمني من اليمين إلى اليسار.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, rtl: true });إمكانية الوصول
لوحة المفاتيح
انقر على صف، ثم استخدم المفاتيح: ↑ ↓ لاختيار مهمة، و→ ← للتوسيع والطي، وEnter لفتح المحرر. انتقل بـ Tab إلى الجدول الزمني: ← → لتحريك الشريط، وShift+← → لتغيير نهايته، ويبدأ المفتاح L رابطاً.
const tasks = [
{ id: 1, name: 'Website' },
{ id: 2, name: 'Design', parent: 1, start: '2026-10-26', duration: 3, progress: 100, resources: ['ann'] },
{ id: 3, name: 'Content', parent: 1, start: '2026-10-26', duration: 4, progress: 50, resources: ['eva'] },
{ id: 4, name: 'Build', parent: 1, start: '2026-10-29', duration: 4, progress: 25, resources: ['bob'] },
{ id: 5, name: 'Testing', parent: 1, start: '2026-11-04', duration: 2, resources: ['eva'] },
{ id: 6, name: 'Launch', parent: 1, start: '2026-11-06', type: 'milestone' },
];
const links = [{ from: 2, to: 4 }, { from: 4, to: 5 }, { from: 3, to: 5 }, { from: 5, to: 6 }];
const resources = [{ id: 'ann', name: 'Ann' }, { id: 'bob', name: 'Bob' }, { id: 'eva', name: 'Eva' }];
const look = { columns: ['name', 'duration'], gridWidth: 290 }; // a narrow table
const gantt = VibeFoxJSGantt.createGantt('#app', { ...look, data: tasks, links, resources, workdaysOnly: true, keyboard: true });