Skip to content

Add Graphic Walker integration for interactive data exploration#409

Open
Edwardvaneechoud wants to merge 10 commits into
mainfrom
claude/integrate-graphic-walker-explore-UxpNS
Open

Add Graphic Walker integration for interactive data exploration#409
Edwardvaneechoud wants to merge 10 commits into
mainfrom
claude/integrate-graphic-walker-explore-UxpNS

Conversation

@Edwardvaneechoud
Copy link
Copy Markdown
Owner

Summary

This PR adds a new explore_data node type that integrates Graphic Walker, an interactive visualization and analytics tool, enabling users to explore and visualize data directly within the flow without leaving the application.

Key Changes

New Components

  • ExploreData.vue: Main component for the explore_data node that manages Graphic Walker state, handles chart spec persistence, and provides a toolbar for saving visualizations
  • VueGraphicWalker.vue: Vue wrapper around the React-based Graphic Walker component with dynamic imports to keep the bundle lean for users who don't use this feature
  • interfaces.ts: Type re-exports from @kanaries/graphic-walker for Vue components

Backend Integration (Pyodide)

  • execute_explore_data(): New Python function that materializes up to 100,000 rows from upstream LazyFrames and converts them to Graphic Walker's data format
  • Semantic type mapping: Converts Polars dtypes to Graphic Walker semantic types (quantitative, temporal, nominal) and analytic types (measure, dimension)
  • Row preparation: Handles JSON serialization of temporal/bytes values that don't survive Pyodide's default dict conversion

Type System

  • Added GraphicWalkerInput, GWDataModel, GWMutField, and RowInfo types to match flowfile_core schemas
  • Extended NodeResult to include graphic_walker_input and row_info fields
  • Added ExploreDataSettings interface for persisting saved chart specifications

Store Updates

  • updateNodeSettingsSilent(): New method to persist Graphic Walker chart specs without triggering re-execution or cache invalidation
  • Updated node execution logic to call execute_explore_data() instead of execute_preview() for explore_data nodes
  • Modified preview fetching to skip AG Grid preview for explore_data nodes (Graphic Walker provides the visualization)

Bundle Optimization

  • Graphic Walker and React dependencies are dynamically imported only when the component mounts, keeping them out of the initial bundle
  • Vite config updated to pre-bundle React and Graphic Walker for optimal loading performance
  • Type-only imports used throughout to avoid runtime overhead

UI/UX Features

  • Truncation banner displays when dataset exceeds 100K rows (in-browser limit)
  • "Save chart spec" button persists current visualizations to node settings
  • Status messages provide feedback on save operations
  • Auto-save on component unmount prevents loss of work when switching nodes
  • Theme-aware appearance (light/dark/system) synchronized with application theme

Notable Implementation Details

  • Chart specifications are persisted in node settings while data/fields are regenerated on each execution (prevents stale data)
  • The upstream LazyFrame is registered with the store after execution so downstream nodes continue to work
  • Row limit (100K) balances Pyodide's memory constraints with practical visualization needs
  • Graphic Walker's internal store is accessed via ref to export chart specifications as code

https://claude.ai/code/session_01HCz9DF1sNDyrKbb8Zh1Wdt

Replaces the AG Grid pass-through for explore_data nodes in the Pyodide-based
browser build with a full Graphic Walker interactive visualization panel,
mirroring the existing flowfile_frontend integration.

- Add execute_explore_data Python function (pyodide-store.ts) that
  materialises up to 100k rows inside Pyodide, builds the MutField list
  from Polars dtypes (quantitative/temporal/nominal), and ISO-serialises
  temporal values so they survive Pyodide dict conversion.
- Persist saved chart specs on the node settings (specList rehydrates on
  reload via the new updateNodeSettingsSilent store helper, which updates
  settings without invalidating caches or triggering re-execution).
- Add ExploreData.vue host component + near-verbatim copy of the
  flowfile_frontend VueGraphicWalker.vue React-in-Vue wrapper, both
  lazy-loaded via defineAsyncComponent so React + GraphicWalker never
  enter the initial bundle (confirmed: separate chunk at
  dist/assets/graphic-walker.es-*.js).
