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

Tree view #591

Open
revolist opened this issue Oct 7, 2024 · 0 comments
Open

Tree view #591

revolist opened this issue Oct 7, 2024 · 0 comments
Assignees
Labels
feature New feature or request pro Pro version feature

Comments

@revolist
Copy link
Owner

revolist commented Oct 7, 2024

The Tree Grid Plugin allows users to visualize hierarchical data in a flat structure. It enables the expansion and collapsing of tree data, providing an intuitive way to navigate complex datasets.

Requirements

Functional Requirements

  1. Tree Structure Representation:

    • Support for representing hierarchical data in a flat format, where each row can have child rows.
    • Ability to define parent-child relationships through a specific field (e.g., parentId).
  2. Expand/Collapse Functionality:

    • Users can expand or collapse nodes to show or hide child elements.
    • A visual indicator (e.g., a plus/minus icon) should be displayed next to each node to indicate its expand/collapse state.
  3. Dynamic Rendering:

    • The grid should dynamically render child rows when a node is expanded and hide them when collapsed, maintaining performance with large datasets.
  4. Customizable Row Templates:

    • Users should be able to customize the appearance of rows, including how parent and child nodes are visually differentiated.
  5. Data Loading:

    • Support for lazy loading of child nodes to improve performance when dealing with large hierarchies.
  6. Accessibility:

    • Ensure that the plugin is accessible, allowing keyboard navigation and screen reader support.

Non-Functional Requirements

  1. Performance:

    • The plugin should be optimized for performance, ensuring smooth interactions even with large datasets.
  2. Compatibility:

    • Must work seamlessly with existing RevoGrid features and configurations.
  3. Documentation:

    • Comprehensive documentation for installation, usage, and API reference.

How It Works

  1. Data Structure:

    • The data passed to the grid should include hierarchical information. Each item in the data array should have properties such as id, name, and parentId to define the relationships.
    const data = [
        { id: 1, name: 'Parent 1', parentId: null },
        { id: 2, name: 'Child 1.1', parentId: 1 },
        { id: 3, name: 'Child 1.2', parentId: 1 },
        { id: 4, name: 'Parent 2', parentId: null },
        { id: 5, name: 'Child 2.1', parentId: 4 },
    ];
    
     2.	Expand/Collapse Logic:
     	When a user clicks the expand/collapse icon, the plugin will check if the clicked node has child nodes. If it does, it will render the child rows below the parent row.
     	The grid state will be updated to reflect the expanded or collapsed state.
     3.	Dynamic Rendering:
     	When nodes are expanded, the plugin can either retrieve child data from the server (lazy loading) or render already available child nodes in the dataset.
    
    

Usage Example

•	Expand/Collapse Action:
•	Clicking on the expand icon next to “Parent 1” will show “Child 1.1” and “Child 1.2” as child rows.
•	Clicking on the collapse icon will hide these child rows.
•	Visual Representation:
•	The rows will visually differentiate parent and child nodes (e.g., indenting child nodes).

Benefits

•	Improved Data Navigation: Users can easily navigate through hierarchical data without feeling overwhelmed by complexity.
•	Enhanced Usability: The intuitive expand/collapse feature makes it easy to focus on relevant data while hiding unnecessary details.
•	Dynamic Interaction: The ability to load child nodes on demand improves performance and user experience.
@revolist revolist converted this from a draft issue Oct 7, 2024
@revolist revolist moved this to Todo in RevoGrid v4 Roadmap Oct 7, 2024
@revolist revolist added feature New feature or request pro Pro version feature labels Oct 7, 2024
@revolist revolist self-assigned this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request pro Pro version feature
Projects
Status: Todo
Development

No branches or pull requests

2 participants
@revolist and others