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

feat: Split GroupTree into GroupTreePlot-component and settings #1794

Merged

Conversation

jorgenherje
Copy link
Collaborator

@jorgenherje jorgenherje commented Nov 28, 2023

Split previous /package/group-tree into a view-component, /package/group-tree-plot, which is independent of redux and mui. The old GroupTree-component placed in python/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

@jorgenherje jorgenherje changed the title Split group tree settings and view refactor: Split GroupTree settings and view Nov 29, 2023
@jorgenherje jorgenherje force-pushed the split-group-tree-settings-and-view branch from 83d9ad7 to 51a6107 Compare November 29, 2023 12:32
Comment on lines 52 to 69
Default.args = {
id: "grouptreeplot",
datedTrees: exampleDatedTrees,
edgeMetadataList: edgeMetadataList,
nodeMetadataList: nodeMetadataList,
selectedDateTime: "2018-02-01",
selectedEdgeKey: "oilrate",
selectedNodeKey: "pressure",
};
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

@hkfb hkfb Dec 5, 2023

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.

Copy link
Collaborator Author

@jorgenherje jorgenherje Dec 5, 2023

Choose a reason for hiding this comment

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

@hkfb

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.

Copy link
Collaborator

@hkfb hkfb Dec 5, 2023

Choose a reason for hiding this comment

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

Copy link
Collaborator

@hkfb hkfb left a 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 👍

@hkfb
Copy link
Collaborator

hkfb commented Dec 6, 2023

Btw, perhaps we should use the feat prefix, since normally refactor won't trigger a release.

@jorgenherje jorgenherje changed the title refactor: Split GroupTree settings and view feat: Split GroupTree settings and view Dec 6, 2023
@jorgenherje jorgenherje changed the title feat: Split GroupTree settings and view feat: Split GroupTree into GroupTreePlot-component and settings Dec 6, 2023
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
@jorgenherje jorgenherje force-pushed the split-group-tree-settings-and-view branch from 9fb8734 to 8ad3541 Compare December 6, 2023 08:22
Copy link
Collaborator

@rubenthoms rubenthoms left a 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.

@jorgenherje jorgenherje merged commit ef07441 into equinor:master Dec 12, 2023
8 checks passed
hkfb pushed a commit that referenced this pull request Dec 12, 2023
# [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))
@hkfb
Copy link
Collaborator

hkfb commented Dec 12, 2023

🎉 This issue has been resolved in version [email protected] 🎉

The release is available on GitHub release

@hkfb hkfb added the released label Dec 12, 2023
hkfb pushed a commit that referenced this pull request Dec 12, 2023
# [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))
@hkfb
Copy link
Collaborator

hkfb commented Dec 12, 2023

🎉 This issue has been resolved in version [email protected] 🎉

The release is available on GitHub release

hkfb pushed a commit that referenced this pull request Dec 12, 2023
# [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))
@hkfb
Copy link
Collaborator

hkfb commented Dec 12, 2023

🎉 This issue has been resolved in version [email protected] 🎉

The release is available on GitHub release

hkfb pushed a commit that referenced this pull request Dec 12, 2023
# 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))
@hkfb
Copy link
Collaborator

hkfb commented Dec 12, 2023

🎉 This issue has been resolved in version [email protected] 🎉

The release is available on GitHub release

@hkfb
Copy link
Collaborator

hkfb commented Dec 12, 2023

🎉 This issue has been resolved in version [email protected] 🎉

The release is available on GitHub release

hkfb pushed a commit that referenced this pull request Dec 12, 2023
# [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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate settings in GroupTree React component
3 participants