added donut and pole area chart and added its iot data

This commit is contained in:
2025-03-31 19:22:37 +05:30
121 changed files with 4527 additions and 1424 deletions

View File

@@ -29,7 +29,10 @@ export const useSocketStore = create<any>((set: any, get: any) => ({
},
}));
export const useLoadingProgress = create<{ loadingProgress: number; setLoadingProgress: (x: number) => void }>((set) => ({
export const useLoadingProgress = create<{
loadingProgress: number;
setLoadingProgress: (x: number) => void;
}>((set) => ({
loadingProgress: 1,
setLoadingProgress: (x: number) => set({ loadingProgress: x }),
}));
@@ -203,6 +206,20 @@ export const useActiveLayer = create<any>((set: any) => ({
setActiveLayer: (x: any) => set({ activeLayer: x }),
}));
interface RefTextUpdateState {
refTextupdate: number;
setRefTextUpdate: (callback: (currentValue: number) => number | number) => void;
}
export const useRefTextUpdate = create<RefTextUpdateState>((set) => ({
refTextupdate: -1000,
setRefTextUpdate: (callback) =>
set((state) => ({
refTextupdate:
typeof callback === "function" ? callback(state.refTextupdate) : callback,
})),
}));
export const useResetCamera = create<any>((set: any) => ({
resetCamera: false,
setResetCamera: (x: any) => set({ resetCamera: x }),
@@ -214,7 +231,7 @@ export const useAddAction = create<any>((set: any) => ({
}));
export const useActiveTool = create<any>((set: any) => ({
activeTool: "Cursor",
activeTool: "cursor",
setActiveTool: (x: any) => set({ activeTool: x }),
}));
@@ -312,7 +329,9 @@ export const useSelectedPath = create<any>((set: any) => ({
interface SimulationPathsStore {
simulationPaths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[];
setSimulationPaths: (paths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]) => void;
setSimulationPaths: (
paths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
) => void;
}
export const useSimulationPaths = create<SimulationPathsStore>((set) => ({
@@ -352,3 +371,7 @@ export const useAsset3dWidget = create<any>((set: any) => ({
widgetSelect: "",
setWidgetSelect: (x: any) => set({ widgetSelect: x }),
}));
export const useWidgetSubOption = create<any>((set: any) => ({
widgetSubOption: "2D",
setWidgetSubOption: (x: any) => set({ widgetSubOption: x }),
}));

View File

@@ -2,10 +2,17 @@ import { create } from "zustand";
type DroppedObject = {
className: string;
position: [number, number];
id: string;
position: {
top: number | "auto";
left: number | "auto";
right: number | "auto";
bottom: number | "auto";
};
value?: number;
per?: string;
header?: string;
Data: {};
};
type Zone = {
@@ -21,7 +28,12 @@ type DroppedObjectsState = {
updateObjectPosition: (
zoneName: string,
index: number,
newPosition: [number, number]
newPosition: {
top: number | "auto";
left: number | "auto";
right: number | "auto";
bottom: number | "auto";
}
) => void;
};
@@ -64,15 +76,17 @@ export const useDroppedObjectsStore = create<DroppedObjectsState>((set) => ({
}));
export interface DroppedObjects {
header: string;
value: string | number; // ✅ Allows both numbers and formatted strings
per: string;
className: string;
position: [number, number]; // ✅ Ensures position is a tuple
}
export interface Zones {
zoneName: string;
zoneId: string;
objects: DroppedObject[];
}
header: string;
id: string;
Data: {};
value: string | number; // ✅ Allows both numbers and formatted strings
per: string;
className: string;
position: { top: number; left: number; right: number; bottom: number }; // ✅ Ensures position is a tuple
}
export interface Zones {
zoneName: string;
zoneId: string;
objects: DroppedObject[];
}

View File

@@ -23,4 +23,17 @@ const useSubModuleStore = create<SubModuleStore>((set) => ({
setSubModule: (subModule) => set({ subModule }), // Update subModule state
}));
export { useSubModuleStore };
export { useSubModuleStore };
interface ThreeDState {
toggleThreeD: boolean;
setToggleThreeD: (value: boolean) => void;
}
// Create the Zustand store
const useThreeDStore = create<ThreeDState>((set) => ({
toggleThreeD: true, // Initial state
setToggleThreeD: (value) => set({ toggleThreeD: value }), // Action to update the state
}));
export { useThreeDStore };

View File

@@ -33,7 +33,7 @@ interface WidgetStore {
setDraggedAsset: (asset: Widget | null) => void; // Setter for draggedAsset
addWidget: (widget: Widget) => void; // Add a new widget
setWidgets: (widgets: Widget[]) => void; // Replace the entire widgets array
setSelectedChartId: (widget: Widget | null) => void; // Set the selected chart/widget
setSelectedChartId: (widget: any | null) => void; // Set the selected chart/widget
}
// Create the store with Zustand