Support deriving from DefaultLabelModel #621
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
yarn run pretty
What?
The DefaultLabelModel constructor deviated from pattern followed by the other Default*Model types, where
...options
is merged after the hardcoded values so that derived classes can override the options.Why?
I wanted to derive from DefaultLabelModel and was very confused when it just didn't work, since it had just worked perfectly for DefaultNodeModel.
How?
This change makes it conform to the "...options after defaults" pattern.
Feel good stuff
I have no image handy, but I'd like to say that this library is fantastic. I was a little nervous when I saw the minimal extant documentation, but after looking and the demos and digging into the code I really like it. This feels like the kind of framework that makes you into a better developer by learning it. Thanks to everyone who created it!