- Wire the theme store into Graphic Walker's appearance prop so light/
  dark/system mode follows the rest of the wasm app.
- Show a truncation banner when datasets exceed the 100k row cap.
- Skip the AG Grid bottom preview fetch for explore_data nodes since
  Graphic Walker is now their canonical view.
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 11, 2026

Deploy Preview for flowfile-wasm canceled.

Name Link
🔨 Latest commit cc073d0
🔍 Latest deploy log https://app.netlify.com/projects/flowfile-wasm/deploys/69ecda75f11dd900083e438d

claude and others added 9 commits April 11, 2026 17:05
The explore_data node was still labeled "Preview" with the binoculars
(view.png) icon from when it was a pass-through preview, which made it
hard to discover as the Graphic Walker visualization node. Rename it to
"Explore Data", wire up the existing explore_data.png icon asset, and
update the help text to describe the Graphic Walker integration.
propagateSchemas() runs after executeFlow() and, for nodes whose schema
can be inferred from their input (including explore_data, which just
passes the schema through), rebuilds the NodeResult with a whitelist of
fields. graphic_walker_input and row_info weren't in that whitelist, so
the Graphic Walker payload produced by execute_explore_data was wiped
immediately after execution - the UI rendered "Data loaded, but the
dataset is empty or has no fields" every time.

Preserve both fields when the inferred-schema branch rebuilds the result.
Two related fixes for the explore_data node:

1. Chart specs were not persisted on flow save. Graphic Walker stores
   chart edits in its internal React store, not in node settings, so
   unless the user clicked Save chart beforehand the exported YAML had
   an empty specList. Fixed with a before-export hook system:
   flow-store exposes registerBeforeExportHook, downloadFlowfile is now
   async and awaits all registered hooks before serialising, and
   ExploreData.vue registers a hook on mount that flushes the live
   Graphic Walker spec into node settings via updateNodeSettingsSilent.
   handleSaveFlow in Canvas.vue now awaits the async download.

2. No fullscreen mode. The Graphic Walker canvas inside the DraggablePanel
   was too cramped to use in practice. Added a fullscreen toggle that
   teleports the GW component to a viewport-covering overlay, with an
   Escape-key exit. Toggling fullscreen re-mounts the GW component, so
   saveCurrentSpec runs first (flushing the React-side spec into node
   settings) and the re-mount reads specList from settings - which also
   means specList now reactively updates from settings rather than the
   result payload, keeping fullscreen toggles and save clicks in sync.
The inline Graphic Walker in the node settings panel was cramped and
showed a bright-white panel in dark mode, and the custom buttons had
hardcoded colors that didn't respect the theme. Rework the panel so it
is fullscreen-only:

- Side panel no longer mounts Graphic Walker at all. Instead it shows a
  compact summary (rows / columns / saved charts count) plus a single
  primary "Open in fullscreen" button. All styling goes through the
  design-token CSS variables so it adapts automatically to light/dark.
- Use the existing global .btn / .btn-primary / .btn-secondary classes
  rather than bespoke inline styles, so the buttons match the rest of
  the app and flip cleanly with the theme.
- Graphic Walker itself only mounts inside the Teleport overlay, which
  is the only place that needs the full viewport. The overlay declares
  both light- and dark-mode design tokens locally (the Teleport target
  is outside the .flowfile-editor-root scope, so the editor.css tokens
  would otherwise be unresolved), and reads the effective theme from
  theme-store to pick the right set.
- closeFullscreen awaits saveCurrentSpec before unmounting so the chart
  survives the toggle, and Escape still exits fullscreen.
- Removed the Save chart button; auto-flushing on unmount, close, and
  before-flow-export covers every save path.
FlowNode.vue had its own iconMap separate from the sidebar's
nodeCategories. The sidebar was updated to explore_data.png (chart icon)
in 23388e5, but FlowNode.vue:99 still mapped explore_data → view.png
(binoculars). This meant the sidebar showed the correct icon while the
canvas node kept showing the old binoculars.
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