From ffc748fd13c10831565cef546fef2750ae9dbfc3 Mon Sep 17 00:00:00 2001 From: nickchomey <88559987+nickchomey@users.noreply.github.com> Date: Fri, 25 Mar 2022 11:19:26 -0600 Subject: [PATCH 1/4] adding missing "undefined" default values many parameters were missing the "undefined" default value, which throws an error when such a value is passed through --- lib/network/options.ts | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/network/options.ts b/lib/network/options.ts index 6c85e3e338..2e4fe9672a 100644 --- a/lib/network/options.ts +++ b/lib/network/options.ts @@ -71,7 +71,7 @@ const nodeOptions: OptionsConfig = { color: { string }, size: { number }, // px face: { string }, - background: { string }, + background: { string, undefined: "undefined" }, strokeWidth: { number }, // px strokeColor: { string }, vadjust: { number }, @@ -112,14 +112,14 @@ const nodeOptions: OptionsConfig = { }, group: { string, number, undefined: "undefined" }, heightConstraint: { - minimum: { number }, + minimum: { number, undefined: "undefined" }, valign: { string }, __type__: { object, boolean: bool, number }, }, hidden: { boolean: bool }, icon: { face: { string }, - code: { string }, //'\uf007', + code: { string, undefined: "undefined" }, //'\uf007', size: { number }, //50, color: { string }, weight: { string, number }, @@ -192,7 +192,7 @@ const nodeOptions: OptionsConfig = { "hexagon", ], }, - ctxRenderer: { function: "function" }, + ctxRenderer: { function: "function", undefined: "undefined" }, shapeProperties: { borderDashes: { boolean: bool, array }, borderRadius: { number }, @@ -206,19 +206,19 @@ const nodeOptions: OptionsConfig = { title: { string, dom, undefined: "undefined" }, value: { number, undefined: "undefined" }, widthConstraint: { - minimum: { number }, - maximum: { number }, + minimum: { number, undefined: "undefined" }, + maximum: { number, undefined: "undefined" }, __type__: { object, boolean: bool, number }, }, - x: { number }, - y: { number }, + x: { number, undefined: "undefined" }, + y: { number, undefined: "undefined" }, __type__: { object }, }; const allOptions: OptionsConfig = { configure: { enabled: { boolean: bool }, filter: { boolean: bool, string, array, function: "function" }, - container: { dom }, + container: { dom, undefined: "undefined" }, showButton: { boolean: bool }, __type__: { object, boolean: bool, string, array, function: "function" }, }, @@ -228,27 +228,27 @@ const allOptions: OptionsConfig = { enabled: { boolean: bool }, scaleFactor: { number }, type: { string: endPoints }, - imageHeight: { number }, - imageWidth: { number }, - src: { string }, + imageHeight: { number, undefined: "undefined" }, + imageWidth: { number, undefined: "undefined" }, + src: { string, undefined: "undefined" }, __type__: { object, boolean: bool }, }, middle: { enabled: { boolean: bool }, scaleFactor: { number }, type: { string: endPoints }, - imageWidth: { number }, - imageHeight: { number }, - src: { string }, + imageWidth: { number, undefined: "undefined" }, + imageHeight: { number, undefined: "undefined" }, + src: { string, undefined: "undefined" }, __type__: { object, boolean: bool }, }, from: { enabled: { boolean: bool }, scaleFactor: { number }, type: { string: endPoints }, - imageWidth: { number }, - imageHeight: { number }, - src: { string }, + imageWidth: { number, undefined: "undefined" }, + imageHeight: { numbe, undefined: "undefined"r }, + src: { string, undefined: "undefined" }, __type__: { object, boolean: bool }, }, __type__: { string: ["from", "to", "middle"], object }, @@ -291,7 +291,7 @@ const allOptions: OptionsConfig = { color: { string }, size: { number }, // px face: { string }, - background: { string }, + background: { string, undefined: "undefined" }, strokeWidth: { number }, // px strokeColor: { string }, align: { string: ["horizontal", "top", "middle", "bottom"] }, @@ -352,7 +352,7 @@ const allOptions: OptionsConfig = { __type__: { object }, }, selectionWidth: { function: "function", number }, - selfReferenceSize: { number }, + selfReferenceSize: { number, boolean: false }, selfReference: { size: { number }, angle: { number }, @@ -393,7 +393,7 @@ const allOptions: OptionsConfig = { title: { string, undefined: "undefined" }, width: { number }, widthConstraint: { - maximum: { number }, + maximum: { number, undefined: "undefined" }, __type__: { object, boolean: bool, number }, }, value: { number, undefined: "undefined" }, @@ -457,7 +457,7 @@ const allOptions: OptionsConfig = { initiallyActive: { boolean: bool }, addNode: { boolean: bool, function: "function" }, addEdge: { boolean: bool, function: "function" }, - editNode: { function: "function" }, + editNode: { function: "function", undefined: "undefined" }, editEdge: { editWithoutDrag: { function: "function" }, __type__: { object, boolean: bool, function: "function" }, From cbed22b3ee0b5b497c57ef13b319865b5eab262d Mon Sep 17 00:00:00 2001 From: nickchomey <88559987+nickchomey@users.noreply.github.com> Date: Sun, 27 Mar 2022 21:58:47 -0600 Subject: [PATCH 2/4] typo --- lib/network/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/network/options.ts b/lib/network/options.ts index 2e4fe9672a..c4c22b77c1 100644 --- a/lib/network/options.ts +++ b/lib/network/options.ts @@ -247,7 +247,7 @@ const allOptions: OptionsConfig = { scaleFactor: { number }, type: { string: endPoints }, imageWidth: { number, undefined: "undefined" }, - imageHeight: { numbe, undefined: "undefined"r }, + imageHeight: { numbe, undefined: "undefined" }, src: { string, undefined: "undefined" }, __type__: { object, boolean: bool }, }, From 5816e48dc9153aa79f5cd3f2fd00fd81ad5be4d1 Mon Sep 17 00:00:00 2001 From: nickchomey <88559987+nickchomey@users.noreply.github.com> Date: Sun, 27 Mar 2022 22:10:02 -0600 Subject: [PATCH 3/4] Update options.ts --- lib/network/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/network/options.ts b/lib/network/options.ts index c4c22b77c1..5375ffd80f 100644 --- a/lib/network/options.ts +++ b/lib/network/options.ts @@ -352,7 +352,7 @@ const allOptions: OptionsConfig = { __type__: { object }, }, selectionWidth: { function: "function", number }, - selfReferenceSize: { number, boolean: false }, + selfReferenceSize: { number, boolean: bool }, selfReference: { size: { number }, angle: { number }, From 912f5deea74080e28c4e97206a1f124e51de33e4 Mon Sep 17 00:00:00 2001 From: nickchomey <88559987+nickchomey@users.noreply.github.com> Date: Sun, 27 Mar 2022 22:15:45 -0600 Subject: [PATCH 4/4] Update options.ts --- lib/network/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/network/options.ts b/lib/network/options.ts index 5375ffd80f..05457a4ff9 100644 --- a/lib/network/options.ts +++ b/lib/network/options.ts @@ -247,7 +247,7 @@ const allOptions: OptionsConfig = { scaleFactor: { number }, type: { string: endPoints }, imageWidth: { number, undefined: "undefined" }, - imageHeight: { numbe, undefined: "undefined" }, + imageHeight: { number, undefined: "undefined" }, src: { string, undefined: "undefined" }, __type__: { object, boolean: bool }, },