-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rename some things #23
Conversation
lib/NodeGraphEditor.stories.tsx
Outdated
nodeGroups: { | ||
nodeThemes: { | ||
default: { | ||
name: 'Default', | ||
color: '#a1a1a1', | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really the only change I'm concerned about. This restricts the node group config from being used for anything but theming. While that's all it does today, I'm not sure that that will be true forever. Let me noodle on this a bit and see if I can think of any other short-term uses for the node group config that would be restricted by this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe NodeKind or something. Group is used for theme and group is used for input groups inside a node, and soon hopefully, group will mean a group of nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, the naming will be ambiguous with the advent of node groups. I like nodeKinds
and the associated kind
reference from the node configs. I think that solves the ambiguity problem without restricting what we can do with the config in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh... you end up in the examples with things like kind: 'geometry'
should really gets me thinking it does something else. Maybe package is better than kind. Maybe wait until something non theme comes up?
b69f062
to
f47b0f4
Compare
There are still some things I would like to rename... One thing is there are valueTypes and inputTypes but they are intermixed. For example, a valueType could be |
BTW, I tried adding some documentation, but to see what it really looks like, try here: https://github.com/sroussey/ngraph/blob/rename-some-things/DOCUMENTATION.md |
Hm, that's a fascinating idea on valueTypes and inputTypes. I had not considered that idea that multiple input types could be used to produce the same valueType. I don't know that this is just a renaming thing, I think there may be some architectural changes that would need to be made to support an idea like this. For example, if an input has a |
|
b6a8427
to
18faf37
Compare
Here's an idea, can we make the config {
"valueTypes": {
"inputComponent": MyCustomComponent,
"defaultValue": "Foobar"
}
} |
I like that the config can be saved as JSON though |
Something I have found confusing has been that you have the id as a property for a bunch of things:
instead of
[EDIT: actually, I can think of some type system stuff that is easier if setup this way] |
I like the idea of an object of inputs instead of an array of inputs where the key is the id. Are you saying that you can think of type reasons why it's better the way that it is? Or is it better for type reasons to change it to an object. |
Better as it is. |
BTW: I did the rename from theme to kind. |
Is this ready to go? |
Yes. From a review point of view, this is the only gotcha: |
Hm, how do the HTML types work, if there are no corresponding value types registered in the config? |
I noticed some html errors which is why I changed it. The name of the value type makes its way into the HTML. This is good: valueTypes: {
text: {
name: "Text",
defaultValue: "",
color: "blue",
inputEditor: "value",
}, This is wrong valueTypes: {
string: {
name: "Text",
defaultValue: "",
color: "blue",
inputEditor: "value",
}, Really, I think there should be different nodeEditors: Not "value", make make a real list of them. Like string (max length?), number (can have min and max values), date, time, etc. |
Oh, the second one is wrong because it ends up rendering <input type="string"> Which is not valid HTML. Input does not support a type value of string. |
Oh, I just noticed that up above there is |
BTW, the commit 1a7d05f I can remove and we can deal with it later. I meant to create a different PR for it anyhow. |
I'd like to spend some more time thinking through that change before we merge. I'm happy to merge this without it, or we can hold up this PR until I get a chance to look closer. Up to you |
…rate HTML errors" This reverts commit 1a7d05f.
I pulled it and moved it to another so we can merge this one. Probably squash commit... |
I was confused by reuse of various names (nodes, group(s)) and went and renamed them. This would be a breaking change.
nodes for the editor itself stays the same, but nodes for the editor config becomes nodeTypes. group becomes theme in some places and group becomes inputGroup in others.