Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Timeline: When only having id, Start, End, if added a column with special role, this column will be ignored #44

@winnieshen96

Description

@winnieshen96

My use case is in Timeline chart.
For example, now there are only 3 columns in the dataTable, which is id, Start, and End, and I want to format the color of each data row, so I added a column, specifying {'role': 'style'}, the conversion from python code to js will be successful, but this column will be ignored.
I will have to add another data column, and then this 'style' column will be recognized.
I find it a little confusing, because in the documentation, only three columns are mandatory.

Example bug code:
description = {"id": ("string", "id"), "style": ("string", "style", {'role': 'style'}), "Start": ("datetime", "Start"), "End": ("datetime", "End")}
data = [{"id": "001", "style": 'opacity: 0.5', "Start": datetime(2018, 2, 2, 8, 0, 0), "End": datetime(2018, 2, 2, 8, 30, 0)}, {"id": "001", "style": 'color: #0000cf', "Start": datetime(2018, 2, 2, 8, 30, 0), "End": datetime(2018, 2, 2, 9, 30, 0)}, {"id": "001", "style": 'color: #603913', "Start": datetime(2018, 2, 2, 10, 30, 0), "End": datetime(2018, 2, 2, 11, 30, 0)}, {"id": "002", "style": 'color: #cbb69d', "Start": datetime(2018, 2, 2, 9, 0, 0), "End": datetime(2018, 2, 2, 9, 30, 0)}, {"id": "002", "style": 'color: #603913', "Start": datetime(2018, 2, 2, 11, 30, 0), "End": datetime(2018, 2, 2, 12, 30, 0)}]
This will not work, I will have to add another column in the dataTable.
description = {"id": ("string", "id"), "State": ("string", "State"), "style": ("string", "style", {'role': 'style'}), "Start": ("datetime", "Start"), "End": ("datetime", "End")}

data = [{"id": "001", "State": "Completed", "style": 'opacity: 0.5', "Start": datetime(2018, 2, 2, 8, 0, 0), "End": datetime(2018, 2, 2, 8, 30, 0)}, {"id": "001", "State": "Completed", "style": 'color: #0000cf', "Start": datetime(2018, 2, 2, 8, 30, 0), "End": datetime(2018, 2, 2, 9, 30, 0)}, {"id": "001", "State": "Incompleted", "style": 'color: #603913', "Start": datetime(2018, 2, 2, 10, 30, 0), "End": datetime(2018, 2, 2, 11, 30, 0)}, {"id": "002", "State": "Completed", "style": 'color: #cbb69d', "Start": datetime(2018, 2, 2, 9, 0, 0), "End": datetime(2018, 2, 2, 9, 30, 0)}, {"id": "002", "State": "Incompleted", "style": 'color: #603913', "Start": datetime(2018, 2, 2, 11, 30, 0), "End": datetime(2018, 2, 2, 12, 30, 0)}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions