Skip to content

Adds date / time data type - #527

Merged
xinaesthete merged 7 commits into
mainfrom
feature/handle-date-time
Jul 29, 2026
Merged

Adds date / time data type#527
xinaesthete merged 7 commits into
mainfrom
feature/handle-date-time

Conversation

@bioinfbloke

@bioinfbloke bioinfbloke commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Adds real date-column support end to end. Datetimes ingested from pandas/polars are stored as numeric days since the Unix epoch, tagged with is_date, and shown as YYYY-MM-DD in tables, tooltips, axes, color legends, Selection Dialog filters, and Find/Replace — while charts and filters keep using the underlying day numbers so sorting and brushing stay chronological.

Summary by CodeRabbit

  • New Features
    • Added date-column support end-to-end for pandas and polars ingestion.
    • Date values now display as YYYY-MM-DD across tables, axes, legends, filters, and histogram/brush labels.
    • Improved interactions for date columns, including chronological sorting and date-aware filtering/range stepping.
    • Axis and legend tick formatting now render calendar dates; date modes disable log scaling and enforce minimum axis sizing where applicable.
  • Documentation
    • Expanded documentation for date column configuration (is_date, date_unit) and behavior.
  • Bug Fixes
    • Improved CSS asset mapping for additional stylesheet names.

Stephen Taylor and others added 3 commits July 16, 2026 16:26
project_bootstrap / desktop_index import ./all_css, which Rolldown emits as all_css.css; keep Flask asset naming consistent with mdv.css.

Co-authored-by: Cursor <cursoragent@cursor.com>
@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for mdv-dev ready!

Name Link
🔨 Latest commit 4f27f39
🔍 Latest deploy log https://app.netlify.com/projects/mdv-dev/deploys/6a69f24f0a19d0000715f93d
😎 Deploy Preview https://deploy-preview-527--mdv-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@bioinfbloke, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7bd917e1-04d9-4bdd-9e28-fea589749a91

📥 Commits

Reviewing files that changed from the base of the PR and between 4e6b80c and 4f27f39.

📒 Files selected for processing (2)
  • src/charts/WGLScatterPlot.js
  • src/tests/dateAxisDefaults.spec.ts
📝 Walkthrough

Walkthrough

Date-valued columns are ingested as UTC epoch-day doubles with is_date metadata. Shared helpers format, parse, and validate dates across tables, filters, charts, axes, legends, and color scales. Documentation and CSS asset filename mapping are also updated.

Changes

Date column support

