equinor / webviz-subsurface-components

Custom subsurface visualizations for use in Webviz and/or Dash.
https://github.com/orgs/equinor/projects/24
Mozilla Public License 2.0
33 stars 39 forks source link

[REFACTORING]: `groupTreeAssembler.js` in `GroupTreePlot` #1829

Open rubenthoms opened 8 months ago

rubenthoms commented 8 months ago

The drawing class in groupTreeAssembler.js utilized in GroupTreePlot does not support resizing. It does only use the initial width and height of the element it is rendered in and does not adjust to changes of the parent element. This can lead to bad UX, especially in the dynamic new Webviz application.

Recording 2023-12-12 111231 (1)

In addition, the class' code is difficult to adjust and maintain since it is written in plain JavaScript.

I suggest to:

jorgenherje commented 8 months ago

When performing the initial splitting, I started looking into converting grup_tree.js to typescript. This work can pinpoint some of the issues detected when trying to purely convert the .js implementation into .ts. E.g. the existing .js code directly manipulates d3 objects used, by adding new attributes etc in code. This is not allowed when using typescript.

Here is the testing branch: https://github.com/CeetronSolutions/webviz-subsurface-components/tree/split-group-tree-setting-and-view-ts-conversion-backup

Initial converting GroupTree.ts: https://github.com/CeetronSolutions/webviz-subsurface-components/blob/split-group-tree-setting-and-view-ts-conversion-backup/typescript/packages/group-tree/src/components/group-tree-plot/src/Plot/GroupTree.ts