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

Global viewGenerator included in default config object #131

Merged
merged 3 commits into from
Oct 14, 2018
Merged

Global viewGenerator included in default config object #131

merged 3 commits into from
Oct 14, 2018

Conversation

LonelyPrincess
Copy link
Collaborator

As described in #130 , the viewGenerator function value was been ignored when it was set in the Graph config object. This was probably due to the fact that the config object is not stored as it comes, since its properties are filtered to match only those which exists in the default config object.

This PR addresses this issue, and now it's possible to successfully add a high level viewGenerator function without having to override its value for every node in the graph.

When installing the library in a project, the `viewGenerator` function
defined in the config object by the user did have no effect. The reason
for this was that properties not included in the default config object
(graph.config.js) were been ignored when building the graph and
rendering it in the browser.

In order to solve this issue, a `viewGenerator` property is now included
in the default config object, with an initial value of `null`.
The current sandbox example created a form that allowed all of the
available config properties to be customized in real time.

The `viewGenerator` property, though, cannot be customized with a form.
Since its value must be a function, the user cannot set it via a form
field.

Also, the fact that it's initialized to null made some of the sandbox
examples to throw an error because the form schema generator doesn't
support neither null or undefined values. Functions are not allowed
either, and in this case an error would appear on screen by saying that
this type of data is not supported.

The current change filters the config elements so that neither null,
undefined or function values are included in the config form.
Copy link
Owner

@danielcaldas danielcaldas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thanks for this @LonelyPrincess

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

Successfully merging this pull request may close these issues.

None yet

2 participants