MCPcopy Create free account
hub / github.com/plotly/plotly.py / gantt

Function gantt

plotly/figure_factory/_gantt.py:69–253  ·  view source on GitHub ↗

Refer to create_gantt() for docstring

(
    chart,
    colors,
    title,
    bar_width,
    showgrid_x,
    showgrid_y,
    height,
    width,
    tasks=None,
    task_names=None,
    data=None,
    group_tasks=False,
    show_hover_fill=True,
    show_colorbar=True,
)

Source from the content-addressed store, hash-verified

67
68
69def gantt(
70 chart,
71 colors,
72 title,
73 bar_width,
74 showgrid_x,
75 showgrid_y,
76 height,
77 width,
78 tasks=None,
79 task_names=None,
80 data=None,
81 group_tasks=False,
82 show_hover_fill=True,
83 show_colorbar=True,
84):
85 """
86 Refer to create_gantt() for docstring
87 """
88 if tasks is None:
89 tasks = []
90 if task_names is None:
91 task_names = []
92 if data is None:
93 data = []
94
95 for index in range(len(chart)):
96 task = dict(
97 x0=chart[index]["Start"],
98 x1=chart[index]["Finish"],
99 name=chart[index]["Task"],
100 )
101 if "Description" in chart[index]:
102 task["description"] = chart[index]["Description"]
103 tasks.append(task)
104
105 # create a scatter trace for every task group
106 scatter_data_dict = dict()
107 marker_data_dict = dict()
108
109 if show_hover_fill:
110 hoverinfo = "name"
111 else:
112 hoverinfo = "skip"
113
114 scatter_data_template = {
115 "x": [],
116 "y": [],
117 "mode": "none",
118 "fill": "toself",
119 "hoverinfo": hoverinfo,
120 }
121
122 marker_data_template = {
123 "x": [],
124 "y": [],
125 "mode": "markers",
126 "text": [],

Callers 1

create_ganttFunction · 0.85

Calls 1

_get_corner_pointsFunction · 0.85

Tested by

no test coverage detected