Vis. Fix DataGroup mappings for nestedGroups, added visible and showNested to DataGroup as described in vis.js documentation (#35965)

* Add support of subgroupStack on DataGroup

* Update index.d.ts

* Update index.d.ts

Added new SubGroupStackOptions dynamic structure and updated type of DataGroup.subgroupStack to SubGroupStackOptions | boolean

* Update index.d.ts

codestyling

* Update index.d.ts

codestyling colon

* Fix DataGroup mappings for nestedGroups, added visible and showNested to DataGroup as described in vis.js documentation

* DataGroup test

* fix redundant line break
This commit is contained in:
Airex
2019-06-11 16:23:26 -07:00
committed by Ron Buckton
parent 58a60415a0
commit 8bc13c7029
2 changed files with 13 additions and 1 deletions
+3 -1
View File
@@ -107,8 +107,10 @@ export interface DataGroup {
style?: string;
subgroupOrder?: string | (() => void);
title?: string;
nestedGroups?: number[];
nestedGroups?: IdType[];
subgroupStack?: SubGroupStackOptions | boolean;
visible?: boolean;
showNested?: boolean;
}
export interface DataGroupOptions {
+10
View File
@@ -147,6 +147,16 @@ const positiveBalance = dataset.get({
}
});
// DataGroup test
const groups = [
{id: "1", content: "group 1", visible: true},
{id: "2", content: "group 2", visible: false},
{id: "3", content: "parent group", nestedGroups: [ "1", "2" ], visible: false, showNested: true}
];
const timelineContainer = <HTMLElement> document.getElementById('timeline');
const timeline = new vis.Timeline(timelineContainer, [], groups);
//
// Test code sample from Getting Started http://visjs.org/docs/network/
//