Skip to content

Prepare for the next update: Data Anchor#132

Merged
Chenglong-MS merged 6 commits into
mainfrom
dev
Mar 21, 2025
Merged

Prepare for the next update: Data Anchor#132
Chenglong-MS merged 6 commits into
mainfrom
dev

Conversation

@Chenglong-MS
Copy link
Copy Markdown
Collaborator

With Data Anchor, we can anchor an intermediate data to isolate it's derivation context from it's predecessors. Tables created from the anchor will take the anchored table as direct input (not the original data).

This could be helpful for cleaning initial input data (so we always work with cleaned data afterwards), or when we want to focus our analysis into a subset of dataset.

This makes analysis clean, but also makes it more efficient for LLM to work with, since it won't have the gigantic context attached to the anchored data.

We'll merge it after some more testing and playing. Made quite a bit of updates so it can be messy(?)

Here is a quick demo:

data-anchor-demo.mp4

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request implements changes to support Data Anchoring by introducing a persistent “anchored” flag and table references throughout the codebase. Key changes include updating concept and table creation functions to include a new tableRef property, adding new reducers (updateTableAnchored and updateTableDisplayId) to manage table state, and revising UI components (e.g. ConceptGroup, EditableTableName, EncodingBox) to properly display and interact with anchored tables.

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/views/ConceptShelf.tsx Updates custom concept creation to include tableRef in generated concepts
src/app/utils.tsx Revises getTriggers loop to account for anchored tables
src/views/DataView.tsx Adjusts extTable generation and dependencies using the updated tableRef
src/views/EncodingShelfCard.tsx Modifies filtering logic to incorporate anchored tables
src/components/ComponentType.tsx Adds displayId for tables to support user-friendly naming
src/views/ConceptCard.tsx Updates genFreshDerivedConcept signature to include tableRef parameter
src/views/EncodingShelfThread.tsx Introduces new UI behavior for anchored tables in thread view
src/data/utils.ts Changes table creation functions to require passing anchored flag
src/views/ViewUtils.tsx Adjusts grouping of concept items based on table displayId
src/views/TableSelectionView.tsx Updates table creation from text/JSON to pass anchored flag true
src/views/DerivedDataDialog.tsx Removes obsolete styled Group components
src/views/DisambiguationDialog.tsx Removes unused GroupHeader/GroupItems definitions
src/views/DataFormulator.tsx Removes unused styled components and updates split pane usage
src/views/ModelSelectionDialog.tsx Removes unused GroupHeader/GroupItems definitions
src/views/ReactTable.tsx Updates TableCell styling syntax
src/app/dfSlice.tsx Adds new reducers for updating table anchored state and display id
src/views/DataThread.tsx Introduces EditableTableName into thread view for renaming anchored tables
src/views/EncodingBox.tsx Updates concept grouping and ensures new tableRef property is passed
Files not reviewed (2)
  • src/scss/App.scss: Language not supported
  • src/scss/EncodingShelf.scss: Language not supported
Comments suppressed due to low confidence (3)

src/views/ConceptCard.tsx:139

  • Ensure that the tableRef passed into genFreshDerivedConcept matches the originating field’s tableRef so that derived concepts are correctly anchored to their source table.
handleUpdateConcept(genFreshDerivedConcept([field.id], field.tableRef));

src/views/EncodingBox.tsx:529

  • Verify that all invocations of groupConceptItems are updated to pass the tables argument, ensuring that concept items are grouped based on the correct table displayId.
let conceptGroups = groupConceptItems(conceptShelfItems, tables);

src/app/dfSlice.tsx:338

  • Add unit tests for the new reducers (updateTableAnchored and updateTableDisplayId) to verify that table state updates occur as expected when toggling the anchored flag or modifying the displayId.
updateTableAnchored: (state, action: PayloadAction<{tableId: string, anchored: boolean}>) => { ... }

@Chenglong-MS
Copy link
Copy Markdown
Collaborator Author

Example 1: use anchor to clean the table, so that follow-up analysis are all build on top of the clean data. Analysis of director profit is based on the filtered data.

anchor-clean-data.mp4

Example 2: create a subset from the original table to focus analysis. The AI agent will be less likely to be confused, analysis will be faster. The anchored asian-energy dataset includes only countries from Asia.

anchor-subset-analysis.mp4

Illustration: The anchored thread has it's own context --- no more access to the original data. Though, you have the option to add the original data back using "multi-table" approach from the previous release. You can also go back to the original data to create another branch there.

image

@Chenglong-MS Chenglong-MS merged commit 79043d0 into main Mar 21, 2025
Comment thread src/views/ConceptCard.tsx
);
</Tooltip>);

let deriveOption = (
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug

@Chenglong-MS Chenglong-MS mentioned this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants