mirror of
https://github.com/stackrender/stackrender.git
synced 2026-09-10 19:25:44 +00:00
Init Commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
|
||||
export const colorOptions = [
|
||||
"#fd7f6f", // Warm coral red
|
||||
"#7eb0d5", // Soft sky blue
|
||||
"#b2e061", // Fresh lime green
|
||||
"#bd7ebe", // Soft lavender pink
|
||||
"#ffb55a", // Vibrant orange
|
||||
"#ffee65", // Warm yellow
|
||||
"#beb9db", // Light purple grey
|
||||
"#fdcce5", // Light blush pink
|
||||
"#8bd3c7", // Minty teal
|
||||
"#f4a1a1", // Soft peachy red
|
||||
"#9bd78c", // Fresh pastel green
|
||||
"#d1a9e0" // Light lilac purple
|
||||
|
||||
|
||||
];
|
||||
|
||||
export const randomColor = () => {
|
||||
return colorOptions[Math.floor(Math.random() * colorOptions.length)];
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface DataType {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { DataType } from "../data/data-types";
|
||||
|
||||
export interface Field {
|
||||
id: string;
|
||||
name: string;
|
||||
type: DataType;
|
||||
primaryKey: boolean;
|
||||
unique: boolean;
|
||||
nullable: boolean;
|
||||
createdAt: number;
|
||||
default?: string;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
export interface Relationship {
|
||||
id: string;
|
||||
name: string;
|
||||
sourceSchema?: string;
|
||||
sourceTableId: string;
|
||||
targetSchema?: string;
|
||||
targetTableId: string;
|
||||
sourceFieldId: string;
|
||||
targetFieldId: string;
|
||||
sourceCardinality: Cardinality;
|
||||
targetCardinality: Cardinality;
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
|
||||
export type RelationshipType =
|
||||
| 'one_to_one'
|
||||
| 'one_to_many'
|
||||
| 'many_to_one'
|
||||
| 'many_to_many';
|
||||
export type Cardinality = 'one' | 'many';
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Field } from "./field";
|
||||
|
||||
export interface Table {
|
||||
id: string;
|
||||
name: string;
|
||||
x: number;
|
||||
y: number;
|
||||
fields: Field[];
|
||||
width?: number;
|
||||
order?: number;
|
||||
color: string;
|
||||
createdAt: number;
|
||||
comments?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user