import plotly.figure_factory as ff



df = [
    dict(Task="Viirs base processor", Start='2024-08-01', Finish='2024-09-30', Resource='Complete'),
    dict(Task="Add pytests for already created functions (3-9)", Start='2024-08-01', Finish='2024-12-31', Resource='Complete'),
    dict(Task="Tropomi base processor", Start='2024-08-01', Finish='2025-02-03', Resource='Complete'),
    dict(Task="Tropomi to_plumes functionality (11)", Start='2025-03-01', Finish='2025-03-14', Resource='Not Started'),
    dict(Task="Time evaluation statistics (18)", Start='2024-11-01', Finish='2024-11-28', Resource='Complete'),
    dict(Task="Test DA implementation for VIIRS", Start='2025-03-01', Finish='2025-03-31', Resource='Not Started'),
    dict(Task="Convert Grid representation to numpy from geopandas", Start='2024-12-01', Finish='2024-12-31', Resource="Complete"),
    dict(Task="Creating Grid Config for rotated and regular global grids (14)", Start='2024-11-18', Finish='2025-02-03', Resource='Complete'),
    dict(Task="Add original indices of the data to the outputted netcdf (13)", Start='2025-03-01', Finish='2025-03-07', Resource='Not Started'),
    dict(Task="Add history of processes to the netcdf (10)", Start='2025-01-01', Finish='2025-02-03', Resource='Complete'),
    dict(Task="Update grid representations to include Vertical profiling (20)", Start='2025-04-01', Finish='2025-04-30', Resource='Not Started'),
    dict(Task="Test Viirs data with Providentia Interpolation", Start="2025-03-01", Finish="2025-03-31", Resource="Not Started"),
    dict(Task="Produce Number of counts plots (29)", Start="2025-01-13", Finish="2025-01-20", Resource="Complete"),
    dict(Task="QA flags (23)", Start="2025-01-13", Finish="2025-02-03", Resource="Complete"),
    dict(Task="Finalise netcdf storage output (30)", Start="2025-01-20", Finish="2025-02-03", Resource="Complete"),
    dict(Task="Create conda environment", Start="2025-01-01", Finish="2025-01-14", Resource="Complete"),
    dict(Task="Create Logging file output", Start="2025-02-03", Finish="2025-02-24", Resource="Incomplete"),
    dict(Task="Filter for min number of obs points to be aggregated (32)", Start="2025-02-17", Finish="2025-02-24", Resource="Not Started"),
    dict(Task="Code refactor (41)", Start="2025-02-17", Finish="2025-03-01", Resource="Not Started"),
    dict(Task="Update grid config to be in dataclasses instead of yaml files (40)", Start="2025-02-17", Finish="2025-02-24", Resource="Not Started"),
    dict(Task="Implement process lazy data in Tropomi (50)", Start="2025-02-10", Finish="2025-02-17", Resource="Not Started"),
    dict(Task="Investigate whether we can include Unit Converter used by Providentia/Ghost into code (51)", Start="2025-04-01", Finish="2025-04-10", Resource="Not Started"),
    dict(Task="Fix to_da bug (52)", Start="2025-02-10", Finish="2025-02-17", Resource="Not Started"),
    dict(Task="Error with some datasets outside time range when apply_qa=True bug (49)", Start="2025-02-10", Finish="2025-02-17", Resource="Not Started"),
]



colors = {'Not Started': 'rgb(220, 0, 0)',
          'Incomplete': (1, 0.9, 0.16),
          'Complete': 'rgb(0, 255, 100)'}



fig = ff.create_gantt(df, colors=colors, index_col='Resource', show_colorbar=True,
                      group_tasks=True)



fig.show()