Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cde64a2

Browse files
Handles when nograph is specified
1 parent e25dbbd commit cde64a2

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

‎static/js/main.js‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ $(document).ready(function() {
4646
});
4747
} else if ($("#algorithm").val() === "genetic-algorithm") {
4848
var data_tbs = JSON.stringify({
49+
nograph: true,
4950
algorithm: $("#algorithm").val(),
5051
data: $("#data").val(),
5152
nb_machines: $("#nb_machines").val(),
@@ -72,11 +73,19 @@ $(document).ready(function() {
7273
data: data_tbs,
7374
processData: false,
7475
success: function(data, textStatus, jQxhr) {
75-
Plotly.newPlot("gantt", JSON.parse(data["graph"]), {});
76-
$("#sequence").text(data["opt_seq"]);
77-
$("#opt_makespan").text(data["optim_makespan"]);
78-
var time_str = data["t_time"].toString() + " " + data["tt"].toString();
79-
$("#time").text(time_str);
76+
if (data["graph"] === null) {
77+
$("#sequence").text(data["opt_seq"]);
78+
$("#opt_makespan").text(data["optim_makespan"]);
79+
var time_str = data["t_time"].toString() + " " + data["tt"].toString();
80+
$("#time").text(time_str);
81+
} else {
82+
Plotly.newPlot("gantt", JSON.parse(data["graph"]), {});
83+
$("#sequence").text(data["opt_seq"]);
84+
$("#opt_makespan").text(data["optim_makespan"]);
85+
var time_str = data["t_time"].toString() + " " + data["tt"].toString();
86+
$("#time").text(time_str);
87+
}
88+
8089
},
8190
error: function(jQxhr, textStatus, errorThrow) {
8291
console.log(textStatus);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /