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

Function gantt_colorscale

plotly/figure_factory/_gantt.py:256–595  ·  view source on GitHub ↗

Refer to FigureFactory.create_gantt() for docstring

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

Source from the content-addressed store, hash-verified

254
255
256def gantt_colorscale(
257 chart,
258 colors,
259 title,
260 index_col,
261 show_colorbar,
262 bar_width,
263 showgrid_x,
264 showgrid_y,
265 height,
266 width,
267 tasks=None,
268 task_names=None,
269 data=None,
270 group_tasks=False,
271 show_hover_fill=True,
272):
273 """
274 Refer to FigureFactory.create_gantt() for docstring
275 """
276 if tasks is None:
277 tasks = []
278 if task_names is None:
279 task_names = []
280 if data is None:
281 data = []
282 showlegend = False
283
284 for index in range(len(chart)):
285 task = dict(
286 x0=chart[index]["Start"],
287 x1=chart[index]["Finish"],
288 name=chart[index]["Task"],
289 )
290 if "Description" in chart[index]:
291 task["description"] = chart[index]["Description"]
292 tasks.append(task)
293
294 # create a scatter trace for every task group
295 scatter_data_dict = dict()
296 # create scatter traces for the start- and endpoints
297 marker_data_dict = dict()
298
299 if show_hover_fill:
300 hoverinfo = "name"
301 else:
302 hoverinfo = "skip"
303
304 scatter_data_template = {
305 "x": [],
306 "y": [],
307 "mode": "none",
308 "fill": "toself",
309 "showlegend": False,
310 "hoverinfo": hoverinfo,
311 "legendgroup": "",
312 }
313

Callers 1

create_ganttFunction · 0.85

Calls 4

_get_corner_pointsFunction · 0.85
sortMethod · 0.45
keysMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected