-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: Split GroupTree into GroupTreePlot-component and settings #1794
feat: Split GroupTree into GroupTreePlot-component and settings #1794
Conversation
83d9ad7
to
51a6107
Compare
Default.args = { | ||
id: "grouptreeplot", | ||
datedTrees: exampleDatedTrees, | ||
edgeMetadataList: edgeMetadataList, | ||
nodeMetadataList: nodeMetadataList, | ||
selectedDateTime: "2018-02-01", | ||
selectedEdgeKey: "oilrate", | ||
selectedNodeKey: "pressure", | ||
}; |
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.
A good improvement would be to use Storybook argTypes for the date, edge and nodes. Eg. the date could be represented by a slider or datepicker, and the edges and nodes by an enum (https://storybook.js.org/docs/api/arg-types#controltype). This would make it easier to test this component.
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.
A fair point, but I all these values depend on structure of datedTrees
, edgeMetadataList
and nodeMetadataList
. If these are changed, the validity of selectedDateTime
, selectedEdgeKey
and selectedNodeKey
can change (i.e. the options for valid selections).
Thereby I'll stick to the basic type of string, with a descriptive comment.
As these are props of type string, I'm afraid the user will not see the connection of selected dates/keys and the actual set of possible keys/dates in the datedTrees and metadata lists.
Unless I misunderstand? If so it would be nice with an example of implementation you think of, to ensure we are on the same page.
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.
I'm not sure if we're talking about the same thing. Not proposing to change the component if that's what you mean.
Just to make the story easier to test you could enhance the controls in the story itself. As an example, you could add something like this:
Default.argTypes = {
selectedDateTime: {
control: "date"
}
selectedEdgeKey: {
control: "select", options: getKeys(edgeMetadataList)
}
}
It's just a suggestion. You can resolve.
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.
Probably not 100% aligned initially. I did not think you proposed to change the component, but I was a bit unsure whether the user will loose sight of how the props actually depend on each other. If adding select where we have a list with preset options, the options might become invalid
when the user interacts with the data.
I've tested your suggestion and it looks very good, but it seems like the options for selectedEdgeKey
and selectedNodeKey
does not update if the edgeMetdataList
and nodeMetadataList
keys are changed. Is it possible to make these be updated after the user changes the keys in the lists? This is one of the examples where the user might change in the ...MetadataList
- or datedTrees
-prop and have invalid options in the selects.
See commit Bug fix and adjust storybook for testing of the storybook adjustment.
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.
Ok, got your point. If you still want to have a try there are some solutions using the useArgs
hook here:
You can resolve.
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.
Approved with one suggestion in the comments 👍
Btw, perhaps we should use the |
Split group-tree and group-tree-plot. - Group-tree into python folder - Have group-tree-plot as a package
- Remove tests and storybooks from dash-component in /python-folder. - Add storybook for group-tree-plot component in new package
Use the id of the divRef rather than props.id. GroupTreeAssembler was created before render if props.id was updated, thereby the id's were not in synch and the boundinRectClient read crashed.
- Handle invalid selected date time for set-methods and Update() - Add overlay and info if invalid date is provided
options does not change dynamically. Want to represent the actual functionality of component
9fb8734
to
8ad3541
Compare
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.
LGTM, good work! Some comments, up to you to adjust or not.
typescript/packages/group-tree-plot/src/GroupTreeAssembler/groupTreeAssembler.js
Outdated
Show resolved
Hide resolved
typescript/packages/group-tree-plot/src/GroupTreeAssembler/groupTreeAssembler.js
Show resolved
Hide resolved
# [0.4.0](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@0.4.0) (2023-12-12) ### Features * Split GroupTree into GroupTreePlot-component and settings ([#1794](#1794)) ([ef07441](ef07441))
🎉 This issue has been resolved in version [email protected] 🎉 The release is available on GitHub release |
# [1.1.0](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@1.1.0) (2023-12-12) ### Features * Split GroupTree into GroupTreePlot-component and settings ([#1794](#1794)) ([ef07441](ef07441))
🎉 This issue has been resolved in version [email protected] 🎉 The release is available on GitHub release |
# [0.11.0](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@0.11.0) (2023-12-12) ### Features * Split GroupTree into GroupTreePlot-component and settings ([#1794](#1794)) ([ef07441](ef07441))
🎉 This issue has been resolved in version [email protected] 🎉 The release is available on GitHub release |
# 1.0.0 (2023-12-12) ### Bug Fixes * audit fix prod dependencies ([#1707](#1707)) ([b5dbcf8](b5dbcf8)) * bump [@deck](https://github.com/deck).gl/core from 8.9.31 to 8.9.32 in /typescript ([#1764](#1764)) ([5ab32b0](5ab32b0)) * bump @equinor/eds-core-react from 0.32.x to 0.33.0 ([#1704](#1704)) ([75c5de8](75c5de8)) * bump @equinor/videx-wellog from 0.8.0 to 0.8.1 in /typescript ([#1811](#1811)) ([0e6a423](0e6a423)) * bump d3-format from 1.4.5 to 3.1.0 in /typescript ([#1680](#1680)) ([91f42d1](91f42d1)) * bump deck.gl from 8.9.31 to 8.9.32 in /typescript ([#1800](#1800)) ([393230c](393230c)) * bump to latest @emerson-eps/color-tables ([#1770](#1770)) ([e67a285](e67a285)) ### Features * New wellsLayer property: "simplifiedRendering". Default false. ([#1653](#1653)) ([baffae1](baffae1)) * Split GroupTree into GroupTreePlot-component and settings ([#1794](#1794)) ([ef07441](ef07441))
🎉 This issue has been resolved in version [email protected] 🎉 The release is available on GitHub release |
🎉 This issue has been resolved in version [email protected] 🎉 The release is available on GitHub release |
# [1.3.0](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@1.3.0) (2023-12-12) ### Features * Split GroupTree into GroupTreePlot-component and settings ([#1794](#1794)) ([ef07441](ef07441))
Split previous
/package/group-tree
into a view-component,/package/group-tree-plot
, which is independent ofredux
andmui
. The oldGroupTree
-component placed inpython/src/components
, for usage in Dash, now has a lot of the code from the old/package/group-tree
Thereby the new
group-tree-plot
can be used directly in Webviz NextGen.Removed package:
package/group-tree
New package:
package/group-tree-plot
Closes: equinor/webviz#461