Skip to content

Conversation

@mwkyuen
Copy link
Collaborator

@mwkyuen mwkyuen commented Nov 20, 2025

No description provided.

1. **Object views** (simple): `const MyView: View = { name, id, component, ... }`
2. **Class views** (complex): `class MyView implements View { constructor(...) { this.component = this.component.bind(this) } }`

**Routing & View Registration:**
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Yukthiw can you review this section?

- `icon()`: JSX icon component for view selector
- `citation()`: JSX component for data attribution

**Two Implementation Patterns:**
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bdls-jamal can you review this section? Which pattern do you usually use? I don't want there to be 2 patterns, so I'll keep only the pattern that you are using

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is an example of the configuration for the heatmap(same as navigator and other views)

const HeatMap: ViewMetadata<HeatMapViewerData, HeatMapViewerState> = {
  name: 'HeatMap view',
  id: 'heatmap-view',

  icon: () => <HeatMapIcon />,
  description: 'HeatMap Viewer.',
  citation() {
    return <div></div>
  },
  actions: [
    { 
      name: 'Reset Pan/Zoom',
      description: 'Reset the pan and zoom of the viewer',
      icon: <YoutubeSearchedForRoundedIcon />,
      mutation: (prevState) => ({
        ...prevState,
        transform: {
          offset: {
            x: 0,
            y: 0,
          },
          zoom: 1,
        },
      }),
    },
  ]
}

I don't think it matches either of the two options generated by copilot but correct me if I am not understanding correctly.

Also, an actual object must also be created in a separate file like so:
export const viewObject = () => {} and then inside it will have constants for initializing the state, theme, outlet context, useQuery, etc. Should all be outlined in the eplant/Eplant/tutorial.md of staging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants