CritasWang opened a new pull request, #38:
URL: https://github.com/apache/tsfile-viewer/pull/38

   ## Summary
   
   Fixes two problems reported for 
`074461-PSEU_A_L351_DSSFaultSumryWord2_ProxSensr_Pax1LVentCls_Fail.tsfile` 
(table model, nanosecond timestamps, a single BOOLEAN field):
   
   - **Time range showed `Invalid Date`**: the metadata basic-info card and the 
row group table called `new Date(timestamp)` directly; nanosecond timestamps 
exceed the `Date` range. Both now reuse the shared `formatTimestamp()` / 
`normalizeToMs()` helper that already backed the data table. The chart had the 
same defect on its time axis (ECharts reads axis values as milliseconds, so 
non-millisecond files rendered axis labels and tooltips as `NaN-NaN-NaN 
NaN:NaN:NaN.NaN`); series timestamps are normalized to milliseconds before they 
reach ECharts.
   - **Chart view was empty**: `POST /api/data/query` returned `series: []` 
because `extractMeasurementData()` only accepted `Number`, so every value of a 
BOOLEAN field was dropped even though the data preview listed the rows. 
Booleans are now plotted as 0/1, matching the frontend which already treats 
BOOLEAN as a numeric chart type.
   - The `datetimerange` picker is widened from 372px to 392px in both the 
table and tree filter panels: each input was 137px wide while `YYYY-MM-DD 
HH:mm:ss` needed 140px, so the timestamps were clipped.
   
   ## Validation
   
   - `mvn test` — 286 tests, 0 failures/errors, 17 skipped (includes the new 
`DataServiceChartTest`)
   - the new test fails without the boolean conversion: `Expected size: 1 but 
was: 0`
   - `npm run build` (vue-tsc + vite), `npx oxlint .`, `git diff --check`
   - `mvn spotless:check` reports only the three pre-existing violations in 
`integration/*IntegrationTest.java`, none in the touched files
   - browser checks against a local backend using the reported file: metadata 
time range renders `2024-06-30 15:05:33.000 → 2024-06-30 19:32:43.000`, the 
chart draws 10,000 points and its tooltip shows `2024-06-30 16:46:12.000`, both 
pickers report no clipped input
   - regression pass over the sample files (`outputData_1`, 
`test_cloudplantform`) for the metadata, data preview and chart pages
   
   ## Note
   
   Time-range **filtering** still only understands milliseconds: `docs/API.md` 
documents `startTime`/`endTime` as milliseconds, but feeding a millisecond 
range to a nanosecond file returns no rows (`startTime: 1719731133000` → 0 
rows, `startTime: 1719731133000000000` → 3 rows). That is a separate defect and 
changing the unit semantics needs a decision, so it is left out of this PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to