Skip to content

temp3 matrix implementation - #4635

Draft
vivekavuthu wants to merge 3 commits into
masterfrom
templates_dicttree_newRoute
Draft

temp3 matrix implementation#4635
vivekavuthu wants to merge 3 commits into
masterfrom
templates_dicttree_newRoute

Conversation

@vivekavuthu

@vivekavuthu vivekavuthu commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new data-driven "Templates 3" (Template Mapping) view for PrOFILE, which provides a flexible Module → Domain → chart-template overview. The implementation is fully generic: all layout, labels, colors, chart types, and ordering come from the dataset's config, not hardcoded. The pull request includes the new view, its integration, type definitions, and unit tests for its core logic.

Templates 3 (Template Mapping) View Implementation:

  • Added the profileForms3 chart type and menu entry in getChartTypeList (client/mass/charts.js) and enabled dynamic import of its implementation (client/plots/importPlot.js).
  • Implemented the Templates 3 data-driven view in client/plots/profile/form3.ts, including:
    • Structural runtime validation (assertTemplateMapping)
    • Pure layout builder (buildTemplateView)
    • Data-backed gating (shows only chart types with real data)
    • Search/filter UI and click-to-open integration with existing profile plots

Type System and Config Updates:

  • Defined new types in shared/types/src/dataset.ts for the template mapping contract, including TemplateChart, TemplateMeta, TemplateFormLegend, TemplateDomain, TemplateModule, and TemplateMapping to ensure datasets and client agree on structure and meaning.

Testing:

  • Added unit tests for the pure logic (buildTemplateView, assertTemplateMapping) in client/plots/profile/test/form3.unit.spec.ts, covering correct grouping, template meta resolution, NEW status propagation, and all structural validation errors.This pull request introduces a new "Templates 3" chart picker for profile forms, providing a data-driven, module/domain matrix/list UI for selecting chart types. It ensures chart-type options are always in sync with the underlying data by deriving available chart types directly from the database, rather than static config. The update also includes unit tests for the new logic.

Templates 3 chart picker implementation:

  • Added a new "Templates 3" chart type to the chart type list in mass/charts.js, which launches a matrix/list menu for selecting profile forms charts.
  • Implemented profile/forms3.ts, which:
    • Groups template-bearing domains by module, displaying available chart types as buttons (all derived from DB child term subtypes).
    • Supports cross-domain charts, displaying them under each domain they span.
    • Includes a search/filter UI and module accent colors.
    • Ensures the picker is always in sync with the data structure.

Database-driven chart type derivation:

  • Added profile/formsChartTypes.ts, providing functions to:
    • Map child term subtypes to chart-type display names in canonical order.
    • Query the database for each domain’s available chart types, ensuring the picker stays up-to-date as data changes.

Integration and testing:

  • Updated plots/importPlot.js to support dynamic import of the new profile/forms3.ts chart type.
  • Added unit tests in test/forms3.unit.spec.ts to validate the grouping, mapping, and cross-domain logic of the new picker.# Description

Checklist

Check each task that has been performed or verified to be not applicable.

  • Tests: Added and/or passed unit and integration tests, or N/A
  • Todos: Commented or documented, or N/A
  • Notable Changes: updated release.txt, prefixed a commit message with "fix:" or "feat:", added to an internal tracking document, or N/A
  • Rust: Checked to see whether Rust needs to be re-compiled because of this PR, or N/A

@vivekavuthu
vivekavuthu force-pushed the templates_dicttree_newRoute branch from 254830d to 8156d3d Compare June 24, 2026 16:04
@vivekavuthu
vivekavuthu force-pushed the templates_dicttree_newRoute branch 3 times, most recently from 0a5d5bc to d4a03df Compare July 30, 2026 15:23
@vivekavuthu
vivekavuthu force-pushed the templates_dicttree_newRoute branch from d4a03df to 4cf96cb Compare August 3, 2026 20:41
@vivekavuthu
vivekavuthu force-pushed the templates_dicttree_newRoute branch from 4b4ba84 to 9aeba37 Compare August 20, 2026 15:21
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.

1 participant