From 8bc13c7029ad7249da320bab3365c18adca4ba25 Mon Sep 17 00:00:00 2001 From: Airex Date: Wed, 12 Jun 2019 02:23:26 +0300 Subject: [PATCH] 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 --- types/vis/index.d.ts | 4 +++- types/vis/vis-tests.ts | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/types/vis/index.d.ts b/types/vis/index.d.ts index 66542e8263..216f47f212 100644 --- a/types/vis/index.d.ts +++ b/types/vis/index.d.ts @@ -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 { diff --git a/types/vis/vis-tests.ts b/types/vis/vis-tests.ts index b97d35b04a..6b1c47d050 100644 --- a/types/vis/vis-tests.ts +++ b/types/vis/vis-tests.ts @@ -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 = document.getElementById('timeline'); +const timeline = new vis.Timeline(timelineContainer, [], groups); + // // Test code sample from Getting Started http://visjs.org/docs/network/ //