From 1cd5d1716a66bad21476b1e8fa7fc1b10aae8892 Mon Sep 17 00:00:00 2001 From: Seulgigi <2021112414@dgu.ac.kr> Date: Thu, 21 Dec 2023 23:28:07 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20line=20number=20=EC=B6=9C=EB=A0=A5?= =?UTF-8?q?=20=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MAPS_Web/dist/frappe-gantt.js | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/MAPS_Web/dist/frappe-gantt.js b/MAPS_Web/dist/frappe-gantt.js index 2cec404..495bf3d 100644 --- a/MAPS_Web/dist/frappe-gantt.js +++ b/MAPS_Web/dist/frappe-gantt.js @@ -543,7 +543,6 @@ var Gantt = (function () { } draw() { - this.draw_number(); this.draw_bar(); this.draw_progress_bar(); this.draw_label(); @@ -597,17 +596,6 @@ var Gantt = (function () { requestAnimationFrame(() => this.update_label_position()); } - // Add grid line number - draw_number() { - createSVG('text', { - x: 15, - y: this.y + this.height / 2, - innerHTML: this.task.id, - class: 'process-num', - append_to: this.bar_group - }); - } - draw_resize_handles() { if (this.invalid) return; @@ -1452,6 +1440,7 @@ var Gantt = (function () { this.make_grid_header(); this.make_grid_ticks(); this.make_grid_highlights(); + this.make_grid_row_number(); } make_grid_background() { @@ -1537,6 +1526,27 @@ var Gantt = (function () { id: 'score' }); } + + // Add line number + make_grid_row_number() { + const rows_layer = createSVG('g', { append_to: this.layers.grid }); + const row_height = this.options.bar_height + this.options.padding; + let row_y = this.options.header_height + this.options.padding + + var count = 1 + for (let task of this.tasks) { + const line_number = createSVG('text', { + x: 15, + y: row_y*0.6 + count * row_height, + class: 'process-num', + append_to: rows_layer + }) + + line_number.textContent = count; + + count = count + 1; + } + } update_score() { var tardiness = tasks.map(otask => { From f037f1313d85c26c5acbaa2006893db27a31aa64 Mon Sep 17 00:00:00 2001 From: Seulgigi <2021112414@dgu.ac.kr> Date: Thu, 21 Dec 2023 23:38:23 +0900 Subject: [PATCH 2/3] feat: many tasks in one row --- MAPS_Web/dist/frappe-gantt.js | 4 ++++ MAPS_Web/index.html | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/MAPS_Web/dist/frappe-gantt.js b/MAPS_Web/dist/frappe-gantt.js index 495bf3d..b7ada7c 100644 --- a/MAPS_Web/dist/frappe-gantt.js +++ b/MAPS_Web/dist/frappe-gantt.js @@ -1237,6 +1237,10 @@ var Gantt = (function () { // cache index task._index = i; + + if (typeof task.machine_index === 'number') { + task._index = task.machine_index; + } // invalid dates if (!task.start && !task.end) { diff --git a/MAPS_Web/index.html b/MAPS_Web/index.html index ed9e6b1..0f4eaab 100644 --- a/MAPS_Web/index.html +++ b/MAPS_Web/index.html @@ -71,6 +71,7 @@