Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should DataGroup model include the treeLevel parameter? #409

Open
clasit opened this issue Oct 29, 2020 · 1 comment
Open

Should DataGroup model include the treeLevel parameter? #409

clasit opened this issue Oct 29, 2020 · 1 comment

Comments

@clasit
Copy link

clasit commented Oct 29, 2020

Prerequisites

ngx-vis (3.1.0) to include the vis-timeline (7.4.2) into an Angular (10.1.2) project.

Current Behavior

I'm using the DataGroup (imported from 'ngx-vis') model to define groups and subgroups, for example:

const groups: DataGroup[] = [{
    id: 1,
    content: 'Parent',
    nestedGroups: [2, 3]
}, {
    id: 2,
    content: 'Child 1'
}, {
    id: 3,
    content: 'Child 2'
}];

Expected Behavior

The model DataGroup should include the treeLevel parameter, which is needed by vis-timeline to render the subgroups properly:

const groups: DataGroup[] = [{
    id: 1,
    content: 'Parent',
    nestedGroups: [2, 3],
    treeLevel: 1
}, {
    id: 2,
    content: 'Child 1',
    treeLevel: 2
}, {
    id: 3,
    content: 'Child 2',
    treeLevel: 2
}];

I don't understand why this parameter lacks in the DataGroup model.

I checked the vis-timeline Documentation for groups, but the treeLevel is not explained.
https://visjs.github.io/vis-timeline/docs/timeline/#groups

@marcortw
Copy link

marcortw commented Jan 3, 2021

Hi @clasit, I just had the same question and it seems like this is now the case. The example from https://github.com/visjs/vis-timeline/blob/master/examples/timeline/groups/nestedThreeLevels.html uses the treeLevel key, and it's not assigned anywhere else. It looks like if we don't supply it, it by default now renders it with an ugly red box around it. Would be nice if that would be explained somewhere, it feels like a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants