LearnNewsExamplesServices
Frontmatter
id8954
titleFeat: Generic Sparkline Component & Grid Column
stateClosed
labels
enhancementaifeature
assigneestobiu
createdAtFeb 2, 2026, 11:20 PM
updatedAtFeb 2, 2026, 11:39 PM
githubUrlhttps://github.com/neomjs/neo/issues/8954
authortobiu
commentsCount1
parentIssue8948
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 2, 2026, 11:39 PM

Feat: Generic Sparkline Component & Grid Column

Closed v12.0.0 enhancementaifeature
tobiu
tobiu commented on Feb 2, 2026, 11:20 PM

Goal

Promote the DevRank.view.SparklineComponent implementation to a generic framework component (Neo.component.Sparkline) and create a corresponding grid column (Neo.grid.column.Sparkline) to enable widespread usage.

Scope

  1. Create src/component/Sparkline.mjs:
    • Extend Neo.component.Canvas.
    • Port the controller logic from apps/devrank/view/SparklineComponent.mjs.
    • Ensure the renderer connection is configurable.
    • Update class names to be generic (e.g., neo-sparkline-canvas).
  2. Create src/grid/column/Sparkline.mjs:
    • Extend Neo.grid.column.Component.
    • Implement applyRecordConfigs to map record data fields to the component.
    • Set Neo.component.Sparkline as the default module.
  3. Create resources/scss/src/grid/column/Sparkline.scss:
    • Extract sparkline-specific styles from resources/scss/src/apps/devrank/GridContainer.scss.
    • Rename classes to match the generic component (e.g., .neo-sparkline-wrapper).
  4. Export:
    • Add Neo.grid.column.Sparkline to src/grid/column/_export.mjs.

Note

  • The Canvas worker renderer (apps/devrank/canvas/Sparkline.mjs) will be moved in a separate step.
tobiu added the enhancement label on Feb 2, 2026, 11:20 PM
tobiu added the ai label on Feb 2, 2026, 11:20 PM
tobiu added the feature label on Feb 2, 2026, 11:20 PM
tobiu referenced in commit e2907a5 - "feat: Generic Sparkline Component & Grid Column (#8954)" on Feb 2, 2026, 11:38 PM
tobiu assigned to @tobiu on Feb 2, 2026, 11:38 PM
tobiu
tobiu Feb 2, 2026, 11:38 PM

Input from Gemini 3 Pro:

✦ I have successfully implemented the generic Sparkline component and grid column.

Changes:

  1. Promoted Component: DevRank.view.SparklineComponent has been genericized and moved to src/component/Sparkline.mjs. It now supports top-level configuration for dynamic worker renderers (rendererClassName, rendererImportPath).
  2. New Grid Column: Created src/grid/column/Sparkline.mjs. This column type automatically maps record data to the component's values and passes down renderer configurations from the column definition to the component defaults.
  3. SCSS Extraction: Styles were extracted to resources/scss/src/grid/column/Sparkline.scss, making the component stylistically independent.
  4. Integration: DevRank.view.GridContainer was updated to use the new type: 'sparkline' column. The data aggregation logic remains in the component function, while the renderer configuration was moved to the column definition for clarity.
  5. Cleanup: Deleted the obsolete apps/devrank/view/SparklineComponent.mjs.

The implementation allows for easy reuse of worker-based sparklines across the framework while maintaining the "Zero-Config" goal for standard usage.

tobiu added parent issue #8948 on Feb 2, 2026, 11:39 PM
tobiu closed this issue on Feb 2, 2026, 11:39 PM
tobiu cross-referenced by #8948 on Feb 2, 2026, 11:54 PM