Layer / File(s) Summary
Date representation and contracts
src/lib/dateFormat.ts, src/charts/charts.d.ts, src/charts/schemas/DataSourceSchema.ts, docs/...
Defines epoch-day date metadata, parsing/formatting helpers, public types, runtime schema fields, and documentation.
Pandas and Polars ingestion
python/mdvtools/mdvproject.py, python/mdvtools/tests/test_date_columns.py
Detects datetime columns, converts values to day doubles, applies metadata, preserves annotated numeric dates, and tests pandas and Polars ingestion.
Table display and date filtering
src/datastore/DataStore.js, src/react/components/{SelectionDialogComponent,HistogramWidget}.tsx, src/react/utils/valueReplacementUtil.ts, src/tests/...
Formats date values for display and editing, parses ISO inputs, configures date filters and histogram ranges, and validates the behavior.
Chart axes and legends
src/charts/*, src/react/components/AxisComponent.tsx, src/react/components/legend/*, src/react/legend/*, src/utilities/Color.js, src/tests/...
Formats date ticks, adjusts date-axis scaling and sizing, propagates date state through continuous legends, and tests tick and legend formatting.

CSS asset mapping

Layer / File(s) Summary
Stylesheet asset routing
vite.config.mts
Maps all_css.css alongside existing MDV stylesheet names to assets/mdv.css.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Source
  participant MDVProject
  participant DataStore
  participant SelectionDialog
  participant Chart
  Source->>MDVProject: submit datetime columns
  MDVProject->>DataStore: store epoch-day doubles and date metadata
  DataStore->>SelectionDialog: provide date column and numeric range
  SelectionDialog->>DataStore: apply parsed date bounds
  DataStore->>Chart: provide date column values
  Chart->>Chart: render ISO date ticks and labels
Loading

Possibly related PRs

Suggested reviewers: martinsergeant

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 61.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main theme of adding date-column support, though "time" is broader than the actual changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/handle-date-time

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/charts/SVGChart.js (1)

129-131: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use isDateColumn helper to centralize date detection.

All three files manually check is_date || date_unit === "days". To prevent divergence, import and use the shared isDateColumn helper from src/lib/dateFormat.ts.

  • src/charts/SVGChart.js#L129-L131: replace the manual check with if (isDateColumn(col)) { return col; }.
  • src/charts/WGLScatterPlot.js#L274-L275: replace with const xIsDate = isDateColumn(xCol); and const yIsDate = isDateColumn(yCol);.
  • src/utilities/Color.js#L243-L243: replace the ternary condition with isDateColumn(c).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/charts/SVGChart.js` around lines 129 - 131, Replace manual date detection
with the shared isDateColumn helper and import it from src/lib/dateFormat.ts:
update SVGChart.js at lines 129-131 to use isDateColumn(col), WGLScatterPlot.js
at lines 274-275 to derive xIsDate and yIsDate through isDateColumn, and
Color.js at line 243 to use isDateColumn(c) in the ternary condition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/charts/WGLScatterPlot.js`:
- Around line 505-522: Remove the entire updateAxis() override from
WGLScatterPlot. Rely on the inherited SVGChart.js implementation for date tick
formatting and axis updates, preserving smooth transitions for non-date X and Y
axes.
- Around line 270-289: Extract the date-specific axis logic from the constructor
into a _applyDateAxisDefaults() helper, preserving the existing date detection,
log-scale disabling, and minimum axis sizes. Call this helper from both the
constructor and drawChart(), after the dynamic x/y parameters are assigned, so
Settings-driven column changes apply the defaults before rendering.

---

Nitpick comments:
In `@src/charts/SVGChart.js`:
- Around line 129-131: Replace manual date detection with the shared
isDateColumn helper and import it from src/lib/dateFormat.ts: update SVGChart.js
at lines 129-131 to use isDateColumn(col), WGLScatterPlot.js at lines 274-275 to
derive xIsDate and yIsDate through isDateColumn, and Color.js at line 243 to use
isDateColumn(c) in the ternary condition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: beb45690-7222-42dd-9102-c2eb76a810c3

📥 Commits

Reviewing files that changed from the base of the PR and between bdec64e and c55e9eb.

📒 Files selected for processing (30)
  • docs/TABLE_CHART_REACT.md
  • docs/extradocs/datasource.md
  • docs/jsdocs/extradocs/datasource.md
  • python/mdvtools/mdvproject.py
  • python/mdvtools/tests/test_date_columns.py
  • src/charts/BaseChart.ts
  • src/charts/SVGChart.js
  • src/charts/WGLScatterPlot.js
  • src/charts/charts.d.ts
  • src/charts/schemas/DataSourceSchema.ts
  • src/datastore/DataStore.js
  • src/lib/dateFormat.ts
  • src/react/components/AxisComponent.tsx
  • src/react/components/HistogramWidget.tsx
  • src/react/components/SelectionDialogComponent.tsx
  • src/react/components/legend/ColorLegend.tsx
  • src/react/components/legend/LegendContinuousSvg.tsx
  • src/react/legend/color_legend/buildColorLegendSpec.ts
  • src/react/legend/color_legend/types.ts
  • src/react/legend/shared/legendTypes.ts
  • src/react/legend/shared/legendUtils.ts
  • src/react/utils/valueReplacementUtil.ts
  • src/tests/dateAxisTicks.spec.ts
  • src/tests/dateColumnDisplay.spec.ts
  • src/tests/dateFormat.spec.ts
  • src/tests/histogramBrushRange.spec.ts
  • src/tests/react/legend/legendUtils.test.ts
  • src/tests/table_react/utils/valueReplacementUtils.test.tsx
  • src/utilities/Color.js
  • vite.config.mts

Comment thread src/charts/WGLScatterPlot.js Outdated
Comment thread src/charts/WGLScatterPlot.js Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/charts/WGLScatterPlot.js`:
- Around line 367-383: Update _applyDateAxisDefaults() to cache each axis’s
pre-date x_log_scale/y_log_scale and size values when first switching to a date
column, then restore those cached settings when the corresponding column becomes
numeric again. Keep date-axis defaults and setAxisSize behavior intact, and add
a regression test covering a date-to-numeric switch that restores logarithmic
scaling and the original axis size.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c1ad610-497d-4de8-b381-34b784db29c3

📥 Commits

Reviewing files that changed from the base of the PR and between c55e9eb and 4e6b80c.

📒 Files selected for processing (2)
  • python/mdvtools/mdvproject.py
  • src/charts/WGLScatterPlot.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • python/mdvtools/mdvproject.py

Comment thread src/charts/WGLScatterPlot.js
Comment thread src/charts/charts.d.ts
* Categorical columns return category strings; `is_date` numerics return ISO `YYYY-MM-DD`;
* other numerics return numbers (or `"missing"` for NaN).
*/
getValue: (i: number) => string | number;

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.

we've lost some fidelity in the type here :(

@xinaesthete xinaesthete left a comment

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.

Slight shame that we keep putting more into legacy vanilla charts that I'd rather see in react, but this looks mostly reasonable.

edit: it's not like the relevant changes in AxisComponent.tsx etc are missing, so I should probably stop whinging about nothing. LGTM, not having actually tried it...

@xinaesthete
xinaesthete merged commit a1a72e1 into main Jul 29, 2026
10 checks passed
@xinaesthete
xinaesthete deleted the feature/handle-date-time branch July 29, 2026 12:44
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