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

adding missing "undefined" default values #1732

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adding missing "undefined" default values
many parameters were missing the "undefined" default value, which throws an error when such a value is passed through
nickchomey authored Mar 25, 2022
commit ffc748fd13c10831565cef546fef2750ae9dbfc3
44 changes: 22 additions & 22 deletions lib/network/options.ts
Original file line number Diff line number Diff line change
@@ -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" },