{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Tips\n", "\n", "本章ではAmplify Schedの機能の詳細を扱います。" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from amplify_sched import *\n", "import datetime\n", "\n", "token = \"xxxxxxxxxxxxxxxxxxxxxxxxx\"" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 日時指定\n", "\n", "スケジュールの開始日時と各処理時間を実時間を単位として指定できます。\n", "\n", "下記ではスケジュールの開始日時を2023年5月1日、処理時間の単位を15分に設定しています。" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T11:30:00", "2023-05-01T19:00:00" ], "customdata": [ [ "Job A", 0 ], [ "Job A", 1 ], [ "Job A", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job A", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "Job A", "offsetgroup": "Job A", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine X", "Machine Y", "Machine Z" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T14:00:00", "2023-05-01T19:00:00" ], "customdata": [ [ "Job B", 0 ], [ "Job B", 1 ], [ "Job B", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job B", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "Job B", "offsetgroup": "Job B", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine Y", "Machine Z", "Machine X" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T11:30:00", "2023-05-01T21:30:00" ], "customdata": [ [ "Job C", 0 ], [ "Job C", 1 ], [ "Job C", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job C", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "Job C", "offsetgroup": "Job C", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine Z", "Machine X", "Machine Y" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T11:30:00", "2023-05-01T16:30:00", "2023-05-01T22:45:00" ], "customdata": [ [ "Job D", 0 ], [ "Job D", 1 ], [ "Job D", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job D", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "Job D", "offsetgroup": "Job D", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine Z", "Machine Y", "Machine X" ], "yaxis": "y" } ], "layout": { "barmode": "overlay", "legend": { "title": { "text": "Job" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "type": "date" }, "yaxis": { "anchor": "x", "categoryarray": [ "Machine Z", "Machine Y", "Machine X" ], "categoryorder": "array", "domain": [ 0, 1 ], "title": { "text": "Machine" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "model = Model()\n", "model.start = datetime.datetime(2023, 5, 1, 9, 0, 0)\n", "model.time_unit = datetime.timedelta(minutes=15)\n", "\n", "model.jobs.add(\"Job A\")\n", "model.jobs.add(\"Job B\")\n", "model.jobs.add(\"Job C\")\n", "model.jobs.add(\"Job D\")\n", "\n", "model.machines.add(\"Machine X\")\n", "model.machines.add(\"Machine Y\")\n", "model.machines.add(\"Machine Z\")\n", "\n", "model.jobs[\"Job A\"].append(Task())\n", "model.jobs[\"Job A\"][0].processing_times[\"Machine X\"] = 10\n", "model.jobs[\"Job A\"].append(Task())\n", "model.jobs[\"Job A\"][1].processing_times[\"Machine Y\"] = 20\n", "model.jobs[\"Job A\"].append(Task())\n", "model.jobs[\"Job A\"][2].processing_times[\"Machine Z\"] = 15\n", "\n", "model.jobs[\"Job B\"].append(Task())\n", "model.jobs[\"Job B\"][0].processing_times[\"Machine Y\"] = 10\n", "model.jobs[\"Job B\"].append(Task())\n", "model.jobs[\"Job B\"][1].processing_times[\"Machine Z\"] = 20\n", "model.jobs[\"Job B\"].append(Task())\n", "model.jobs[\"Job B\"][2].processing_times[\"Machine X\"] = 15\n", "\n", "model.jobs[\"Job C\"].append(Task())\n", "model.jobs[\"Job C\"][0].processing_times[\"Machine Z\"] = 10\n", "model.jobs[\"Job C\"].append(Task())\n", "model.jobs[\"Job C\"][1].processing_times[\"Machine X\"] = 20\n", "model.jobs[\"Job C\"].append(Task())\n", "model.jobs[\"Job C\"][2].processing_times[\"Machine Y\"] = 15\n", "\n", "model.jobs[\"Job D\"].append(Task())\n", "model.jobs[\"Job D\"][0].processing_times[\"Machine Z\"] = 10\n", "model.jobs[\"Job D\"].append(Task())\n", "model.jobs[\"Job D\"][1].processing_times[\"Machine Y\"] = 20\n", "model.jobs[\"Job D\"].append(Task())\n", "model.jobs[\"Job D\"][2].processing_times[\"Machine X\"] = 15\n", "\n", "gantt = model.solve(token=token, timeout=1)\n", "gantt.timeline(machine_view=True)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## ガントチャート\n", "\n", "得られたスケジュールをガントチャートで表示できます。ガントチャートは[`plotly.graph_objs.Figure`](https://plotly.com/python-api-reference/generated/plotly.graph_objects.Figure.html)を用いて出力します。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 縦軸をJob名で描画" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T19:00:00", "2023-05-01T11:30:00", "2023-05-01T22:45:00" ], "customdata": [ [ "Machine X", 0 ], [ "Machine X", 2 ], [ "Machine X", 1 ], [ "Machine X", 2 ] ], "hovertemplate": "Machine=%{customdata[0]}
Start=%{base}
Finish=%{x}
Job=%{y}
Process=%{customdata[1]}", "legendgroup": "Machine X", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "Machine X", "offsetgroup": "Machine X", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 13500000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Job A", "Job B", "Job C", "Job D" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T11:30:00", "2023-05-01T09:00:00", "2023-05-01T21:30:00", "2023-05-01T16:30:00" ], "customdata": [ [ "Machine Y", 1 ], [ "Machine Y", 0 ], [ "Machine Y", 2 ], [ "Machine Y", 1 ] ], "hovertemplate": "Machine=%{customdata[0]}
Start=%{base}
Finish=%{x}
Job=%{y}
Process=%{customdata[1]}", "legendgroup": "Machine Y", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "Machine Y", "offsetgroup": "Machine Y", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 18000000, 9000000, 13500000, 18000000 ], "xaxis": "x", "y": [ "Job A", "Job B", "Job C", "Job D" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T19:00:00", "2023-05-01T14:00:00", "2023-05-01T09:00:00", "2023-05-01T11:30:00" ], "customdata": [ [ "Machine Z", 2 ], [ "Machine Z", 1 ], [ "Machine Z", 0 ], [ "Machine Z", 0 ] ], "hovertemplate": "Machine=%{customdata[0]}
Start=%{base}
Finish=%{x}
Job=%{y}
Process=%{customdata[1]}", "legendgroup": "Machine Z", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "Machine Z", "offsetgroup": "Machine Z", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 13500000, 18000000, 9000000, 9000000 ], "xaxis": "x", "y": [ "Job A", "Job B", "Job C", "Job D" ], "yaxis": "y" } ], "layout": { "barmode": "overlay", "legend": { "title": { "text": "Machine" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "type": "date" }, "yaxis": { "anchor": "x", "categoryarray": [ "Job D", "Job C", "Job B", "Job A" ], "categoryorder": "array", "domain": [ 0, 1 ], "title": { "text": "Job" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gantt.timeline()" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 縦軸をMachine名で描画" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T11:30:00", "2023-05-01T19:00:00" ], "customdata": [ [ "Job A", 0 ], [ "Job A", 1 ], [ "Job A", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job A", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "Job A", "offsetgroup": "Job A", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine X", "Machine Y", "Machine Z" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T14:00:00", "2023-05-01T19:00:00" ], "customdata": [ [ "Job B", 0 ], [ "Job B", 1 ], [ "Job B", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job B", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "Job B", "offsetgroup": "Job B", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine Y", "Machine Z", "Machine X" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T11:30:00", "2023-05-01T21:30:00" ], "customdata": [ [ "Job C", 0 ], [ "Job C", 1 ], [ "Job C", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job C", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "Job C", "offsetgroup": "Job C", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine Z", "Machine X", "Machine Y" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T11:30:00", "2023-05-01T16:30:00", "2023-05-01T22:45:00" ], "customdata": [ [ "Job D", 0 ], [ "Job D", 1 ], [ "Job D", 2 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "Job D", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "Job D", "offsetgroup": "Job D", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 18000000, 13500000 ], "xaxis": "x", "y": [ "Machine Z", "Machine Y", "Machine X" ], "yaxis": "y" } ], "layout": { "barmode": "overlay", "legend": { "title": { "text": "Job" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "type": "date" }, "yaxis": { "anchor": "x", "categoryarray": [ "Machine Z", "Machine Y", "Machine X" ], "categoryorder": "array", "domain": [ 0, 1 ], "title": { "text": "Machine" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gantt.timeline(machine_view=True)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Processごとに分けて描画" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00" ], "customdata": [ [ "Machine X", 0 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine X", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "Machine X", "offsetgroup": "Machine X", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000 ], "xaxis": "x3", "y": [ "Job A" ], "yaxis": "y3" }, { "alignmentgroup": "True", "base": [ "2023-05-01T11:30:00" ], "customdata": [ [ "Machine X", 1 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine X", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "Machine X", "offsetgroup": "Machine X", "orientation": "h", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 18000000 ], "xaxis": "x2", "y": [ "Job C" ], "yaxis": "y2" }, { "alignmentgroup": "True", "base": [ "2023-05-01T19:00:00", "2023-05-01T22:45:00" ], "customdata": [ [ "Machine X", 2 ], [ "Machine X", 2 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine X", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "Machine X", "offsetgroup": "Machine X", "orientation": "h", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 13500000, 13500000 ], "xaxis": "x", "y": [ "Job B", "Job D" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00" ], "customdata": [ [ "Machine Y", 0 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine Y", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "Machine Y", "offsetgroup": "Machine Y", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000 ], "xaxis": "x3", "y": [ "Job B" ], "yaxis": "y3" }, { "alignmentgroup": "True", "base": [ "2023-05-01T11:30:00", "2023-05-01T16:30:00" ], "customdata": [ [ "Machine Y", 1 ], [ "Machine Y", 1 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine Y", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "Machine Y", "offsetgroup": "Machine Y", "orientation": "h", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 18000000, 18000000 ], "xaxis": "x2", "y": [ "Job A", "Job D" ], "yaxis": "y2" }, { "alignmentgroup": "True", "base": [ "2023-05-01T21:30:00" ], "customdata": [ [ "Machine Y", 2 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine Y", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "Machine Y", "offsetgroup": "Machine Y", "orientation": "h", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 13500000 ], "xaxis": "x", "y": [ "Job C" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ "2023-05-01T09:00:00", "2023-05-01T11:30:00" ], "customdata": [ [ "Machine Z", 0 ], [ "Machine Z", 0 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine Z", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "Machine Z", "offsetgroup": "Machine Z", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 9000000, 9000000 ], "xaxis": "x3", "y": [ "Job C", "Job D" ], "yaxis": "y3" }, { "alignmentgroup": "True", "base": [ "2023-05-01T14:00:00" ], "customdata": [ [ "Machine Z", 1 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine Z", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "Machine Z", "offsetgroup": "Machine Z", "orientation": "h", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 18000000 ], "xaxis": "x2", "y": [ "Job B" ], "yaxis": "y2" }, { "alignmentgroup": "True", "base": [ "2023-05-01T19:00:00" ], "customdata": [ [ "Machine Z", 2 ] ], "hovertemplate": "Machine=%{customdata[0]}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Job=%{y}", "legendgroup": "Machine Z", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "Machine Z", "offsetgroup": "Machine Z", "orientation": "h", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 13500000 ], "xaxis": "x", "y": [ "Job A" ], "yaxis": "y" } ], "layout": { "annotations": [ { "font": {}, "showarrow": false, "text": "Process=2", "textangle": 90, "x": 0.98, "xanchor": "left", "xref": "paper", "y": 0.15666666666666665, "yanchor": "middle", "yref": "paper" }, { "font": {}, "showarrow": false, "text": "Process=1", "textangle": 90, "x": 0.98, "xanchor": "left", "xref": "paper", "y": 0.4999999999999999, "yanchor": "middle", "yref": "paper" }, { "font": {}, "showarrow": false, "text": "Process=0", "textangle": 90, "x": 0.98, "xanchor": "left", "xref": "paper", "y": 0.8433333333333332, "yanchor": "middle", "yref": "paper" } ], "barmode": "overlay", "legend": { "title": { "text": "Machine" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 0.98 ], "type": "date" }, "xaxis2": { "anchor": "y2", "domain": [ 0, 0.98 ], "matches": "x", "showticklabels": false, "type": "date" }, "xaxis3": { "anchor": "y3", "domain": [ 0, 0.98 ], "matches": "x", "showticklabels": false, "type": "date" }, "yaxis": { "anchor": "x", "categoryarray": [ "Job D", "Job C", "Job B", "Job A" ], "categoryorder": "array", "domain": [ 0, 0.3133333333333333 ], "title": { "text": "Job" } }, "yaxis2": { "anchor": "x2", "categoryarray": [ "Job D", "Job C", "Job B", "Job A" ], "categoryorder": "array", "domain": [ 0.34333333333333327, 0.6566666666666665 ], "matches": "y", "title": { "text": "Job" } }, "yaxis3": { "anchor": "x3", "categoryarray": [ "Job D", "Job C", "Job B", "Job A" ], "categoryorder": "array", "domain": [ 0.6866666666666665, 0.9999999999999998 ], "matches": "y", "title": { "text": "Job" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gantt.timeline(separated_by_task=True)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### グラフのサイズを指定して出力する" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "fig = gantt.timeline(height=400, width=1000)\n", "# pngで出力\n", "fig.write_image(\"image/gantt.png\")\n", "# htmlで出力\n", "fig.write_html(\"image/gantt.html\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "scheduling-engine-sdk-IShfnD0Q", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }