From 36db7da61772a511192f59dd875ea53ef1ff92be Mon Sep 17 00:00:00 2001 From: Yu Takada Date: Fri, 20 Sep 2024 18:01:01 +0900 Subject: [PATCH] fix: add PointValue type to have x and y numbers and fix schema --- src/@types/types.d.ts | 5 +++++ src/infrastructure/dataSchemas/plotDataSchema.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/@types/types.d.ts b/src/@types/types.d.ts index bf0d292..ea9bbf5 100644 --- a/src/@types/types.d.ts +++ b/src/@types/types.d.ts @@ -6,3 +6,8 @@ export type PointMode = typeof POINT_MODE[keyof typeof POINT_MODE] //e.g. 1.2.0 is described as [1, 2, 0] export type SemanticVersion = [number, number, number] + +export type PointValue = { + x: number, + y: number +} diff --git a/src/infrastructure/dataSchemas/plotDataSchema.ts b/src/infrastructure/dataSchemas/plotDataSchema.ts index c336e04..8e5108a 100644 --- a/src/infrastructure/dataSchemas/plotDataSchema.ts +++ b/src/infrastructure/dataSchemas/plotDataSchema.ts @@ -1,7 +1,7 @@ //NOTE: Includes the actual data collected from a figure: axis values, axis scale, data point values and so //NOTE: Do not include any data which depends on StarryDigitizer app(e.g. setting axis by 2 points or 4 points etc...) -import { SemanticVersion } from '@/@types/types' +import { PointValue, SemanticVersion } from '@/@types/types' //TODO: move definition of type Coord to more global directoly (e.g. @types) import { Coord } from '@/domain/models/dataset/datasetInterface' @@ -36,7 +36,7 @@ export interface PlotDataSchema { name: string axisSetId: number points: Array<{ - value: number + value: PointValue coord: Coord }> }>