Hierarchical vertical merging should respect parent column grouping
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
What problem does this feature solve?
Problem Description
When using vertical cell merging, the current behavior merges cells with the same value even if their parent group in the previous column is different. This results in misleading groupings.
Given this data:
| Category | Priority | City |
|---|---|---|
| A | High | San Francisco |
| A | Medium | New York City |
| B | Medium | Paris |
| B | Low | Nice |
Current Behavior (Incorrect Merging)
| Category | Priority | City |
|---|---|---|
| A | High | San Francisco |
| Medium | New York City | |
| B | Paris | |
| Low | Nice |
Here, Priority: Medium was merged even though it's used under both Category A and Category B.
This is incorrect, because the values belong to different groups.
Expected Behavior (Hierarchical Merging)
| Category | Priority | City |
|---|---|---|
| A | High | San Francisco |
| Medium | New York City | |
| B | Medium | Paris |
| Low | Nice |
In this version:
Priorityis only merged within the sameCategorygroup.- This respects the hierarchical structure of the data.
Feature Request (☆▽☆)
Please support hierarchical vertical merging, where a cell in column n is only merged if all previous columns (0 to n-1) have the same value for the affected rows.
This will ensure merged cells accurately reflect group boundaries and avoid misleading groupings in complex data tables.
What does the proposed API look like?
We suggest adding an optional flag or configuration to the table that enables hierarchical merging, where cells are only merged if all columns before them have the same value.
Option 1: mergeStrategy: 'hierarchical'
const table = new VTable({
...,
mergeStrategy: 'hierarchical',
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names the VTable constructor and the proposed mergeStrategy option but no files or tests. Start by locating the existing vertical-merging logic and option handling, then add coverage for the Category/Priority example; done means equal values merge only when all preceding columns match.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100