Skip to content

feat(components): queries over time component#1069

Merged
fhennig merged 15 commits intomainfrom
queries-over-time
Jan 28, 2026
Merged

feat(components): queries over time component#1069
fhennig merged 15 commits intomainfrom
queries-over-time

Conversation

@fhennig
Copy link
Copy Markdown
Contributor

@fhennig fhennig commented Jan 21, 2026

resolves #65

Summary

Adds the new "Queries over time" component.

Code example

<gs-queries-over-time
    lapisFilter='{ "pangoLineage": "JN.1*", "dateFrom": "2024-01-15", "dateTo": "2024-04-30" }'
    queries='[
        {
            "displayLabel": "S:F456L (single mutation)",
            "countQuery": "S:456L",
            "coverageQuery": "!S:456N"
        },
        {
            "displayLabel": "R346T + F456L (combination)",
            "countQuery": "S:346T & S:456L",
            "coverageQuery": "!S:346N & !S:456N"
        }
    ]'
    views='["grid"]'
    width='100%'
    height='700px'
    granularity="month"
    lapisDateField="date"
    pageSizes='[5,10]'
></gs-queries-over-time>

Screenshot

image

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dashboard-components Error Error Jan 28, 2026 11:52am

Request Review

@fhennig fhennig self-assigned this Jan 21, 2026
@fhennig fhennig changed the base branch from main to query-queries-over-time January 21, 2026 13:44
Base automatically changed from query-queries-over-time to main January 22, 2026 15:26
@fhennig fhennig added the update-snapshots Update playwright snapshots label Jan 27, 2026
@github-actions github-actions Bot removed the update-snapshots Update playwright snapshots label Jan 27, 2026
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 PR adds a new "Queries over time" component that displays arbitrary LAPIS queries over time with customizable date ranges and granularity. The component allows users to visualize proportions of custom queries across different time periods using a grid view.

Changes:

  • Added gs-queries-over-time web component with configurable properties for filters, queries, granularity, and display options
  • Implemented grid view with filtering, pagination, and data export capabilities
  • Created supporting utilities for query data filtering and tooltip display

Reviewed changes

Copilot reviewed 21 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
components/src/web-components/visualization/gs-queries-over-time.tsx Main web component definition with property declarations and rendering logic
components/src/web-components/visualization/gs-queries-over-time.stories.ts Storybook stories demonstrating various component configurations
components/src/preact/queriesOverTime/queries-over-time.tsx Core Preact component implementing the queries over time visualization
components/src/preact/queriesOverTime/queries-over-time.stories.tsx Preact component stories with interaction tests
components/src/preact/queriesOverTime/queries-over-time-grid-tooltip.tsx Tooltip component for grid cells showing detailed query information
components/src/preact/queriesOverTime/getFilteredQueriesOverTimeData.ts Data filtering logic for proportion intervals and text filters
components/src/lapisApi/lapisTypes.ts Updated query definition to require displayLabel field
components/src/web-components/visualization/gs-mutations-over-time.tsx Type fix for hideGaps property consistency
components/tests/visualizationStories.ts Added test stories for new component

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


const queryDefinition = z.object({
displayLabel: z.string().optional(),
displayLabel: z.string(),
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Making displayLabel required is a breaking change that could affect existing code using this schema with optional display labels. If this field was previously optional elsewhere in the codebase, this change requires careful migration.

Suggested change
displayLabel: z.string(),
displayLabel: z.string().optional(),

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm, maybe I can check again if we can keep it optional. But IMO it's good to have this non-optional, and for the collections use case, there are always labels already.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You made it non-optional because the component requires it I assume?

Copy link
Copy Markdown
Collaborator

@fengelniederhammer fengelniederhammer left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread components/src/preact/queriesOverTime/getFilteredQueriesOverTimeData.ts Outdated

const queryDefinition = z.object({
displayLabel: z.string().optional(),
displayLabel: z.string(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You made it non-optional because the component requires it I assume?

Comment thread components/src/preact/queriesOverTime/queries-over-time.tsx
Comment thread components/src/preact/queriesOverTime/queries-over-time.tsx Outdated
Comment thread components/src/preact/queriesOverTime/queries-over-time.stories.tsx Outdated
@fhennig
Copy link
Copy Markdown
Contributor Author

fhennig commented Jan 28, 2026

regarding your last question, it was easier to deal with if the label was required; if we want to we can relax this in the future, but I think it's fine for now to just require it.

@fhennig fhennig merged commit 136a311 into main Jan 28, 2026
5 of 6 checks passed
@fhennig fhennig deleted the queries-over-time branch January 28, 2026 11:58
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.

feat: New "mutation-group"-over-time component

3 participants