diff --git a/docs/general/Architecture/ShareComponents12.png b/docs/general/Architecture/ShareComponents12.png new file mode 100644 index 0000000000000000000000000000000000000000..9842d9ee998e4c2f4d4dfcb212effbb27ad1f1b7 Binary files /dev/null and b/docs/general/Architecture/ShareComponents12.png differ diff --git a/docs/general/Architecture/ShareComponents13.png b/docs/general/Architecture/ShareComponents13.png new file mode 100644 index 0000000000000000000000000000000000000000..3f56496b0e050e65b13af25dea72cc14400cbb83 Binary files /dev/null and b/docs/general/Architecture/ShareComponents13.png differ diff --git a/docs/general/Architecture/ShareComponents14.png b/docs/general/Architecture/ShareComponents14.png new file mode 100644 index 0000000000000000000000000000000000000000..d2e06fafdc0dc51658520e895b745b75f19a9aa8 Binary files /dev/null and b/docs/general/Architecture/ShareComponents14.png differ diff --git a/docs/general/Architecture/SharedComponents.md b/docs/general/Architecture/SharedComponents.md index cdb6b756c78d67a4f3f34274db4de98a3f5fc701..f4703c65ca7d662ffd18b7581ee01e9ed4df0a3f 100644 --- a/docs/general/Architecture/SharedComponents.md +++ b/docs/general/Architecture/SharedComponents.md @@ -53,12 +53,26 @@ The Button component creates customizable buttons with different visual styles a Options: - className (string): Additional CSS classes to apply to the button. -- variantStyles (string): Specifies the visual style of the button. Options include 'primary', 'secondary', 'ghost', or 'quiet'. Default is 'primary'. +- variantStyles (string): Specifies the visual style of the button. Options include 'primary', 'secondary', 'ghost', 'quiet' or 'remove'. Default is 'primary'. - icon (string): Specifies the icon to be displayed inside the button. Default is 'chevron-right'. - isIcon (boolean): If true, an icon will be displayed inside the button. Default is false. - isFrontIcon (boolean): If true, the icon will be displayed before the button text. Default is false. ![][image2] +## **ColorPicker** + +[url](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/shared/ColorPicker) +The ColorTilePicker component allows the selection of a color from the palette, including support for transparency (alpha). + +Options: + +- initialColor (Color): The initial color of the component, defined as object with an RGB integer value and an alpha transparency level (0-255). Default initial color is #000000 with full opacity. +- colorChange ((color: string): void): A callback function triggered when the color changes. It receives the new color in HEX format, including alpha transparency. +- height (string): Defines the height of the color selection button. Default is 40px. +- testId (string): A test identifier for selecting the component in tests. Default is 'color-tile-picker'. + +![][image12] + ## **DrawerHeading** [url](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/shared/DrawerHeading) @@ -148,6 +162,46 @@ Options: ![][image9] +## **OutsideClickWrapper** + +[url](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/shared/OutsideClickWrapper) +The OutsideClickWrapper component detects clicks outside its child elements and triggers a callback function. It is useful for closing context menu, dropdown, or any other interactive element when clicking outside. + +Options: + +- onOutsideClick ((): void): A callback function triggered when a click occurs outside the component’s children. +- children (React.ReactNode): The child elements wrapped inside the component. + +## **Select** + +[url](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/shared/Select) +The Select component provides a customizable dropdown menu that allows users to select an option from a list. It supports dynamic options, keyboard navigation, and highlights the selected item. + +Options: + +- options ({ id: number | string; name: string }[]): The list of selectable options, each containing an id and a name. +- selectedId (number | string | null): The id of the currently selected option. If null, no option is selected by default. +- onChange ((selectedId: number | string): void): A callback function triggered when a new option is selected. +- width: (string | number): Defines the dropdown width. Accepts a numeric pixel value or a CSS width string (e.g., '100%'). Default is '100%'. +- listClassName: (string): Additional CSS classes for styling the dropdown list. +- testId: (string): A test identifier for selecting the component in tests. Default is 'select-component'. + +![][image13] + +## **Switch** + +[url](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/shared/Switch) +The Switch component is a customizable toggle switch that allows users to enable or disable a setting. It supports different visual styles and can be controlled programmatically. + +Options: + +- variantStyles (string): Specifies the visual style of the switch. Options include 'primary', 'secondary', 'ghost' or 'quiet'. Default is 'primary'. +- isChecked (boolean): Determines whether the switch is initially checked (enabled). Default is false. +- onToggle ((checked: boolean): void): A callback function triggered when the switch state changes. Receives the new checked state (true or false) as an argument. +- id: (string): An optional id for the switch element. + +![][image14] + ## **Textarea** [url](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/shared/Textarea) @@ -186,3 +240,6 @@ Options: [image9]: ShareComponents9.png [image10]: ShareComponents10.png [image11]: ShareComponents11.png +[image12]: ShareComponents12.png +[image13]: ShareComponents13.png +[image14]: ShareComponents14.png diff --git a/docs/general/MapRendering/MapRendering.md b/docs/general/MapRendering/MapRendering.md new file mode 100644 index 0000000000000000000000000000000000000000..44bbce863045b311395db7bc008e92105620660e --- /dev/null +++ b/docs/general/MapRendering/MapRendering.md @@ -0,0 +1,136 @@ +# Map rendering + +--- + +The core functionality of the application is rendering the entire map in the browser enabling advanced editing capabilities. +All the files responsible for rendering are stored in [**mapElementsRendering**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering) folder. + +## **Rendering elements** + +Classes are used to generate features on the map, based on the data provided by the API, to create the feature that is added to the map and the function that styles it. + +The files used for rendering are organized into subdirectories: + +- [**coords**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering/coords) - stores files used to calculate single coordinates on a map, curves, or coordinates for entire polygons, +- [**elements**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering/elements) - stores the class files used to create a map element on static layers along with the management of its styles. + It also contains files with functions responsible for the correct management of the element, +- [**layer**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering/layer) - contains files for creating and managing elements on dynamic layers of the map, +- [**overlay**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering/overlay) - contains files for managing overlays on the map, +- [**reaction**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering/reaction) - stores files used to create reactions features and manage their styles, +- [**style**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering/style) - contains files for creating and managing styles for map elements, +- [**text**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering/text) - stores files used to find appropriate text coordinates and manage its style. + +### **Shape definitions from backend** + +The **shapes, line types, and arrow types** used for rendering elements are retrieved from the **backend API** and stored in **Redux store ([shapes](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/shapes/))**. +These definitions determine how **elements, reactions, and overlays** should be drawn and styled. +For example: + +- **Shapes** define the appearance of **proteins, genes, and compartments**. +- **Line types** specify how **connections between elements** are displayed. +- **Arrow types** control the **start and end markers** for reactions and interactions. + +This ensures that **all visual elements** on the map are rendered consistently. + +## **Model elements processing** + +The file useOlMapProcessLayer.ts is responsible for processing and rendering elements on the map. +It retrieves data from Redux store, processes it, and adds it as vector layers in OpenLayers to ensure accurate visualization. + +Key responsibilities: + +- fetching and synchronizing data, +- processing and grouping map elements, +- creating and updating static process map layer. + +Rendered elements: + +- Element - protein, homodimer, gene..., +- Reaction - lines, products, substracts, and modifiers, +- Compartment - circular, square, and pathway, +- LineOverlay, +- MarkerOverlay. + +## **Additional layers** + +The rendering, updating, and interaction of additional layers on the map are handled by the [**useOlMapAdditionalLayer**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/MapViewer/utils/config/additionalLayers/useOlMapAdditionalLayers.ts) file. +This file is responsible for managing additional layers beyond the core map elements, enabling additional functionalities such as drawing, modifying, and interacting with user defined objects. + +Key responsibilities: + +- rendering and managing additional layers, +- handling user interactions: + - drawing new elements (rectangles, ovals, lines, text, images), + - transforming and modifying existing objects, + - listens for websocket messages to apply real-time updates, +- synchronizing with Redux store. + +### **Rendering** + +Each additional layer is created using the [**Layer**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/MapViewer/utils/shapes/layer/Layer.ts) class, which generates and manages all elements through dedicated classes for each type of object: + +- [**LayerText**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerText.ts) - handles text elements, +- [**LayerImage**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerImage.ts) - manages image objects, +- [**LayerRect**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerRect.ts) - renders rectangular shapes, +- [**LayerOval**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerOval.ts) - generates oval elements, +- [**LayerLine**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerLine.ts) - draws lines with support for different styles and arrowheads. + +The [**LayersDrawer**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/blob/development/src/components/Map/Drawer/LayersDrawer/LayersDrawer.component.tsx) provides an interface for adding, editing, and deleting these layers. + +**![][image1]** + +### **Drawing elements** + +Drawing, updating, and deleting elements on additional layers can be done by the **LayersDrawer**, +which provides action buttons for each operation. + +#### **Bounding box-based elements** + +For glyphs, texts, and rectangles, the drawing process consists of: + +1. Drawing a bounding box on the map. +2. Filling in required fields such as color, border color, font size, etc. + +#### **Ovals** + +For ovals, the process is similar: + +1. Drawing the oval shape. +2. Selecting color. + +#### **Lines** + +For lines, the drawing process works by: + +1. Drawing line segments using mouse left click. +2. Selecting properties such as color, line type, line width, start arrow, end arrow and arrow scales. + +**![][image2]** +**![][image3]** +**![][image4]** + +### **Editing elements** + +Editing elements on additional layers is performed by selecting an element on the active and visible layer with the left mouse button. Once selected, multiple actions can be performed, including: + +- Moving – Dragging the element to a new position. +- Resizing – Adjusting the element's dimensions by dragging its edges or corners. +- Editing Properties – Modifying attributes such as color, border color, font size, text content, etc. +- Centering the Map – Adjusting the viewport to focus on the selected element. +- Rearranging Layers – Moving the element to the top or bottom of the layer. +- Deleting Elements – Removing the selected element from the layer. + +#### **Editing lines** + +Unlike other elements, lines cannot be moved or resized as a whole. Instead: + +- Vertices (points) can be dragged to reshape the line. +- Arrowheads, colors, and styles can be modified in the LayersDrawer panel. + +**![][image5]** + +[image1]: MapRendering1.png +[image2]: MapRendering2.png +[image3]: MapRendering3.png +[image4]: MapRendering4.png +[image5]: MapRendering5.png diff --git a/docs/general/MapRendering/MapRendering1.png b/docs/general/MapRendering/MapRendering1.png new file mode 100644 index 0000000000000000000000000000000000000000..b42dccc7aa6484a4c41c7f69e60f11266f8e464e Binary files /dev/null and b/docs/general/MapRendering/MapRendering1.png differ diff --git a/docs/general/MapRendering/MapRendering2.png b/docs/general/MapRendering/MapRendering2.png new file mode 100644 index 0000000000000000000000000000000000000000..904c5e02c1dcb902c54034d2a63f8fccccd519d9 Binary files /dev/null and b/docs/general/MapRendering/MapRendering2.png differ diff --git a/docs/general/MapRendering/MapRendering3.png b/docs/general/MapRendering/MapRendering3.png new file mode 100644 index 0000000000000000000000000000000000000000..da735800114e262f2e1562224aa3fb4ff3e32988 Binary files /dev/null and b/docs/general/MapRendering/MapRendering3.png differ diff --git a/docs/general/MapRendering/MapRendering4.png b/docs/general/MapRendering/MapRendering4.png new file mode 100644 index 0000000000000000000000000000000000000000..e82c9994ef4bfaa002421150e605cde504d3f2cc Binary files /dev/null and b/docs/general/MapRendering/MapRendering4.png differ diff --git a/docs/general/MapRendering/MapRendering5.png b/docs/general/MapRendering/MapRendering5.png new file mode 100644 index 0000000000000000000000000000000000000000..849ae9764ce193ba096687cb130763ee9e0f2296 Binary files /dev/null and b/docs/general/MapRendering/MapRendering5.png differ diff --git a/docs/general/Modules/Modules.md b/docs/general/Modules/Modules.md index e85f175714a5728ba0d7a602f12c628033fbe487..85ade2ca210ead69dc9409f8e2ce50c1845ef36b 100644 --- a/docs/general/Modules/Modules.md +++ b/docs/general/Modules/Modules.md @@ -11,22 +11,25 @@ The AppWrapper module serves as a central hub for our React application. It enco - **AppWrapper.component.tsx**: This component serves as a container for aggregating all wrappers required by our React application. It includes essential components such as: - MapInstanceProvider: Provides the application-wide instance of the OpenLayers map. + - WebSocketEntityUpdatesProvider: Provides the application-wide instance of websockets used to update map elements. - Toaster: Responsible for displaying toast notifications using the [Sonner](https://www.npmjs.com/package/sonner) library. ```typescript jsx export const AppWrapper = ({ children }: AppWrapperProps): JSX.Element => ( <MapInstanceProvider> <Provider store={store}> - <> - <Toaster - position="top-center" - visibleToasts={1} - style={{ - width: '700px', - }} - /> - {children} - </> + <WebSocketEntityUpdatesProvider> + <> + <Toaster + position="top-center" + visibleToasts={1} + style={{ + width: '700px', + }} + /> + {children} + </> + </WebSocketEntityUpdatesProvider> </Provider> </MapInstanceProvider> ); @@ -50,56 +53,125 @@ Module FunctionalArea includes: [URL](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/FunctionalArea/ContextMenu) ![][image1] -The module is located in the [**/ContextMenu**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/FunctionalArea/ContextMenu) folder, with the main file being **ContextMenu.component.tsx**. Right-clicking on the map displays a context menu that now includes an option to display the MolArt modal if a UnitProtId exists. The state regarding whether the context menu should be displayed and data regarding the context menu is saved in the redux store in a state called **contextMenu** which code is located in directory [**redux/contextMenu**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/contextMenu). +The module is located in the [**/ContextMenu**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/FunctionalArea/ContextMenu) folder, with the main file being **ContextMenu.component.tsx**. +Right-clicking on the map displays a context menu that now includes an option to display the MolArt modal (if a UnitProtId exists) and addiing a comment. +The state regarding whether the context menu should be displayed and data regarding the context menu is saved in the redux store in a state called **contextMenu** which code is located in directory [**redux/contextMenu**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/contextMenu). + +The context menu dynamically renders additional plugin options using PluginsContextMenu.menuItems. Each entry can have its own styling and an enabled/disabled state. When clicked, plugin menu items trigger a callback function with map coordinates and model data. + +The OutsideClickWrapper ensures that clicking outside the context menu closes it automatically. ```typescript jsx - export const ContextMenu = (): React.ReactNode => { - const dispatch = useAppDispatch(); - const { isOpen, coordinates } = useAppSelector(contextMenuSelector); //visibility - const unitProtId = useAppSelector(searchedBioEntityElementUniProtIdSelector); +export const ContextMenu = (): React.ReactNode => { + const pluginContextMenu = PluginsContextMenu.menuItems; + const model = useAppSelector(currentModelSelector); + const lastPosition = useAppSelector(mapDataLastPositionSelector); + const dispatch = useAppDispatch(); + const { isOpen, coordinates } = useAppSelector(contextMenuSelector); + const unitProtId = useAppSelector(searchedModelElementUniProtIdSelector); + + const isUnitProtIdAvailable = (): boolean => unitProtId !== undefined; + + const getUnitProtId = (): string | undefined => { + return isUnitProtIdAvailable() ? unitProtId : 'no UnitProt ID available'; + }; - const isUnitProtIdAvailable = (): boolean => unitProtId !== undefined; // if context menu option should be blocked + const closeContextMenuFunction = (): void => { + dispatch(closeContextMenu()); + }; - const getUnitProtId = (): string | undefined => { - return isUnitProtIdAvailable() ? unitProtId : 'no UnitProt ID available'; - }; + const handleOpenMolArtClick = (): void => { + if (isUnitProtIdAvailable()) { + closeContextMenuFunction(); + dispatch(openMolArtModalById(unitProtId)); + } + }; - const handleOpenMolArtClick = (): void => { - if (isUnitProtIdAvailable()) { - dispatch(closeContextMenu()); - dispatch(openMolArtModalById(unitProtId)); - } - }; + const handleAddCommentClick = (): void => { + closeContextMenuFunction(); + dispatch(openAddCommentModal()); + }; - return ( - <div - className={twMerge( - 'absolute z-10 rounded-lg border border-[\#DBD9D9] bg-white p-4', - isOpen ? '' : 'hidden', - )} - style={{ - left: `${coordinates[FIRST_ARRAY_ELEMENT]}px`, - top: `${coordinates[SECOND_ARRAY_ELEMENT]}px`, - }} - data-testid="context-modal" - > - <button - className={twMerge( - 'cursor-pointer text-xs font-normal', - !isUnitProtIdAvailable() ? 'cursor-not-allowed text-greyscale-700' : '', - )} - onClick={handleOpenMolArtClick} - type="button" - data-testid="open-molart" - > - Open MolArt ({getUnitProtId()}) - </button> - </div> - ); + const modelId = model ? model.id : ZERO; + + const handleCallback = ( + callback: ( + coordinates: ClickCoordinates, + element: ModelElement | NewReaction | undefined, + ) => void, + ) => { + return () => { + closeContextMenuFunction(); + return callback( + { + modelId, + x: coordinates[FIRST_ARRAY_ELEMENT], + y: coordinates[SECOND_ARRAY_ELEMENT], + zoom: lastPosition.z ? lastPosition.z : DEFAULT_ZOOM, + }, + undefined, + ); + }; + }; + + return ( + <OutsideClickWrapper onOutsideClick={closeContextMenuFunction}> + <div + className={twMerge( + 'absolute z-10 rounded-lg border border-[#DBD9D9] bg-white p-4', + isOpen ? '' : 'hidden', + )} + style={{ + left: `${coordinates[FIRST_ARRAY_ELEMENT]}px`, + top: `${coordinates[SECOND_ARRAY_ELEMENT]}px`, + }} + data-testid="context-modal" + > + <button + className={twMerge( + 'w-full cursor-pointer text-left text-xs font-normal', + !isUnitProtIdAvailable() ? 'cursor-not-allowed text-greyscale-700' : '', + )} + onClick={handleOpenMolArtClick} + type="button" + data-testid="open-molart" + > + Open MolArt ({getUnitProtId()}) + </button> + <hr /> + <button + className={twMerge('w-full cursor-pointer text-left text-xs font-normal')} + onClick={handleAddCommentClick} + type="button" + data-testid="add-comment" + > + Add comment + </button> + {pluginContextMenu.length && <hr />} + + {pluginContextMenu.map(contextMenuEntry => ( + <button + key={contextMenuEntry.id} + id={contextMenuEntry.id} + className={twMerge( + 'cursor-pointer text-xs font-normal', + contextMenuEntry.style, + !contextMenuEntry.enabled ? 'cursor-not-allowed text-greyscale-700' : '', + )} + onClick={handleCallback(contextMenuEntry.callback)} + type="button" + data-testid={contextMenuEntry.id} + > + {contextMenuEntry.name} + </button> + ))} + </div> + </OutsideClickWrapper> + ); }; ``` -![][image2] +![][image19] ### **Cookie banner** @@ -165,6 +237,7 @@ The module containing all available modals within the application: - Overview Images Modal - Publications Modal - LoggedIn Menu Modal +- ... All modals are defined in separate folders within the main [**/Modal**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/FunctionalArea/Modal) directory and utilized in the **Modal.component.tsx** file. The currently displayed modal is determined by the value in the Redux store's state named **modal** available in [redux/modal](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/modal) folder, state includes properties such as **isOpen**, **modalName**, **modalTitle** and other properties for the state of specific modals @@ -190,7 +263,7 @@ All modals are defined in separate folders within the main [**/Modal**](https:// ### **NavBar** [URL](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/FunctionalArea/NavBar) -![][image8] +![][image20] The module located in the [**/NavBar**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/FunctionalArea/NavBar) folder, with the main file being **NavBar.component.tsx**, contains navigation allowing for the opening of specific drawers and docs. It also displays information about the project version and the logos. @@ -217,7 +290,9 @@ The Map module contains components and functionalities specifically related to t - Drawer - Legend - Map Additional Actions -- Map Additional Options +- Map Additional Logos +- Map Background Switch +- Map Loader - Map Viewer - Plugins Drawer @@ -231,7 +306,10 @@ The module containing all available drawers within the application: - Available Plugins Drawer - Bio Entity Drawer +- Comment Drawer - Export Drawer +- Layers Drawer +- Overlays Group Drawer - Overlays Drawer - Project Info Drawer - Reaction Drawer @@ -302,41 +380,68 @@ The module is located in the [**/MapAdditionalActions**](https://gitlab.lcsb.uni - ZoomIn Button \- responsible for zooming in the map. This updates the map zoom in the redux store in a state called map \- located in [redux/map](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/map) - ZoomOut Button \- responsible for zooming out the map. This updates the map zoom in the redux store in a state called map \- located in [redux/map](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/map) -### **Map Additional Options** +### **Map Additional Logos** -[URL](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapAdditionalOptions) -![][image14] +[URL](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapAdditionalLogos) +![][image21] -The module is located in the [**/MapAdditionalOptions**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapAdditionalOptions) folder, with the main file being **MapAdditionalOptions.component.tsx,** contains: +The module is located in the [**/MapAdditionalLogos**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapAdditionalLogos) folder, with the main file being **MapAdditionalLogos.component.tsx,** contains: -- BackgroundsSelector \- allows you to change the map background. Data about available backgrounds is taken from the redux store from the backgrounds state available in [redux/backgrounds](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/backgrounds). When we select a new background, the data is updated in the redux store in the state of maps available in the [redux/map](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/redux/map) folder +- Left Logo Button \- displays an additional logo in the bottom left corner of the map interface. The button links to an external URL if provided and shows an image along with optional text. The data is retrieved from the Redux store in the configuration state, located in redux/configuration. +- Right Logo Button \- displays button next to the Left Logo Button in the bottom left corner of the interface. Like the left logo, this button links to an external URL if available and displays an image with optional text. The data is also managed in the Redux store under configuration, located in redux/configuration. -![][image15] +### **Map Background Switch** + +[URL](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapAdditionalOptions) +![][image22] + +The module is located in the [**/MapBackgroundSwitch**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapBackgroundSwitch) folder, with the main file being **MapBackgroundSwitch.component.tsx,** contains: + +- Background Selection Buttons \- allows users to switch between all available predefined map backgrounds. The available backgrounds are stored in MAP_BACKGROUND_TYPES. +- State Management \- The currently selected background is retrieved from the Redux store in the map state, located in redux/map. ### **Map Viewer** [URL](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer) ![][image16] The module is located in the [**/MapViewer**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer) folder, with the main file being **MapViewer.component.tsx.** -The module is responsible for displaying the map using the Open Layers library. The main initialization is in the **useOlMap.ts** file. This file is a React hook that uses the utils stored in the [**/MapViewer/utils**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils) folder. This folder contains map configuration files for the open layers library, e.g. overlays layer, pins layers in the [**/config**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/config) folder and listeners, e.g. map right click/map left click in the [**/listeners**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/listeners) folder. -All layers for the map are used in the file **useOlMapLayers.ts** and a hook from this file is called in **useOlMap.ts** to initialize all layers. +The module is responsible for displaying the map using the Open Layers library. The main initialization is in the **useOlMap.ts** file. This file is a React hook that uses the utils stored in the [**/MapViewer/utils**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils) folder. +This folder contains map configuration files for the open layers library, e.g. overlays layer, pins layers in the [**/config**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/config) folder and listeners, e.g. map right click/map left click in the [**/listeners**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/listeners) folder. +The [**/mapElementsRendering**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/mapElementsRendering) folder stores all the files needed to render the elements on the map, while the [**/websocket**](https://gitlab.lcsb.uni.lu/minerva/frontend/-/tree/development/src/components/Map/MapViewer/utils/websocket) folder stores the files used to update them. + +All static layers for the map are used in the file **useOlMapLayers.ts** and a hook from this file is called in **useOlMap.ts** to initialize all layers. + +Additional layers that can be added via the layers drawer are rendered using the **useOlMapAdditionalLayers.ts** file. + Same thing happens with listeners, all listeners are used in **useOlMapListeners.ts** file and this hook also called in **useOlMap.ts** to initialize all listeners. +More about rendering elements is presented in the **Map rendering** section. + ```typescript jsx export const useOlMap: UseOlMap = ({ target } = {}) => { const mapRef = React.useRef<null | HTMLDivElement>(null); const { mapInstance, handleSetMapInstance } = useMapInstance(); const view = useOlMapView({ mapInstance }); - useOlMapLayers({ mapInstance }); // layers - useOlMapListeners({ view, mapInstance }); // listeners + + const mapLayers = useOlMapLayers({ mapInstance }); + + useOlMapListeners({ view, mapInstance }); useEffect(() => { - // checking if innerHTML is empty due to possibility of target element cloning by openlayers map instance + // checking if innerHTML is empty due to possibility of target element cloning by OpenLayers map instance if (!mapRef.current || mapRef.current.innerHTML !== '') { return; } const map = new Map({ + interactions: defaults({ + mouseWheelZoom: false, + }).extend([ + new MouseWheelZoom({ + duration: 250, + timeout: 80, + }), + ]), target: target || mapRef.current, }); @@ -350,6 +455,13 @@ export const useOlMap: UseOlMap = ({ target } = {}) => { handleSetMapInstance(map); }, [target, handleSetMapInstance]); + useEffect(() => { + if (!mapInstance) { + return; + } + mapInstance.setLayers(mapLayers); + }, [mapInstance, mapLayers]); + return { mapRef, mapInstance, @@ -439,3 +551,7 @@ The SPA (Single Page Application) module represents the core definition of our S [image16]: Modules16.png [image17]: Modules17.png [image18]: Modules18.png +[image19]: Modules19.png +[image20]: Modules20.png +[image21]: Modules21.png +[image22]: Modules22.png diff --git a/docs/general/Modules/Modules19.png b/docs/general/Modules/Modules19.png new file mode 100644 index 0000000000000000000000000000000000000000..0df36002129a5dda5eed4d8dc18bc40b6b623499 Binary files /dev/null and b/docs/general/Modules/Modules19.png differ diff --git a/docs/general/Modules/Modules20.png b/docs/general/Modules/Modules20.png new file mode 100644 index 0000000000000000000000000000000000000000..52fbc9af704ac5d2ca7f526059ef4b6426828c07 Binary files /dev/null and b/docs/general/Modules/Modules20.png differ diff --git a/docs/general/Modules/Modules21.png b/docs/general/Modules/Modules21.png new file mode 100644 index 0000000000000000000000000000000000000000..679d6b04da54bd12bcc9db4cd1da829ace0d3e28 Binary files /dev/null and b/docs/general/Modules/Modules21.png differ diff --git a/docs/general/Modules/Modules22.png b/docs/general/Modules/Modules22.png new file mode 100644 index 0000000000000000000000000000000000000000..b621ddaadcc255d5b45ab9baa9c6856d07d63f16 Binary files /dev/null and b/docs/general/Modules/Modules22.png differ diff --git a/docs/general/StateManagement/StateManagement.md b/docs/general/StateManagement/StateManagement.md index d4dfe5b3371e7b27700e820abc753bacf653c5bb..e1d15a175ee9483dec17da6fed6c2192c427eaaf 100644 --- a/docs/general/StateManagement/StateManagement.md +++ b/docs/general/StateManagement/StateManagement.md @@ -69,6 +69,11 @@ The state is divided into the following slices, each managed by its correspondin - plugins: state related to plugin functionality. - markers: state related to map markers. - entityNumber: state related to entity numbers displayed on pins. +- glyphs: state related to project glyphs. +- mapEditTools: state related to map element editing tools. +- modelElements: state related to map/model elements. +- newReactions: state related to map reactions. +- shapes: state related to map elements shapes. ![][image2] diff --git a/src/components/AppWrapper/AppWrapper.component.tsx b/src/components/AppWrapper/AppWrapper.component.tsx index 686bd455a6b2bf901287f467ebb053525a8d3257..6607a0f3d4d330aa4704facab8c1fb233a157d59 100644 --- a/src/components/AppWrapper/AppWrapper.component.tsx +++ b/src/components/AppWrapper/AppWrapper.component.tsx @@ -3,7 +3,6 @@ import { MapInstanceProvider } from '@/utils/context/mapInstanceContext'; import { ReactNode } from 'react'; import { Provider } from 'react-redux'; import { Toaster } from 'sonner'; -import { Modal } from '@/components/FunctionalArea/Modal'; import { WebSocketEntityUpdatesProvider } from '@/utils/websocket-entity-updates/webSocketEntityUpdatesProvider'; interface AppWrapperProps { @@ -16,7 +15,6 @@ export const AppWrapper = ({ children }: AppWrapperProps): JSX.Element => { <Provider store={store}> <WebSocketEntityUpdatesProvider> <> - <Modal /> <Toaster position="top-center" visibleToasts={1} diff --git a/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectEditFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectEditFactoryModal.component.tsx index 276b8e512396c9bbb49f1c2b8fa2811504208146..10f79e680c6beda543ec81026828af73438779c6 100644 --- a/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectEditFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectEditFactoryModal.component.tsx @@ -13,7 +13,7 @@ import { showToast } from '@/utils/showToast'; import { closeModal } from '@/redux/modal/modal.slice'; import { SerializedError } from '@reduxjs/toolkit'; import { useMapInstance } from '@/utils/context/mapInstanceContext'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; import { mapEditToolsSetLayerObject } from '@/redux/mapEditTools/mapEditTools.slice'; export const LayerImageObjectEditFactoryModal: React.FC = () => { diff --git a/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectFactoryModal.component.tsx index 040d2984f739d45d1a1b999fb68f232bfd7f4a0e..f8567f03a26d44ea31fa64e3455e9dba2191ebd7 100644 --- a/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectFactoryModal.component.tsx @@ -17,7 +17,7 @@ import './LayerImageObjectForm.styles.css'; import { useMapInstance } from '@/utils/context/mapInstanceContext'; import { layerAddImage } from '@/redux/layers/layers.slice'; import { LayerImageObjectForm } from '@/components/FunctionalArea/Modal/LayerImageObjectModal/LayerImageObjectForm.component'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { mapEditToolsSetActiveAction } from '@/redux/mapEditTools/mapEditTools.slice'; export const LayerImageObjectFactoryModal: React.FC = () => { diff --git a/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineEditFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineEditFactoryModal.component.tsx index 61a9137c19ca485348add07ccd8570b8bd52c94e..7454841800db55bb673527c0b060f444e50396a2 100644 --- a/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineEditFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineEditFactoryModal.component.tsx @@ -13,7 +13,7 @@ import { SerializedError } from '@reduxjs/toolkit'; import { useAppDispatch } from '@/redux/hooks/useAppDispatch'; import { useMapInstance } from '@/utils/context/mapInstanceContext'; import { mapEditToolsLayerLineSelector } from '@/redux/mapEditTools/mapEditTools.selectors'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; import { updateLayerLine } from '@/redux/layers/layers.thunks'; import { layerUpdateLine } from '@/redux/layers/layers.slice'; import { diff --git a/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineFactoryModal.component.tsx index 3b7e1b43d9130663a29abe08a7e70ec66368c12b..e675c393a35fb89be4ed7d38465626ea46b3c8aa 100644 --- a/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineFactoryModal.component.tsx @@ -16,7 +16,7 @@ import { layerLineFactoryStateSelector } from '@/redux/modal/modal.selector'; import { addLayerLine } from '@/redux/layers/layers.thunks'; import { showToast } from '@/utils/showToast'; import { layerAddLine } from '@/redux/layers/layers.slice'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { closeModal } from '@/redux/modal/modal.slice'; import { mapEditToolsSetActiveAction } from '@/redux/mapEditTools/mapEditTools.slice'; import { SerializedError } from '@reduxjs/toolkit'; diff --git a/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalEditFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalEditFactoryModal.component.tsx index bc36060983a2643c523bdad57a8758b50d79450f..09ea3d0613591618598201091e5b86cc7598f6d2 100644 --- a/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalEditFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalEditFactoryModal.component.tsx @@ -13,7 +13,7 @@ import { SerializedError } from '@reduxjs/toolkit'; import { useAppDispatch } from '@/redux/hooks/useAppDispatch'; import { useMapInstance } from '@/utils/context/mapInstanceContext'; import { mapEditToolsLayerObjectSelector } from '@/redux/mapEditTools/mapEditTools.selectors'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; import { LayerOvalFactoryForm } from '@/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalFactory.types'; import { LayerOvalForm } from '@/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalForm.component'; import { updateLayerOval } from '@/redux/layers/layers.thunks'; diff --git a/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalFactoryModal.component.tsx index fb281163f5c4dac3e9a5fbcd3ee68f875957f857..401607e4da43fa5a8783676a9af192271a513b05 100644 --- a/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerOvalFactoryModal/LayerOvalFactoryModal.component.tsx @@ -17,7 +17,7 @@ import { layerObjectFactoryStateSelector } from '@/redux/modal/modal.selector'; import { addLayerOval } from '@/redux/layers/layers.thunks'; import { showToast } from '@/utils/showToast'; import { layerAddOval } from '@/redux/layers/layers.slice'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { closeModal } from '@/redux/modal/modal.slice'; import { mapEditToolsSetActiveAction } from '@/redux/mapEditTools/mapEditTools.slice'; import { SerializedError } from '@reduxjs/toolkit'; diff --git a/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectEditFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectEditFactoryModal.component.tsx index 4ff05d12f62bb49dbc911c538b0ef23b42905361..c594b07e2de9f49c6f1eb5de2ff7b896f02c8ebe 100644 --- a/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectEditFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectEditFactoryModal.component.tsx @@ -17,7 +17,7 @@ import { SerializedError } from '@reduxjs/toolkit'; import { useAppDispatch } from '@/redux/hooks/useAppDispatch'; import { useMapInstance } from '@/utils/context/mapInstanceContext'; import { mapEditToolsLayerObjectSelector } from '@/redux/mapEditTools/mapEditTools.selectors'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; export const LayerRectEditFactoryModal: React.FC = () => { const layerObject = useAppSelector(mapEditToolsLayerObjectSelector); diff --git a/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectFactoryModal.component.tsx index df43b969feebeb306358bd499ebee05ee37e8a3a..21e8cf99988902044030f29b7c41db5f851260d7 100644 --- a/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerRectFactoryModal/LayerRectFactoryModal.component.tsx @@ -17,7 +17,7 @@ import { layerObjectFactoryStateSelector } from '@/redux/modal/modal.selector'; import { addLayerRect } from '@/redux/layers/layers.thunks'; import { showToast } from '@/utils/showToast'; import { layerAddRect } from '@/redux/layers/layers.slice'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { closeModal } from '@/redux/modal/modal.slice'; import { mapEditToolsSetActiveAction } from '@/redux/mapEditTools/mapEditTools.slice'; import { SerializedError } from '@reduxjs/toolkit'; diff --git a/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextEditFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextEditFactoryModal.component.tsx index d80231bd014e0eed40fa1340482d373c28734f0e..0e3c51109e1cc5181aafc4ecaf6ef9b01991f1a0 100644 --- a/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextEditFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextEditFactoryModal.component.tsx @@ -17,7 +17,7 @@ import { layerUpdateText } from '@/redux/layers/layers.slice'; import { useMapInstance } from '@/utils/context/mapInstanceContext'; import { mapEditToolsSetLayerObject } from '@/redux/mapEditTools/mapEditTools.slice'; import { mapEditToolsLayerObjectSelector } from '@/redux/mapEditTools/mapEditTools.selectors'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; export const LayerTextEditFactoryModal: React.FC = () => { const layerObject = useAppSelector(mapEditToolsLayerObjectSelector); diff --git a/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextFactoryModal.component.tsx b/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextFactoryModal.component.tsx index d6112dafcd6fcc121455f2fe14f9a84c95114724..55667e7c5ba57e331b08e2e075d7785946364041 100644 --- a/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextFactoryModal.component.tsx +++ b/src/components/FunctionalArea/Modal/LayerTextFactoryModal/LayerTextFactoryModal.component.tsx @@ -24,7 +24,7 @@ import { closeModal } from '@/redux/modal/modal.slice'; import { SerializedError } from '@reduxjs/toolkit'; import { addLayerText } from '@/redux/layers/layers.thunks'; import { layerAddText } from '@/redux/layers/layers.slice'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { useMapInstance } from '@/utils/context/mapInstanceContext'; import { BLACK_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import { mapEditToolsSetActiveAction } from '@/redux/mapEditTools/mapEditTools.slice'; diff --git a/src/components/Map/Drawer/LayersDrawer/LayersDrawerObjectsList.component.tsx b/src/components/Map/Drawer/LayersDrawer/LayersDrawerObjectsList.component.tsx index 494aac6c9bc12bd542976282eb64e5ecb827f35b..dbef871a7166b0b2fb1f9b339ebe358e5b0e754c 100644 --- a/src/components/Map/Drawer/LayersDrawer/LayersDrawerObjectsList.component.tsx +++ b/src/components/Map/Drawer/LayersDrawer/LayersDrawerObjectsList.component.tsx @@ -33,7 +33,7 @@ import { layerUpdateRect, layerUpdateText, } from '@/redux/layers/layers.slice'; -import removeElementFromLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer'; +import removeElementFromLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer'; import { showToast } from '@/utils/showToast'; import { SerializedError } from '@reduxjs/toolkit'; import { LayerImage, LayerLine, LayerOval, LayerRect, LayerText } from '@/types/models'; @@ -44,7 +44,7 @@ import { mapEditToolsSetLayerLine, mapEditToolsSetLayerObject, } from '@/redux/mapEditTools/mapEditTools.slice'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; import { useSetBounds } from '@/utils/map/useSetBounds'; import { mapEditToolsLayerObjectSelector } from '@/redux/mapEditTools/mapEditTools.selectors'; import { usePointToProjection } from '@/utils/map/usePointToProjection'; @@ -60,7 +60,7 @@ import { LayersDrawerRectItem } from '@/components/Map/Drawer/LayersDrawer/Layer import { LayersDrawerOvalItem } from '@/components/Map/Drawer/LayersDrawer/LayersDrawerOvalItem.component'; import { LayersDrawerLineItem } from '@/components/Map/Drawer/LayersDrawer/LayersDrawerLineItem.component'; import { LayerLineEditFactoryPayload } from '@/components/FunctionalArea/Modal/LayerLineFactoryModal/LayerLineFactory.types'; -import getLayerLineBoundingBoxCoords from '@/components/Map/MapViewer/utils/shapes/layer/utils/getLayerLineBoundingBoxCoords'; +import getLayerLineBoundingBoxCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/getLayerLineBoundingBoxCoords'; interface LayersDrawerObjectsListProps { layerId: number; diff --git a/src/components/Map/MapViewer/utils/config/additionalLayers/useOlMapAdditionalLayers.ts b/src/components/Map/MapViewer/utils/config/additionalLayers/useOlMapAdditionalLayers.ts index 045b66a5450b1665bcbba41e1b25c74fc8216803..7fce1f11d30edd4cc05b700ad0ab897101d79c43 100644 --- a/src/components/Map/MapViewer/utils/config/additionalLayers/useOlMapAdditionalLayers.ts +++ b/src/components/Map/MapViewer/utils/config/additionalLayers/useOlMapAdditionalLayers.ts @@ -18,7 +18,7 @@ import { usePointToProjection } from '@/utils/map/usePointToProjection'; import { MapInstance } from '@/types/map'; import { Geometry, LineString, MultiPolygon } from 'ol/geom'; import Polygon from 'ol/geom/Polygon'; -import Layer from '@/components/Map/MapViewer/utils/shapes/layer/Layer'; +import Layer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer'; import { arrowTypesSelector, lineTypesSelector } from '@/redux/shapes/shapes.selectors'; import { useAppSelector } from '@/redux/hooks/useAppSelector'; import { mapDataSizeSelector } from '@/redux/map/map.selectors'; @@ -28,7 +28,7 @@ import { mapEditToolsLayerNonLineObjectSelector, } from '@/redux/mapEditTools/mapEditTools.selectors'; import { MAP_EDIT_ACTIONS } from '@/redux/mapEditTools/mapEditTools.constants'; -import getDrawBoundingBoxInteraction from '@/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawBoundingBoxInteraction'; +import getDrawBoundingBoxInteraction from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawBoundingBoxInteraction'; import { openLayerImageObjectFactoryModal, openLayerRectFactoryModal, @@ -40,13 +40,13 @@ import { mapEditToolsSetLayerLine, mapEditToolsSetLayerObject, } from '@/redux/mapEditTools/mapEditTools.slice'; -import getTransformInteraction from '@/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction'; +import getTransformInteraction from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction'; import { useWebSocketEntityUpdatesContext } from '@/utils/websocket-entity-updates/webSocketEntityUpdatesProvider'; import processMessage from '@/components/Map/MapViewer/utils/websocket/processMessage'; import { hasPrivilegeToWriteProjectSelector } from '@/redux/user/user.selectors'; -import getDrawOvalInteraction from '@/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawOvalInteraction'; -import getDrawLineInteraction from '@/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawLineInteraction'; -import getModifyLineInteraction from '@/components/Map/MapViewer/utils/shapes/layer/interaction/getModifyLineInteraction'; +import getDrawOvalInteraction from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawOvalInteraction'; +import getDrawLineInteraction from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawLineInteraction'; +import getModifyLineInteraction from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getModifyLineInteraction'; import { LAYER_ELEMENT_TYPES } from '@/components/Map/MapViewer/MapViewer.constants'; export const useOlMapAdditionalLayers = (mapInstance: MapInstance): void => { diff --git a/src/components/Map/MapViewer/utils/config/processLayer/processModelElements.ts b/src/components/Map/MapViewer/utils/config/processLayer/processModelElements.ts index db0e98cb1fc0b9bb0bf42dd9c073b48e3d8ab1d7..6d5b63d6151071077c74715ada0224c16857ff88 100644 --- a/src/components/Map/MapViewer/utils/config/processLayer/processModelElements.ts +++ b/src/components/Map/MapViewer/utils/config/processLayer/processModelElements.ts @@ -8,11 +8,11 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { GetOverlayBioEntityColorByAvailableProperties } from '@/components/Map/MapViewer/utils/config/overlaysLayer/useGetOverlayColor'; import VectorSource from 'ol/source/Vector'; import { MapSize } from '@/redux/map/map.types'; -import Glyph from '@/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph'; -import CompartmentPathway from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway'; -import CompartmentSquare from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare'; -import CompartmentCircle from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle'; -import MapElement from '@/components/Map/MapViewer/utils/shapes/elements/MapElement'; +import Glyph from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph'; +import CompartmentPathway from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway'; +import CompartmentSquare from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare'; +import CompartmentCircle from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle'; +import MapElement from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement'; import { COMPARTMENT_SBO_TERM } from '@/components/Map/MapViewer/MapViewer.constants'; export default function processModelElements( diff --git a/src/components/Map/MapViewer/utils/config/processLayer/useOlMapProcessLayer.ts b/src/components/Map/MapViewer/utils/config/processLayer/useOlMapProcessLayer.ts index 76049978fca51a6e9b193d4d18fc8ac10cc8bbb7..11448c3ae6c2abe31af4cb1119e919b121e47607 100644 --- a/src/components/Map/MapViewer/utils/config/processLayer/useOlMapProcessLayer.ts +++ b/src/components/Map/MapViewer/utils/config/processLayer/useOlMapProcessLayer.ts @@ -37,16 +37,16 @@ import useDebouncedValue from '@/utils/useDebouncedValue'; import { mapBackgroundSelector, mapDataSizeSelector } from '@/redux/map/map.selectors'; import { ZOOM_RESCALING_FACTOR } from '@/constants/map'; import { OverlayOrder } from '@/redux/overlayBioEntity/overlayBioEntity.utils'; -import MarkerOverlay from '@/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay'; -import LineOverlay from '@/components/Map/MapViewer/utils/shapes/overlay/LineOverlay'; -import getOverlays from '@/components/Map/MapViewer/utils/shapes/overlay/getOverlays'; -import Reaction from '@/components/Map/MapViewer/utils/shapes/reaction/Reaction'; -import CompartmentPathway from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway'; -import Glyph from '@/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph'; -import CompartmentCircle from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle'; -import CompartmentSquare from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare'; -import MapElement from '@/components/Map/MapViewer/utils/shapes/elements/MapElement'; -import areOverlayOrdersNotEqual from '@/components/Map/MapViewer/utils/shapes/overlay/areOverlayOrdersNotEqual'; +import MarkerOverlay from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay'; +import LineOverlay from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay'; +import getOverlays from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/getOverlays'; +import Reaction from '@/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction'; +import CompartmentPathway from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway'; +import Glyph from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph'; +import CompartmentCircle from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle'; +import CompartmentSquare from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare'; +import MapElement from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement'; +import areOverlayOrdersNotEqual from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/areOverlayOrdersNotEqual'; import { LAYER_TYPE } from '@/components/Map/MapViewer/MapViewer.constants'; import { modelLoadedSuccessfullySelector, modelLoadingSelector } from '@/redux/selectors'; import { projectSbgnFormatSelector } from '@/redux/project/project.selectors'; diff --git a/src/components/Map/MapViewer/utils/shapes/coords/findLargestExtent.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent.test.ts similarity index 90% rename from src/components/Map/MapViewer/utils/shapes/coords/findLargestExtent.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent.test.ts index 2bd23b66bd872fd729bca5a8799a528b358eff14..f5f4183c164fa5779a95b6ddc5fb0664e50f4389 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/findLargestExtent.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent.test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ -import findLargestExtent from '@/components/Map/MapViewer/utils/shapes/coords/findLargestExtent'; +import findLargestExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent'; import { Extent } from 'ol/extent'; describe('findLargestExtent', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/coords/findLargestExtent.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/findLargestExtent.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getBezierCurve.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBezierCurve.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getBezierCurve.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBezierCurve.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getBezierCurve.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBezierCurve.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getBezierCurve.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBezierCurve.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent.test.ts similarity index 92% rename from src/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent.test.ts index 7c44ef3e0ebb70b25c618e29e5e4f25bb2e57288..a21c38d25422fa45d35afe8715fa45627174255b 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent.test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ import { Extent } from 'ol/extent'; -import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent'; +import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent'; describe('getBoundingBoxFromExtent', () => { it('should return a bounding box for extent', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCenter.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCenter.test.ts similarity index 81% rename from src/components/Map/MapViewer/utils/shapes/coords/getCenter.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCenter.test.ts index 83defeab8eedf5258a04bfae3482f45e69216f05..d6296519e004bd94676ee0dafb13d6bf009ddb2c 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getCenter.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCenter.test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ import { Coordinate } from 'ol/coordinate'; -import getCenter from '@/components/Map/MapViewer/utils/shapes/coords/getCenter'; +import getCenter from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCenter'; describe('getCenter', () => { it('should return a center for coordinates', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCenter.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCenter.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getCenter.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCenter.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCoordsX.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getCoordsX.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCoordsX.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getCoordsX.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCoordsY.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getCoordsY.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCoordsY.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getCoordsY.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCurveCoords.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords.test.ts similarity index 90% rename from src/components/Map/MapViewer/utils/shapes/coords/getCurveCoords.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords.test.ts index 1c824de06de2f7e0cf09a573232d8a99e56b82d1..9d8c1cc7186c3bd8647a74a1f30773083b565650 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getCurveCoords.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords.test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ -import getCoordsX from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsX'; -import getCoordsY from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsY'; +import getCoordsX from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX'; +import getCoordsY from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import { ShapeRelAbsBezierPoint } from '@/types/models'; import getCurveCoords from './getCurveCoords'; diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getCurveCoords.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords.ts similarity index 86% rename from src/components/Map/MapViewer/utils/shapes/coords/getCurveCoords.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords.ts index e75d72f20ac8a80a032da870da44290a5de104bb..76a8676845621a431610a2a2ea07475917584b8f 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getCurveCoords.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords.ts @@ -1,7 +1,7 @@ import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import { Coordinate } from 'ol/coordinate'; -import getCoordsX from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsX'; -import getCoordsY from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsY'; +import getCoordsX from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX'; +import getCoordsY from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY'; import { ShapeRelAbsBezierPoint } from '@/types/models'; export default function getCurveCoords({ diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getDividedExtents.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents.test.ts similarity index 97% rename from src/components/Map/MapViewer/utils/shapes/coords/getDividedExtents.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents.test.ts index 302b8f1115f8cabee5bd96383cf57eb58f4c0972..04a54229bcb504a55fc10750c26ef8d64fa6050a 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getDividedExtents.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents.test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ import { Extent } from 'ol/extent'; -import getDividedExtents from '@/components/Map/MapViewer/utils/shapes/coords/getDividedExtents'; +import getDividedExtents from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents'; describe('getDividedExtents', () => { it('should return original extents if there is no intersection with dividingExtent', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getDividedExtents.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getDividedExtents.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords.test.ts similarity index 89% rename from src/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords.test.ts index 8c4fd4dc66711a872b53d67508b798d9e8c6b1cf..74fed9a15fb11bcdfa330a842b3c3068c161e301 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords.test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ -import getCoordsX from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsX'; -import getCoordsY from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsY'; +import getCoordsX from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX'; +import getCoordsY from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import { ShapeRelAbs } from '@/types/models'; import getEllipseCoords from './getEllipseCoords'; diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords.ts similarity index 89% rename from src/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords.ts index 621007aa573a2822cd231566346a0fd9f25e9feb..a3e0d39cf7d0f88ee23d23dbbcd2e3105a25d64b 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ -import getCoordsX from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsX'; -import getCoordsY from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsY'; +import getCoordsX from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX'; +import getCoordsY from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY'; import { Coordinate } from 'ol/coordinate'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import { ShapeRelAbs } from '@/types/models'; diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getLineSegments.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getLineSegments.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getLineSegments.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getLineSegments.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getLineSegments.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getLineSegments.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getLineSegments.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getLineSegments.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords.test.ts similarity index 89% rename from src/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords.test.ts index 6060feff3dc7b5325bd3e35b795a5a5d97ab5c93..80a72cbb0c0c0209b427226a217af5df82e3d765 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords.test.ts @@ -1,8 +1,8 @@ /* eslint-disable no-magic-numbers */ -import getCoordsX from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsX'; -import getCoordsY from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsY'; -import getCurveCoords from '@/components/Map/MapViewer/utils/shapes/coords/getCurveCoords'; -import getBezierCurve from '@/components/Map/MapViewer/utils/shapes/coords/getBezierCurve'; +import getCoordsX from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX'; +import getCoordsY from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY'; +import getCurveCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords'; +import getBezierCurve from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getBezierCurve'; import { ShapeRelAbs, ShapeRelAbsBezierPoint } from '@/types/models'; import getPolygonCoords from './getPolygonCoords'; diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords.ts similarity index 77% rename from src/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords.ts index db3f1b7ca6da67a2953dbbd08dc1951953c0bcaf..fff794ac719f4edbe7b5fb4b5416d3537f93df31 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords.ts @@ -1,10 +1,10 @@ /* eslint-disable no-magic-numbers */ import { Coordinate } from 'ol/coordinate'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; -import getBezierCurve from '@/components/Map/MapViewer/utils/shapes/coords/getBezierCurve'; -import getCoordsX from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsX'; -import getCoordsY from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsY'; -import getCurveCoords from '@/components/Map/MapViewer/utils/shapes/coords/getCurveCoords'; +import getBezierCurve from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getBezierCurve'; +import getCoordsX from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX'; +import getCoordsY from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY'; +import getCurveCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCurveCoords'; import { ShapeRelAbs, ShapeRelAbsBezierPoint } from '@/types/models'; export default function getPolygonCoords({ diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getRotation.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation.test.ts similarity index 83% rename from src/components/Map/MapViewer/utils/shapes/coords/getRotation.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation.test.ts index 0e26ba924e0112f3e49a8251a8874e81b04c6623..a1ebd07d05256bf08db1a6f016677b2f3adaacce 100644 --- a/src/components/Map/MapViewer/utils/shapes/coords/getRotation.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation.test.ts @@ -1,5 +1,5 @@ /* eslint-disable no-magic-numbers */ -import getRotation from '@/components/Map/MapViewer/utils/shapes/coords/getRotation'; +import getRotation from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation'; import { Coordinate } from 'ol/coordinate'; const testCases: Array<[Coordinate, Coordinate, number]> = [ diff --git a/src/components/Map/MapViewer/utils/shapes/coords/getRotation.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/getRotation.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation.ts diff --git a/src/components/Map/MapViewer/utils/shapes/coords/isPointInEllipse.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/coords/isPointInEllipse.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/coords/isPointInEllipse.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/coords/isPointInEllipse.ts diff --git a/src/components/Map/MapViewer/utils/shapes/elements/BaseMultiPolygon.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/BaseMultiPolygon.ts similarity index 95% rename from src/components/Map/MapViewer/utils/shapes/elements/BaseMultiPolygon.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/BaseMultiPolygon.ts index 2387f21afa8491b32703ba1fd4ce8c7f059c0c9e..9d4fd0953eac2b12400f48f36e178f0fea45fe4d 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/BaseMultiPolygon.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/BaseMultiPolygon.ts @@ -18,12 +18,12 @@ import { import VectorSource from 'ol/source/Vector'; import MapBackgroundsEnum from '@/redux/map/map.enums'; import { MapSize } from '@/redux/map/map.types'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getCoverStyles from '@/components/Map/MapViewer/utils/shapes/style/getCoverStyles'; -import handleSemanticView from '@/components/Map/MapViewer/utils/shapes/elements/handleSemanticView'; -import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getCoverStyles from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles'; +import handleSemanticView from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView'; +import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle'; export interface BaseMapElementProps { type: string; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/Compartment.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/Compartment.ts similarity index 92% rename from src/components/Map/MapViewer/utils/shapes/elements/Compartment.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/Compartment.ts index 18276f442560822448d199b237f04b23ec1c378e..d567e00f717db4406f3c7789c336e8a15af9f739 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/Compartment.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/Compartment.ts @@ -12,10 +12,10 @@ import { } from '@/components/Map/MapViewer/MapViewer.constants'; import VectorSource from 'ol/source/Vector'; import { MapSize } from '@/redux/map/map.types'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import BaseMultiPolygon from '@/components/Map/MapViewer/utils/shapes/elements/BaseMultiPolygon'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import BaseMultiPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/BaseMultiPolygon'; export interface CompartmentProps { id: number; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle.test.ts similarity index 75% rename from src/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle.test.ts index 130e5cad80ac682d3337fc335cbce551e933ecfa..086d58ba221a88bfd726aceb702b0adcaa30427e 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle.test.ts @@ -7,24 +7,24 @@ import { WHITE_COLOR, BLACK_COLOR } from '@/components/Map/MapViewer/MapViewer.c import VectorSource from 'ol/source/Vector'; import MapBackgroundsEnum from '@/redux/map/map.enums'; import { DEFAULT_TILE_SIZE } from '@/constants/map'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import CompartmentCircle, { CompartmentCircleProps, -} from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; +} from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; -jest.mock('../text/getTextStyle'); -jest.mock('../text/getTextCoords'); -jest.mock('./getShapePolygon'); -jest.mock('../style/getStroke'); -jest.mock('../coords/getEllipseCoords'); -jest.mock('../style/getFill'); -jest.mock('../style/rgbToHex'); +jest.mock('../../text/getTextStyle'); +jest.mock('../../text/getTextCoords'); +jest.mock('../utils/getShapePolygon'); +jest.mock('../../style/getStroke'); +jest.mock('../../coords/getEllipseCoords'); +jest.mock('../../style/getFill'); +jest.mock('../../style/rgbToHex'); describe('CompartmentCircle', () => { let props: CompartmentCircleProps; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle.ts similarity index 90% rename from src/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle.ts index afcb3ad2839c16a992c13e935d865c0b7ad69254..74c17cfe87bffeffb65950a2215fcfe1063e3fad 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentCircle.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentCircle.ts @@ -11,11 +11,11 @@ import { import { Color } from '@/types/models'; import VectorSource from 'ol/source/Vector'; import { MapSize } from '@/redux/map/map.types'; -import Compartment from '@/components/Map/MapViewer/utils/shapes/elements/Compartment'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; -import getCoordsX from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsX'; -import getCoordsY from '@/components/Map/MapViewer/utils/shapes/coords/getCoordsY'; -import isPointInEllipse from '@/components/Map/MapViewer/utils/shapes/coords/isPointInEllipse'; +import Compartment from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/Compartment'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; +import getCoordsX from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsX'; +import getCoordsY from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCoordsY'; +import isPointInEllipse from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/isPointInEllipse'; export type CompartmentCircleProps = { id: number; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway.test.ts similarity index 75% rename from src/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway.test.ts index dc369e18a378d89ae18079e7e46c87252fe2a25c..cb94c64a9a3858237c015b841c4e7193bc6acf02 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway.test.ts @@ -7,24 +7,24 @@ import { WHITE_COLOR, BLACK_COLOR } from '@/components/Map/MapViewer/MapViewer.c import VectorSource from 'ol/source/Vector'; import MapBackgroundsEnum from '@/redux/map/map.enums'; import { DEFAULT_TILE_SIZE } from '@/constants/map'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import CompartmentPathway, { CompartmentPathwayProps, -} from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; +} from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; -jest.mock('../text/getTextStyle'); -jest.mock('../text/getTextCoords'); -jest.mock('./getShapePolygon'); -jest.mock('../style/getStroke'); -jest.mock('../coords/getEllipseCoords'); -jest.mock('../style/getFill'); -jest.mock('../style/rgbToHex'); +jest.mock('../../text/getTextStyle'); +jest.mock('../../text/getTextCoords'); +jest.mock('../utils/getShapePolygon'); +jest.mock('../../style/getStroke'); +jest.mock('../../coords/getEllipseCoords'); +jest.mock('../../style/getFill'); +jest.mock('../../style/rgbToHex'); describe('CompartmentPathway', () => { let props: CompartmentPathwayProps; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway.ts similarity index 90% rename from src/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway.ts index c8c2b071a800efa8ec4638a4793df12afa95c897..c94817f8109d4c5cc7a3388d9633e4773ae5689b 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentPathway.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentPathway.ts @@ -12,11 +12,11 @@ import { Color } from '@/types/models'; import VectorSource from 'ol/source/Vector'; import { Style } from 'ol/style'; import { MapSize } from '@/redux/map/map.types'; -import BaseMultiPolygon from '@/components/Map/MapViewer/utils/shapes/elements/BaseMultiPolygon'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; +import BaseMultiPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/BaseMultiPolygon'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; export type CompartmentPathwayProps = { id: number; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare.test.ts similarity index 77% rename from src/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare.test.ts index 48befabd15d690ef5b1adb03d61820ca9fef88ff..ab505ed5cac20a7f2010d742b6164d4b6fa6a828 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare.test.ts @@ -7,22 +7,22 @@ import { WHITE_COLOR, BLACK_COLOR } from '@/components/Map/MapViewer/MapViewer.c import VectorSource from 'ol/source/Vector'; import MapBackgroundsEnum from '@/redux/map/map.enums'; import { DEFAULT_TILE_SIZE } from '@/constants/map'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import CompartmentSquare, { CompartmentSquareProps, -} from '@/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare'; -import getPolygonCoords from '@/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; +} from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare'; +import getPolygonCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; -jest.mock('../text/getTextStyle'); -jest.mock('../text/getTextCoords'); -jest.mock('../style/getStroke'); -jest.mock('../coords/getPolygonCoords'); -jest.mock('../style/getFill'); -jest.mock('../style/rgbToHex'); +jest.mock('../../text/getTextStyle'); +jest.mock('../../text/getTextCoords'); +jest.mock('../../style/getStroke'); +jest.mock('../../coords/getPolygonCoords'); +jest.mock('../../style/getFill'); +jest.mock('../../style/rgbToHex'); describe('CompartmentSquare', () => { let props: CompartmentSquareProps; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare.ts index 6a3b183b34d44f0fad1fb6f87e9454c0853f778b..749354e2e20f0d226d0862157c3a765732512679 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/CompartmentSquare.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/CompartmentSquare.ts @@ -10,8 +10,8 @@ import { import { Color } from '@/types/models'; import VectorSource from 'ol/source/Vector'; import { MapSize } from '@/redux/map/map.types'; -import Compartment from '@/components/Map/MapViewer/utils/shapes/elements/Compartment'; -import getPolygonCoords from '@/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords'; +import Compartment from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Compartment/Compartment'; +import getPolygonCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords'; export type CompartmentSquareProps = { id: number; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph.test.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph.test.ts index 2680f7ef5e570bb062070cb271214e91a6be397d..f6da373c670939e0ea2ac5b32fe83a57c2b3112d 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph.test.ts @@ -2,7 +2,9 @@ import { Feature, Map, View } from 'ol'; import { Style } from 'ol/style'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; -import Glyph, { GlyphProps } from '@/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph'; +import Glyph, { + GlyphProps, +} from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph'; import { MapInstance } from '@/types/map'; import Polygon from 'ol/geom/Polygon'; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph.ts similarity index 96% rename from src/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph.ts index edad8cde3d3190d13c2bcf64fd0f5b0b729d12b7..c142452a18991196b7e3b353dadeae9d7a1d9cf2 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph.ts @@ -14,10 +14,10 @@ import { FEATURE_TYPE } from '@/constants/features'; import { WHITE_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import { MapSize } from '@/redux/map/map.types'; import { LayerImage } from '@/types/models'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import getScaledElementStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle'; -import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/shapes/elements/getBoundingBoxPolygon'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import getScaledElementStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle'; +import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getBoundingBoxPolygon'; export type GlyphProps = { elementId: number; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/MapElement.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement.test.ts similarity index 82% rename from src/components/Map/MapViewer/utils/shapes/elements/MapElement.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement.test.ts index 3a943e0c473a67271bf4869690c84bc0c472a9b7..36dd06c3c37fdc5639f4a62d60106b0725660842 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/MapElement.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement.test.ts @@ -8,19 +8,19 @@ import { shapesFixture } from '@/models/fixtures/shapesFixture'; import VectorSource from 'ol/source/Vector'; import MapBackgroundsEnum from '@/redux/map/map.enums'; import { DEFAULT_TILE_SIZE } from '@/constants/map'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import MapElement, { MapElementProps, -} from '@/components/Map/MapViewer/utils/shapes/elements/MapElement'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; +} from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; jest.mock('../text/getTextStyle'); jest.mock('../text/getTextCoords'); -jest.mock('./getShapePolygon'); +jest.mock('./utils/getShapePolygon'); jest.mock('../style/getStroke'); jest.mock('../style/getFill'); jest.mock('../style/rgbToHex'); diff --git a/src/components/Map/MapViewer/utils/shapes/elements/MapElement.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/elements/MapElement.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement.ts index 0fd845f090830fe3a5f55b9a15cb1f84e2ce5efd..d4c4b75a90f472643441b6be7df9ad5225235760 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/MapElement.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/MapElement.ts @@ -28,15 +28,15 @@ import { OverlayOrder } from '@/redux/overlayBioEntity/overlayBioEntity.utils'; import { GetOverlayBioEntityColorByAvailableProperties } from '@/components/Map/MapViewer/utils/config/overlaysLayer/useGetOverlayColor'; import VectorSource from 'ol/source/Vector'; import { MapSize } from '@/redux/map/map.types'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import BaseMultiPolygon from '@/components/Map/MapViewer/utils/shapes/elements/BaseMultiPolygon'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/shapes/elements/getBoundingBoxPolygon'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import BaseMultiPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/BaseMultiPolygon'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getBoundingBoxPolygon'; export type MapElementProps = { id: number; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/getArrowFeature.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getArrowFeature.ts similarity index 86% rename from src/components/Map/MapViewer/utils/shapes/elements/getArrowFeature.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getArrowFeature.ts index cb7f2d1c2cf3f9a32d1f76831d016809f750c962..f0a7194b380e6a7a8d92525336d094f6aad33d66 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/getArrowFeature.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getArrowFeature.ts @@ -11,10 +11,10 @@ import { WHITE_COLOR, } from '@/components/Map/MapViewer/MapViewer.constants'; import { ArrowTypeDict } from '@/redux/shapes/shapes.types'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import { Stroke } from 'ol/style'; export default function getArrowFeature({ diff --git a/src/components/Map/MapViewer/utils/shapes/elements/getBoundingBoxPolygon.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getBoundingBoxPolygon.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/elements/getBoundingBoxPolygon.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getBoundingBoxPolygon.ts diff --git a/src/components/Map/MapViewer/utils/shapes/elements/getShapePolygon.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon.test.ts similarity index 92% rename from src/components/Map/MapViewer/utils/shapes/elements/getShapePolygon.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon.test.ts index 5254b54eb2784225a7b04f7ae053beddb377d8ff..dd3d97c2ba5ae0f199ab589978b22f51022ac0ec 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/getShapePolygon.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon.test.ts @@ -1,12 +1,12 @@ /* eslint-disable no-magic-numbers */ -import getPolygonCoords from '@/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; +import getPolygonCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; import Polygon from 'ol/geom/Polygon'; import { Shape } from '@/types/models'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; -jest.mock('../coords/getPolygonCoords'); -jest.mock('../coords/getEllipseCoords'); +jest.mock('../../coords/getPolygonCoords'); +jest.mock('../../coords/getEllipseCoords'); describe('getShapePolygon', () => { const mockPointToProjection = jest.fn(point => [point.x, point.y]); diff --git a/src/components/Map/MapViewer/utils/shapes/elements/getShapePolygon.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon.ts similarity index 78% rename from src/components/Map/MapViewer/utils/shapes/elements/getShapePolygon.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon.ts index a2082fe3d3a004e9de4abdb09448dc0fbcf28627..a49352b4ac6153a6784eb3f935c40d8fd45ad0fb 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/getShapePolygon.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon.ts @@ -1,11 +1,11 @@ /* eslint-disable no-magic-numbers */ import Polygon from 'ol/geom/Polygon'; import { Coordinate } from 'ol/coordinate'; -import getPolygonCoords from '@/components/Map/MapViewer/utils/shapes/coords/getPolygonCoords'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; +import getPolygonCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getPolygonCoords'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; import { Shape } from '@/types/models'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; -import getCenter from '@/components/Map/MapViewer/utils/shapes/coords/getCenter'; +import getCenter from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getCenter'; export default function getShapePolygon({ shape, diff --git a/src/components/Map/MapViewer/utils/shapes/elements/handleSemanticView.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView.test.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/elements/handleSemanticView.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView.test.ts index aa46b7773a585024d4e337d12364ca44792ae346..2851813b87624f1ff18c041285d6b71684b1be21 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/handleSemanticView.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView.test.ts @@ -1,14 +1,14 @@ /* eslint-disable no-magic-numbers */ import Feature from 'ol/Feature'; import VectorSource from 'ol/source/Vector'; -import getDividedExtents from '@/components/Map/MapViewer/utils/shapes/coords/getDividedExtents'; -import findLargestExtent from '@/components/Map/MapViewer/utils/shapes/coords/findLargestExtent'; -import handleSemanticView from '@/components/Map/MapViewer/utils/shapes/elements/handleSemanticView'; +import getDividedExtents from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents'; +import findLargestExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent'; +import handleSemanticView from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView'; import Geometry from 'ol/geom/Geometry'; import { fromExtent } from 'ol/geom/Polygon'; -jest.mock('../coords/getDividedExtents'); -jest.mock('../coords/findLargestExtent'); +jest.mock('../../coords/getDividedExtents'); +jest.mock('../../coords/findLargestExtent'); describe('handleSemanticView', () => { let vectorSource: VectorSource; diff --git a/src/components/Map/MapViewer/utils/shapes/elements/handleSemanticView.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView.ts similarity index 95% rename from src/components/Map/MapViewer/utils/shapes/elements/handleSemanticView.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView.ts index 20c6efbb47be2c7798f42206e95434dd057c5e1c..1424da929d1c65eadcc3d4cb5babc2077563694f 100644 --- a/src/components/Map/MapViewer/utils/shapes/elements/handleSemanticView.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/handleSemanticView.ts @@ -6,10 +6,10 @@ import { COMPLEX_SBO_TERMS, MAP_ELEMENT_TYPES, } from '@/components/Map/MapViewer/MapViewer.constants'; -import findLargestExtent from '@/components/Map/MapViewer/utils/shapes/coords/findLargestExtent'; -import getDividedExtents from '@/components/Map/MapViewer/utils/shapes/coords/getDividedExtents'; -import isFeatureInCompartment from '@/components/Map/MapViewer/utils/shapes/elements/isFeatureInCompartment'; -import isFeatureInPathway from '@/components/Map/MapViewer/utils/shapes/elements/isFeatureInPathway'; +import findLargestExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/findLargestExtent'; +import getDividedExtents from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getDividedExtents'; +import isFeatureInCompartment from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInCompartment'; +import isFeatureInPathway from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInPathway'; export default function handleSemanticView({ vectorSource, diff --git a/src/components/Map/MapViewer/utils/shapes/elements/isFeatureInCompartment.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInCompartment.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/elements/isFeatureInCompartment.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInCompartment.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/elements/isFeatureInCompartment.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInCompartment.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/elements/isFeatureInCompartment.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInCompartment.ts diff --git a/src/components/Map/MapViewer/utils/shapes/elements/isFeatureInPathway.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInPathway.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/elements/isFeatureInPathway.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/isFeatureInPathway.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/Layer.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer.test.ts similarity index 87% rename from src/components/Map/MapViewer/utils/shapes/layer/Layer.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer.test.ts index 16d29e66a2910aab2020e82db93b2413694ab66e..21c22aca8f99dc15ae55b03337d3329d1e34229f 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/Layer.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer.test.ts @@ -5,11 +5,13 @@ import View from 'ol/View'; import { WHITE_COLOR, BLACK_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import VectorSource from 'ol/source/Vector'; import VectorLayer from 'ol/layer/Vector'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; -import Layer, { LayerProps } from '@/components/Map/MapViewer/utils/shapes/layer/Layer'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; +import Layer, { + LayerProps, +} from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer'; jest.mock('../text/getTextCoords'); jest.mock('../text/getTextStyle'); diff --git a/src/components/Map/MapViewer/utils/shapes/layer/Layer.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/layer/Layer.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer.ts index 3ce823db113da7a3fae7f96b0ace94f4f69f5cc9..27a757449927ca289d23104264ce2d8e5f443fc2 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/Layer.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/Layer.ts @@ -17,11 +17,11 @@ import { HorizontalAlign, VerticalAlign } from '@/components/Map/MapViewer/MapVi import { ArrowTypeDict, LineTypeDict } from '@/redux/shapes/shapes.types'; import { LAYER_TYPE } from '@/components/Map/MapViewer/MapViewer.constants'; import { MapSize } from '@/redux/map/map.types'; -import LayerText from '@/components/Map/MapViewer/utils/shapes/layer/elements/LayerText'; -import LayerImage from '@/components/Map/MapViewer/utils/shapes/layer/elements/LayerImage'; -import LayerRect from '@/components/Map/MapViewer/utils/shapes/layer/elements/LayerRect'; -import LayerOval from '@/components/Map/MapViewer/utils/shapes/layer/elements/LayerOval'; -import LayerLine from '@/components/Map/MapViewer/utils/shapes/layer/elements/LayerLine'; +import LayerText from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText'; +import LayerImage from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerImage'; +import LayerRect from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerRect'; +import LayerOval from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerOval'; +import LayerLine from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerLine'; export interface LayerProps { zIndex: number; diff --git a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerImage.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerImage.ts similarity index 96% rename from src/components/Map/MapViewer/utils/shapes/layer/elements/LayerImage.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerImage.ts index b7656701f72f80ed954d56a25bba16a7585aa714..40b82a8638fffa8af729b273dc7042df03310567 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerImage.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerImage.ts @@ -2,7 +2,7 @@ import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import { MapInstance } from '@/types/map'; import { MapSize } from '@/redux/map/map.types'; import { LayerImage as LayerImageModel } from '@/types/models'; -import Glyph from '@/components/Map/MapViewer/utils/shapes/elements/Glyph/Glyph'; +import Glyph from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/Glyph/Glyph'; import { store } from '@/redux/store'; import { updateLayerImageObject } from '@/redux/layers/layers.thunks'; import { layerUpdateImage } from '@/redux/layers/layers.slice'; diff --git a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerLine.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerLine.ts similarity index 95% rename from src/components/Map/MapViewer/utils/shapes/layer/elements/LayerLine.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerLine.ts index 160ac2a7114220aa61a11f6dc29d79944028d33b..ec712b50dcaf5a2158a0909632993077d4edce73 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerLine.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerLine.ts @@ -5,18 +5,18 @@ import { Feature } from 'ol'; import { FeatureLike } from 'ol/Feature'; import { MapInstance } from '@/types/map'; import { Arrow, Color, LayerLine as LayerLineModel, Segment } from '@/types/models'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getScaledElementStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getScaledElementStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle'; import { Stroke } from 'ol/style'; import { MapSize } from '@/redux/map/map.types'; import { Coordinate } from 'ol/coordinate'; import { LAYER_ELEMENT_TYPES, SELECT_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import { LineString, MultiPolygon } from 'ol/geom'; -import getRotation from '@/components/Map/MapViewer/utils/shapes/coords/getRotation'; +import getRotation from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation'; import { ArrowTypeDict, LineTypeDict } from '@/redux/shapes/shapes.types'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getArrowFeature from '@/components/Map/MapViewer/utils/shapes/elements/getArrowFeature'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getArrowFeature from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getArrowFeature'; import { updateLayerLine } from '@/redux/layers/layers.thunks'; import { store } from '@/redux/store'; import { mapEditToolsSetLayerLine } from '@/redux/mapEditTools/mapEditTools.slice'; diff --git a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerOval.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerOval.ts similarity index 92% rename from src/components/Map/MapViewer/utils/shapes/layer/elements/LayerOval.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerOval.ts index 8fb0635d1200ea715e0f51ed43e726d92157850b..5fd2822edd761e1baac4c2cb7098dd76a57a9838 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerOval.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerOval.ts @@ -5,15 +5,15 @@ import { Feature } from 'ol'; import { FeatureLike } from 'ol/Feature'; import { MapInstance } from '@/types/map'; import { Color, LayerOval as LayerOvalModel } from '@/types/models'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import Polygon from 'ol/geom/Polygon'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getScaledElementStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getScaledElementStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle'; import { Stroke } from 'ol/style'; import { MapSize } from '@/redux/map/map.types'; import { Coordinate } from 'ol/coordinate'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; import { LAYER_ELEMENT_TYPES, TRANSPARENT_COLOR, @@ -23,7 +23,7 @@ import { store } from '@/redux/store'; import { updateLayerOval } from '@/redux/layers/layers.thunks'; import { layerUpdateOval } from '@/redux/layers/layers.slice'; import { mapEditToolsSetLayerObject } from '@/redux/mapEditTools/mapEditTools.slice'; -import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/shapes/elements/getBoundingBoxPolygon'; +import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getBoundingBoxPolygon'; export interface LayerOvalProps { elementId: number; diff --git a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerRect.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerRect.ts similarity index 93% rename from src/components/Map/MapViewer/utils/shapes/layer/elements/LayerRect.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerRect.ts index 09bcb573b208cc4d8edb46820722a59b02de8504..40563db5afd9b25d2ec83548c330af4b13d5fe9b 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerRect.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerRect.ts @@ -5,11 +5,11 @@ import { Feature } from 'ol'; import { FeatureLike } from 'ol/Feature'; import { MapInstance } from '@/types/map'; import { Color, LayerRect as LayerRectModel } from '@/types/models'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import Polygon from 'ol/geom/Polygon'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getScaledElementStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getScaledElementStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle'; import { Stroke } from 'ol/style'; import { MapSize } from '@/redux/map/map.types'; import { Coordinate } from 'ol/coordinate'; @@ -18,7 +18,7 @@ import { store } from '@/redux/store'; import { updateLayerRect } from '@/redux/layers/layers.thunks'; import { layerUpdateRect } from '@/redux/layers/layers.slice'; import { mapEditToolsSetLayerObject } from '@/redux/mapEditTools/mapEditTools.slice'; -import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/shapes/elements/getBoundingBoxPolygon'; +import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getBoundingBoxPolygon'; import { LAYER_ELEMENT_TYPES } from '@/components/Map/MapViewer/MapViewer.constants'; export interface LayerRectProps { diff --git a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerText.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText.test.ts similarity index 84% rename from src/components/Map/MapViewer/utils/shapes/layer/elements/LayerText.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText.test.ts index 7db76f34349d662a45cccf9d5d0e529e9ad22870..64e5aa5e554bab8d4adaad0fe838bb6100f18c5a 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerText.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText.test.ts @@ -5,10 +5,10 @@ import View from 'ol/View'; import { BLACK_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import LayerText, { LayerTextProps, -} from '@/components/Map/MapViewer/utils/shapes/layer/elements/LayerText'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; +} from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; import { DEFAULT_TILE_SIZE } from '@/constants/map'; jest.mock('../../text/getTextCoords'); diff --git a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerText.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText.ts similarity index 92% rename from src/components/Map/MapViewer/utils/shapes/layer/elements/LayerText.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText.ts index 7eea7552e8e6e269a783877ebb6f4d03d55a12fd..9b65ffaad557b282520b2a36b126b425feb0e112 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/elements/LayerText.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/elements/LayerText.ts @@ -15,22 +15,22 @@ import { HorizontalAlign, VerticalAlign, } from '@/components/Map/MapViewer/MapViewer.types'; -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import Polygon from 'ol/geom/Polygon'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getScaledElementStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getScaledElementStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle'; import { Stroke } from 'ol/style'; import { MapSize } from '@/redux/map/map.types'; -import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent'; +import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent'; import { Coordinate } from 'ol/coordinate'; import { store } from '@/redux/store'; import { updateLayerText } from '@/redux/layers/layers.thunks'; import { layerUpdateText } from '@/redux/layers/layers.slice'; import { mapEditToolsSetLayerObject } from '@/redux/mapEditTools/mapEditTools.slice'; -import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/shapes/elements/getBoundingBoxPolygon'; +import getBoundingBoxPolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getBoundingBoxPolygon'; export interface LayerTextProps { elementId: number; diff --git a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawBoundingBoxInteraction.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawBoundingBoxInteraction.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawBoundingBoxInteraction.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawBoundingBoxInteraction.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawBoundingBoxInteraction.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawBoundingBoxInteraction.ts similarity index 97% rename from src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawBoundingBoxInteraction.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawBoundingBoxInteraction.ts index 6389e045ff723d35da936b5e56d98cabf69092f6..fbb1505a6a0442b95f273a011e4edd7442ecc358 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawBoundingBoxInteraction.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawBoundingBoxInteraction.ts @@ -5,7 +5,7 @@ import Polygon from 'ol/geom/Polygon'; import { MapSize } from '@/redux/map/map.types'; import { AppDispatch } from '@/redux/store'; import { Coordinate } from 'ol/coordinate'; -import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent'; +import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent'; import { BoundingBox } from '@/components/Map/MapViewer/MapViewer.types'; import { AnyAction } from '@reduxjs/toolkit'; import { Extent } from 'ol/extent'; diff --git a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawLineInteraction.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawLineInteraction.ts similarity index 96% rename from src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawLineInteraction.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawLineInteraction.ts index cfc0679d491e7ef96303a61538371acb5b4c2e62..ba3a9f89ffd14fbbe42ee1bad9f88bc5df7ada28 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawLineInteraction.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawLineInteraction.ts @@ -7,7 +7,7 @@ import { openLayerLineFactoryModal } from '@/redux/modal/modal.slice'; import SimpleGeometry from 'ol/geom/SimpleGeometry'; import { Coordinate } from 'ol/coordinate'; import { Extent } from 'ol/extent'; -import getLineSegmentsFromCoords from '@/components/Map/MapViewer/utils/shapes/layer/utils/getLineSegmentsFromCoords'; +import getLineSegmentsFromCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/getLineSegmentsFromCoords'; import { never } from 'ol/events/condition'; export default function getDrawLineInteraction({ diff --git a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawOvalInteraction.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawOvalInteraction.ts similarity index 93% rename from src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawOvalInteraction.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawOvalInteraction.ts index 0d81e14f1ab8699d1f2568dd1aa317d1cd55e808..46d169ecfd3e0721d0a835f373699dfc42ee2341 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getDrawOvalInteraction.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getDrawOvalInteraction.ts @@ -5,9 +5,9 @@ import Polygon from 'ol/geom/Polygon'; import { MapSize } from '@/redux/map/map.types'; import { AppDispatch } from '@/redux/store'; import { Coordinate } from 'ol/coordinate'; -import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent'; +import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent'; import { Extent } from 'ol/extent'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; import { openLayerOvalFactoryModal } from '@/redux/modal/modal.slice'; export default function getDrawOvalInteraction( diff --git a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getModifyLineInteraction.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getModifyLineInteraction.ts similarity index 98% rename from src/components/Map/MapViewer/utils/shapes/layer/interaction/getModifyLineInteraction.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getModifyLineInteraction.ts index f9106cf76e809cb8335ff4a5fc9e0cb95b5c510c..cab5f7c9935764b640423b4e56a154945d3e3d2e 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getModifyLineInteraction.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getModifyLineInteraction.ts @@ -2,7 +2,7 @@ import { Select, Snap } from 'ol/interaction'; import { Collection, Feature } from 'ol'; import { Geometry, LineString } from 'ol/geom'; -import getLineSegmentsFromCoords from '@/components/Map/MapViewer/utils/shapes/layer/utils/getLineSegmentsFromCoords'; +import getLineSegmentsFromCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/getLineSegmentsFromCoords'; import { MapSize } from '@/redux/map/map.types'; import { SelectEvent } from 'ol/interaction/Select'; import { AppDispatch } from '@/redux/store'; diff --git a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction.test.ts similarity index 95% rename from src/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction.test.ts index 1cb1fec97800d98c08ca67e1467c3da685d0cded..58a533c27f2a85fb94cde977e441d6ef835f50e4 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction.test.ts @@ -10,7 +10,7 @@ import { DEFAULT_TILE_SIZE } from '@/constants/map'; import { Collection, Feature } from 'ol'; import Transform from 'ol-ext/interaction/Transform'; import { Geometry } from 'ol/geom'; -import getTransformInteraction from '@/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction'; +import getTransformInteraction from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction'; jest.mock('../../../../../../../utils/map/latLngToPoint', () => ({ latLngToPoint: jest.fn(latLng => ({ x: latLng[0], y: latLng[1] })), diff --git a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction.ts similarity index 97% rename from src/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction.ts index 7c55f39c3d5f07d9bed6c0b0313591109938f7e3..8f11e519912fb9547cbfa055ce697202d1f98b23 100644 --- a/src/components/Map/MapViewer/utils/shapes/layer/interaction/getTransformInteraction.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/interaction/getTransformInteraction.ts @@ -5,13 +5,13 @@ import Transform from 'ol-ext/interaction/Transform'; import { Geometry } from 'ol/geom'; import { Collection, Feature } from 'ol'; import BaseEvent from 'ol/events/Event'; -import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/shapes/coords/getBoundingBoxFromExtent'; +import getBoundingBoxFromExtent from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getBoundingBoxFromExtent'; import { MapSize } from '@/redux/map/map.types'; import { Extent } from 'ol/extent'; import { mapEditToolsSetLayerObject } from '@/redux/mapEditTools/mapEditTools.slice'; import { openDrawer } from '@/redux/drawer/drawer.slice'; import { LAYER_ELEMENT_TYPES } from '@/components/Map/MapViewer/MapViewer.constants'; -import getEllipseCoords from '@/components/Map/MapViewer/utils/shapes/coords/getEllipseCoords'; +import getEllipseCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getEllipseCoords'; export default function getTransformInteraction( dispatch: AppDispatch, diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/getLayerLineBoundingBoxCoords.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/getLayerLineBoundingBoxCoords.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/getLayerLineBoundingBoxCoords.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/getLayerLineBoundingBoxCoords.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/getLineSegmentsFromCoords.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/getLineSegmentsFromCoords.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/getLineSegmentsFromCoords.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/getLineSegmentsFromCoords.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/removeLayer.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeLayer.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/removeLayer.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeLayer.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/updateElement.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/updateElement.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement.ts diff --git a/src/components/Map/MapViewer/utils/shapes/layer/utils/updateLayer.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateLayer.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/layer/utils/updateLayer.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateLayer.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/LineOverlay.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay.test.ts similarity index 79% rename from src/components/Map/MapViewer/utils/shapes/overlay/LineOverlay.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay.test.ts index 0888de5c33f821595f1ce497a34e957f0d44a9ce..eba631747586522d854283f547eb7da7b992ca1d 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/LineOverlay.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay.test.ts @@ -1,13 +1,13 @@ /* eslint-disable no-magic-numbers */ import { Feature, Map } from 'ol'; import { Stroke, Style } from 'ol/style'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import View from 'ol/View'; import LineOverlay, { LineOverlayProps, -} from '@/components/Map/MapViewer/utils/shapes/overlay/LineOverlay'; +} from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay'; import { Coordinate } from 'ol/coordinate'; jest.mock('../style/getStroke'); diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/LineOverlay.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay.ts similarity index 96% rename from src/components/Map/MapViewer/utils/shapes/overlay/LineOverlay.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay.ts index adf9beb8067a3a59fb842289411880b68ea6fe27..821d9788c8a7b44c0d39e9da79481d0bca6abf7b 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/LineOverlay.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/LineOverlay.ts @@ -2,7 +2,7 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { GetOverlayBioEntityColorByAvailableProperties } from '@/components/Map/MapViewer/utils/config/overlaysLayer/useGetOverlayColor'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import { LineString } from 'ol/geom'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; import { Feature } from 'ol'; import { FeatureLike } from 'ol/Feature'; import Style from 'ol/style/Style'; diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay.test.ts similarity index 79% rename from src/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay.test.ts index 19bc84b67770bc9955bf6cf20d582f182ceeab5f..942d7d34600e5d7e356087df79e5695f35dfecc2 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay.test.ts @@ -1,14 +1,14 @@ /* eslint-disable no-magic-numbers */ import { Feature, Map } from 'ol'; import { Stroke, Style } from 'ol/style'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; import View from 'ol/View'; import { Coordinate } from 'ol/coordinate'; import MarkerOverlay, { MarkerOverlayProps, -} from '@/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay'; +} from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay'; jest.mock('../style/getStroke'); jest.mock('../style/getFill'); diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay.ts similarity index 96% rename from src/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay.ts index e963d76834ae227bf4107e02c81286137c2b4496..1d6348d4704caa9d2988e7c4195c3f29916ecd00 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/MarkerOverlay.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/MarkerOverlay.ts @@ -1,7 +1,7 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { GetOverlayBioEntityColorByAvailableProperties } from '@/components/Map/MapViewer/utils/config/overlaysLayer/useGetOverlayColor'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; import { Feature } from 'ol'; import { FeatureLike } from 'ol/Feature'; import Style from 'ol/style/Style'; diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/areOverlayOrdersNotEqual.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/areOverlayOrdersNotEqual.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/areOverlayOrdersNotEqual.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/areOverlayOrdersNotEqual.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/calculateOverlayDimensions.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/calculateOverlayDimensions.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/calculateOverlayDimensions.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/calculateOverlayDimensions.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/calculateOverlayDimensions.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/calculateOverlayDimensions.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/calculateOverlayDimensions.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/calculateOverlayDimensions.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/findMatchingSubmapLinkRectangle.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/findMatchingSubmapLinkRectangle.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/findMatchingSubmapLinkRectangle.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/findMatchingSubmapLinkRectangle.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/findMatchingSubmapLinkRectangle.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/findMatchingSubmapLinkRectangle.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/findMatchingSubmapLinkRectangle.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/findMatchingSubmapLinkRectangle.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/getOverlays.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/getOverlays.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/getOverlays.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/getOverlays.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/getOverlays.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/getOverlays.ts similarity index 89% rename from src/components/Map/MapViewer/utils/shapes/overlay/getOverlays.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/getOverlays.ts index 687e2e6742186a98087252ebbb32d325047842ba..cca8cd9987cd4b89d3bb00a0c2394d629e1c7220 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/getOverlays.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/getOverlays.ts @@ -1,7 +1,7 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { GetOverlayBioEntityColorByAvailableProperties } from '@/components/Map/MapViewer/utils/config/overlaysLayer/useGetOverlayColor'; -import groupOverlayEntities from '@/components/Map/MapViewer/utils/shapes/overlay/groupOverlayEntities'; -import processOverlayGroupedElements from '@/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements'; +import groupOverlayEntities from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/groupOverlayEntities'; +import processOverlayGroupedElements from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements'; export default function getOverlays( groupedOverlays: Record<string, Array<OverlayBioEntityRender>>, diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/groupOverlayEntities.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/groupOverlayEntities.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/groupOverlayEntities.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/groupOverlayEntities.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/groupOverlayEntities.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/groupOverlayEntities.ts similarity index 93% rename from src/components/Map/MapViewer/utils/shapes/overlay/groupOverlayEntities.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/groupOverlayEntities.ts index f9a63e9eb5d91d56965983ea5e85ed6ae2003cf9..81e43f02b0dc3c46b5a661c07ec2d2f6ff178dd2 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/groupOverlayEntities.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/groupOverlayEntities.ts @@ -1,6 +1,6 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { OverlayBioEntityGroupedElementsType } from '@/components/Map/MapViewer/MapViewer.types'; -import findMatchingSubmapLinkRectangle from '@/components/Map/MapViewer/utils/shapes/overlay/findMatchingSubmapLinkRectangle'; +import findMatchingSubmapLinkRectangle from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/findMatchingSubmapLinkRectangle'; export default function groupOverlayEntities( overlayBioEntities: Array<OverlayBioEntityRender>, diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements.test.ts similarity index 95% rename from src/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements.test.ts index c3a094e29a033d21f72cbfcc9a4d85693cdbcf0d..431ab400af54e2a44021125e5eba34c5bd2d1e88 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements.test.ts @@ -2,7 +2,7 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { GetOverlayBioEntityColorByAvailableProperties } from '@/components/Map/MapViewer/utils/config/overlaysLayer/useGetOverlayColor'; import { OverlayBioEntityGroupedElementsType } from '@/components/Map/MapViewer/MapViewer.types'; -import processOverlayGroupedElements from '@/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements'; +import processOverlayGroupedElements from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements'; describe('processOverlayGroupedElements', () => { it('should correctly process overlay grouped elements and add to entityOverlays', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements.ts similarity index 91% rename from src/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements.ts index 48ecc1675ec174d83d10f50ab9129c26b2cf8e04..94c0909e7ce7b5de90f43c2fe6833f38723263ab 100644 --- a/src/components/Map/MapViewer/utils/shapes/overlay/processOverlayGroupedElements.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/processOverlayGroupedElements.ts @@ -2,8 +2,8 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { GetOverlayBioEntityColorByAvailableProperties } from '@/components/Map/MapViewer/utils/config/overlaysLayer/useGetOverlayColor'; import { OverlayBioEntityGroupedElementsType } from '@/components/Map/MapViewer/MapViewer.types'; -import sortElementOverlayByColor from '@/components/Map/MapViewer/utils/shapes/overlay/sortElementOverlayByColor'; -import calculateOverlayDimensions from '@/components/Map/MapViewer/utils/shapes/overlay/calculateOverlayDimensions'; +import sortElementOverlayByColor from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/sortElementOverlayByColor'; +import calculateOverlayDimensions from '@/components/Map/MapViewer/utils/mapElementsRendering/overlay/calculateOverlayDimensions'; export default function processOverlayGroupedElements( groupedElements: OverlayBioEntityGroupedElementsType, diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/sortElementOverlayByColor.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/sortElementOverlayByColor.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/sortElementOverlayByColor.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/sortElementOverlayByColor.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/overlay/sortElementOverlayByColor.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/overlay/sortElementOverlayByColor.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/overlay/sortElementOverlayByColor.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/overlay/sortElementOverlayByColor.ts diff --git a/src/components/Map/MapViewer/utils/shapes/reaction/Reaction.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction.test.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/reaction/Reaction.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction.test.ts index 4a42ac856e47ac5430366c570b8b0d0f827cac0f..54755eb497c8edc8d7836bc3985fb4a36298eaf7 100644 --- a/src/components/Map/MapViewer/utils/shapes/reaction/Reaction.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction.test.ts @@ -1,6 +1,8 @@ /* eslint-disable no-magic-numbers */ import { Feature, Map } from 'ol'; -import Reaction, { ReactionProps } from '@/components/Map/MapViewer/utils/shapes/reaction/Reaction'; +import Reaction, { + ReactionProps, +} from '@/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction'; import { newReactionFixture } from '@/models/fixtures/newReactionFixture'; import { lineTypesFixture } from '@/models/fixtures/lineTypesFixture'; import { arrowTypesFixture } from '@/models/fixtures/arrowTypesFixture'; diff --git a/src/components/Map/MapViewer/utils/shapes/reaction/Reaction.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/reaction/Reaction.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction.ts index f92f51cfddf7636a2805c010aed8d6c51d7afdd9..6d9ca68132beff148cc45a78f1f58922a7da2c73 100644 --- a/src/components/Map/MapViewer/utils/shapes/reaction/Reaction.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/Reaction.ts @@ -17,15 +17,15 @@ import { ArrowTypeDict, LineTypeDict } from '@/redux/shapes/shapes.types'; import { FEATURE_TYPE } from '@/constants/features'; import VectorSource from 'ol/source/Vector'; import { Stroke } from 'ol/style'; -import getScaledElementStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getLineSegments from '@/components/Map/MapViewer/utils/shapes/coords/getLineSegments'; -import getRotation from '@/components/Map/MapViewer/utils/shapes/coords/getRotation'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; -import getReactionArrowFeature from '@/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature'; +import getScaledElementStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getLineSegments from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getLineSegments'; +import getRotation from '@/components/Map/MapViewer/utils/mapElementsRendering/coords/getRotation'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; +import getReactionArrowFeature from '@/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature'; export interface ReactionProps { id: number; diff --git a/src/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature.test.ts similarity index 90% rename from src/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature.test.ts index 5bf581e179017ed919a8e03fd32aa0f4e2414c39..6dda123d97e835066f833292e9c404e9fbb8e226 100644 --- a/src/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature.test.ts @@ -4,12 +4,12 @@ import { Fill, Stroke, Style } from 'ol/style'; import { Polygon, MultiPolygon } from 'ol/geom'; import { BLACK_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import { ArrowTypeDict } from '@/redux/shapes/shapes.types'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getReactionArrowFeature from '@/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getReactionArrowFeature from '@/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature'; jest.mock('../style/getStyle'); -jest.mock('../elements/getShapePolygon'); +jest.mock('../elements/utils/getShapePolygon'); describe('getReactionArrowFeature', () => { const props = { diff --git a/src/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature.ts similarity index 82% rename from src/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature.ts index f34a2261a580c493a4b388ef77ff30c08926d9bb..23f41a0c56d2938fb2514ff88cab95034af73fd1 100644 --- a/src/components/Map/MapViewer/utils/shapes/reaction/getReactionArrowFeature.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/reaction/getReactionArrowFeature.ts @@ -7,10 +7,10 @@ import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import Polygon from 'ol/geom/Polygon'; import { WHITE_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import { ArrowTypeDict } from '@/redux/shapes/shapes.types'; -import getShapePolygon from '@/components/Map/MapViewer/utils/shapes/elements/getShapePolygon'; -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import getShapePolygon from '@/components/Map/MapViewer/utils/mapElementsRendering/elements/utils/getShapePolygon'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; export default function getReactionArrowFeature({ arrowTypes, diff --git a/src/components/Map/MapViewer/utils/shapes/style/getCoverStyles.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles.test.ts similarity index 90% rename from src/components/Map/MapViewer/utils/shapes/style/getCoverStyles.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles.test.ts index a8ea5c82ba47d7e22d3fd805d2342c8ff3b9059f..ca01c3f0e6848b0deb6b9ef6d3bfdce9d503b819 100644 --- a/src/components/Map/MapViewer/utils/shapes/style/getCoverStyles.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles.test.ts @@ -1,10 +1,10 @@ /* eslint-disable no-magic-numbers */ import Style from 'ol/style/Style'; import { Extent } from 'ol/extent'; -import getWrappedTextWithFontSize from '@/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; +import getWrappedTextWithFontSize from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; import { latLngToPoint } from '@/utils/map/latLngToPoint'; -import getCoverStyles from '@/components/Map/MapViewer/utils/shapes/style/getCoverStyles'; +import getCoverStyles from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles'; import { DEFAULT_TILE_SIZE } from '@/constants/map'; jest.mock('../text/getWrappedTextWithFontSize'); diff --git a/src/components/Map/MapViewer/utils/shapes/style/getCoverStyles.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles.ts similarity index 90% rename from src/components/Map/MapViewer/utils/shapes/style/getCoverStyles.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles.ts index 4141a54f4340878422a2eccec7782a865e2b23c7..187757be4baff498f63b916b8129f54524defd8b 100644 --- a/src/components/Map/MapViewer/utils/shapes/style/getCoverStyles.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getCoverStyles.ts @@ -3,12 +3,12 @@ import Style from 'ol/style/Style'; import { Extent, getCenter } from 'ol/extent'; import { toLonLat } from 'ol/proj'; import { latLngToPoint } from '@/utils/map/latLngToPoint'; -import getWrappedTextWithFontSize from '@/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize'; +import getWrappedTextWithFontSize from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize'; import { Point } from 'ol/geom'; -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; import { MapSize } from '@/redux/map/map.types'; import { Stroke } from 'ol/style'; -import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle'; +import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle'; import { TEXT_CUTOFF_FONTSIZE } from '@/components/Map/MapViewer/MapViewer.constants'; export default function getCoverStyles({ diff --git a/src/components/Map/MapViewer/utils/shapes/style/getFill.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getFill.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/getFill.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getFill.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/style/getFill.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getFill.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/getFill.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getFill.ts diff --git a/src/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle.test.ts similarity index 96% rename from src/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle.test.ts index bd36a7d8b47c169b8d123b40dfd9f44bef7d2d60..0b53feac542b5bd2d7058ed2a2ab9b8724eb2be3 100644 --- a/src/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle.test.ts @@ -1,7 +1,7 @@ /* eslint-disable no-magic-numbers */ import Style from 'ol/style/Style'; import { Stroke, Text } from 'ol/style'; -import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle'; +import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle'; import getScaledElementStyle from './getScaledElementStyle'; jest.mock('./getScaledStrokeStyle'); diff --git a/src/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle.ts similarity index 89% rename from src/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle.ts index 5f2eaa409d80f8c69ba10c61f6757cc8c9763b85..0ef88b790ae666560b71ab60c0364cccb1b60d23 100644 --- a/src/components/Map/MapViewer/utils/shapes/style/getScaledElementStyle.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledElementStyle.ts @@ -1,7 +1,7 @@ /* eslint-disable no-magic-numbers */ import Style from 'ol/style/Style'; import { Stroke } from 'ol/style'; -import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle'; +import getScaledStrokeStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle'; export default function getScaledElementStyle( style: Style, diff --git a/src/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/getScaledStrokeStyle.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getScaledStrokeStyle.ts diff --git a/src/components/Map/MapViewer/utils/shapes/style/getStroke.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/getStroke.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/style/getStroke.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/getStroke.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke.ts diff --git a/src/components/Map/MapViewer/utils/shapes/style/getStyle.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle.test.ts similarity index 94% rename from src/components/Map/MapViewer/utils/shapes/style/getStyle.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle.test.ts index 974b9272c3c38c4436fee73ac15286ba185a3934..60ff4fbbc7df4a211633e060bb9fa1ba0c8a3929 100644 --- a/src/components/Map/MapViewer/utils/shapes/style/getStyle.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle.test.ts @@ -1,5 +1,5 @@ /* eslint-disable no-magic-numbers */ -import getStyle from '@/components/Map/MapViewer/utils/shapes/style/getStyle'; +import getStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle'; import Style from 'ol/style/Style'; import Polygon from 'ol/geom/Polygon'; diff --git a/src/components/Map/MapViewer/utils/shapes/style/getStyle.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle.ts similarity index 75% rename from src/components/Map/MapViewer/utils/shapes/style/getStyle.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle.ts index 9e121e1a0b8acfbac6656edc517372202e2cd3e4..101105fa966edd0e1d0d11a1b3285f6b031e4a1b 100644 --- a/src/components/Map/MapViewer/utils/shapes/style/getStyle.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/style/getStyle.ts @@ -3,9 +3,9 @@ import Style from 'ol/style/Style'; import { Geometry } from 'ol/geom'; import { BLACK_COLOR, WHITE_COLOR } from '@/components/Map/MapViewer/MapViewer.constants'; import { Color } from '@/types/models'; -import getStroke from '@/components/Map/MapViewer/utils/shapes/style/getStroke'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; -import getFill from '@/components/Map/MapViewer/utils/shapes/style/getFill'; +import getStroke from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getStroke'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; +import getFill from '@/components/Map/MapViewer/utils/mapElementsRendering/style/getFill'; export default function getStyle({ geometry, diff --git a/src/components/Map/MapViewer/utils/shapes/style/rgbToHex.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex.test.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/rgbToHex.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex.test.ts diff --git a/src/components/Map/MapViewer/utils/shapes/style/rgbToHex.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/style/rgbToHex.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex.ts diff --git a/src/components/Map/MapViewer/utils/shapes/text/getTextCoords.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords.test.ts similarity index 85% rename from src/components/Map/MapViewer/utils/shapes/text/getTextCoords.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords.test.ts index a48c180a291bf6324be668911ea6e98a7ff2ec23..9ae63f873014a11da635df24aefb12d1a4a75816 100644 --- a/src/components/Map/MapViewer/utils/shapes/text/getTextCoords.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords.test.ts @@ -1,5 +1,5 @@ /* eslint-disable no-magic-numbers */ -import getTextCoords from '@/components/Map/MapViewer/utils/shapes/text/getTextCoords'; +import getTextCoords from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; describe('getTextCoords', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/text/getTextCoords.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/text/getTextCoords.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextCoords.ts diff --git a/src/components/Map/MapViewer/utils/shapes/text/getTextStyle.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle.test.ts similarity index 88% rename from src/components/Map/MapViewer/utils/shapes/text/getTextStyle.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle.test.ts index 3d6fc5f4ce0754ebb489505a788887baa9a9a729..95713cff03aa2f0067bee765190c0493d8ad80b5 100644 --- a/src/components/Map/MapViewer/utils/shapes/text/getTextStyle.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle.test.ts @@ -1,5 +1,5 @@ /* eslint-disable no-magic-numbers */ -import getTextStyle from '@/components/Map/MapViewer/utils/shapes/text/getTextStyle'; +import getTextStyle from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle'; import Style from 'ol/style/Style'; describe('getTextStyle', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/text/getTextStyle.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/text/getTextStyle.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/text/getTextStyle.ts diff --git a/src/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize.test.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize.test.ts similarity index 96% rename from src/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize.test.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize.test.ts index 7b592758a15a4b7f682b4edb2e8a6e643e5b36c3..b8423ae03f4b9a7973f823b365bc7a183480afe6 100644 --- a/src/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize.test.ts +++ b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize.test.ts @@ -1,5 +1,5 @@ /* eslint-disable no-magic-numbers */ -import getWrappedTextWithFontSize from '@/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize'; +import getWrappedTextWithFontSize from '@/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize'; describe('getWrappedTextWithFontSize', () => { it('should return a wrapped text and font size for this text when maxWidth is limited and maxHeight is unlimited', () => { diff --git a/src/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize.ts b/src/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize.ts similarity index 100% rename from src/components/Map/MapViewer/utils/shapes/text/getWrappedTextWithFontSize.ts rename to src/components/Map/MapViewer/utils/mapElementsRendering/text/getWrappedTextWithFontSize.ts diff --git a/src/components/Map/MapViewer/utils/websocket/processLayer.ts b/src/components/Map/MapViewer/utils/websocket/processLayer.ts index 5d6ad6155280a57c176bc768c44a409082757296..47f39c279a89258ad046564729324f3e4d8603cb 100644 --- a/src/components/Map/MapViewer/utils/websocket/processLayer.ts +++ b/src/components/Map/MapViewer/utils/websocket/processLayer.ts @@ -2,10 +2,10 @@ import { WebSocketEntityUpdateInterface } from '@/utils/websocket-entity-updates import { store } from '@/redux/store'; import { ENTITY_OPERATION_TYPES } from '@/utils/websocket-entity-updates/webSocketEntityUpdates.constants'; import { getLayer } from '@/redux/layers/layers.thunks'; -import updateLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateLayer'; +import updateLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateLayer'; import { MapInstance } from '@/types/map'; import { layerDelete } from '@/redux/layers/layers.slice'; -import removeLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/removeLayer'; +import removeLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeLayer'; export default async function processLayer({ data, diff --git a/src/components/Map/MapViewer/utils/websocket/processLayerImage.ts b/src/components/Map/MapViewer/utils/websocket/processLayerImage.ts index e978cf5d76220819b4b2f5cf5247d80f9d842855..603852f0fdbaf8eff5caf2be314ca167bb3bf839 100644 --- a/src/components/Map/MapViewer/utils/websocket/processLayerImage.ts +++ b/src/components/Map/MapViewer/utils/websocket/processLayerImage.ts @@ -2,11 +2,11 @@ import { WebSocketEntityUpdateInterface } from '@/utils/websocket-entity-updates import { store } from '@/redux/store'; import { ENTITY_OPERATION_TYPES } from '@/utils/websocket-entity-updates/webSocketEntityUpdates.constants'; import { getLayerImage } from '@/redux/layers/layers.thunks'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; import { MapInstance } from '@/types/map'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { layerDeleteImage } from '@/redux/layers/layers.slice'; -import removeElementFromLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer'; +import removeElementFromLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer'; export default async function processLayerImage({ data, diff --git a/src/components/Map/MapViewer/utils/websocket/processLayerLine.ts b/src/components/Map/MapViewer/utils/websocket/processLayerLine.ts index 76c07f8ba88b6016db56b26fe406d4ee7342c9aa..1efe93c0f0e256d4260d949768f6a79403b0e56c 100644 --- a/src/components/Map/MapViewer/utils/websocket/processLayerLine.ts +++ b/src/components/Map/MapViewer/utils/websocket/processLayerLine.ts @@ -2,11 +2,11 @@ import { WebSocketEntityUpdateInterface } from '@/utils/websocket-entity-updates import { store } from '@/redux/store'; import { ENTITY_OPERATION_TYPES } from '@/utils/websocket-entity-updates/webSocketEntityUpdates.constants'; import { MapInstance } from '@/types/map'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { getLayerLine } from '@/redux/layers/layers.thunks'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; import { layerDeleteLine } from '@/redux/layers/layers.slice'; -import removeElementFromLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer'; +import removeElementFromLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer'; export default async function processLayerLine({ data, diff --git a/src/components/Map/MapViewer/utils/websocket/processLayerOval.ts b/src/components/Map/MapViewer/utils/websocket/processLayerOval.ts index a589b07ba61d98ac2ba130faa41724ea87ac4acf..332a2a6c0a275b154c5a8a9963b5eb44f4c20767 100644 --- a/src/components/Map/MapViewer/utils/websocket/processLayerOval.ts +++ b/src/components/Map/MapViewer/utils/websocket/processLayerOval.ts @@ -3,10 +3,10 @@ import { store } from '@/redux/store'; import { ENTITY_OPERATION_TYPES } from '@/utils/websocket-entity-updates/webSocketEntityUpdates.constants'; import { getLayerOval } from '@/redux/layers/layers.thunks'; import { MapInstance } from '@/types/map'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { layerDeleteOval } from '@/redux/layers/layers.slice'; -import removeElementFromLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import removeElementFromLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; export default async function processLayerOval({ data, diff --git a/src/components/Map/MapViewer/utils/websocket/processLayerRect.ts b/src/components/Map/MapViewer/utils/websocket/processLayerRect.ts index 97fe2b8b9d50e25f3de7e88bc38a6471fa3f0723..89ad7d146c27a85b090889862b3a9110c38f516c 100644 --- a/src/components/Map/MapViewer/utils/websocket/processLayerRect.ts +++ b/src/components/Map/MapViewer/utils/websocket/processLayerRect.ts @@ -2,10 +2,10 @@ import { WebSocketEntityUpdateInterface } from '@/utils/websocket-entity-updates import { store } from '@/redux/store'; import { ENTITY_OPERATION_TYPES } from '@/utils/websocket-entity-updates/webSocketEntityUpdates.constants'; import { MapInstance } from '@/types/map'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { layerDeleteRect } from '@/redux/layers/layers.slice'; -import removeElementFromLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import removeElementFromLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; import { getLayerRect } from '@/redux/layers/layers.thunks'; export default async function processLayerRect({ diff --git a/src/components/Map/MapViewer/utils/websocket/processLayerText.ts b/src/components/Map/MapViewer/utils/websocket/processLayerText.ts index 4b4c2f67bc5986be6dd210fc2756840adb1400cd..d8a6a9d870fb36a735754cc2267b8799b53aaa1c 100644 --- a/src/components/Map/MapViewer/utils/websocket/processLayerText.ts +++ b/src/components/Map/MapViewer/utils/websocket/processLayerText.ts @@ -3,10 +3,10 @@ import { store } from '@/redux/store'; import { ENTITY_OPERATION_TYPES } from '@/utils/websocket-entity-updates/webSocketEntityUpdates.constants'; import { getLayerText } from '@/redux/layers/layers.thunks'; import { MapInstance } from '@/types/map'; -import drawElementOnLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/drawElementOnLayer'; +import drawElementOnLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/drawElementOnLayer'; import { layerDeleteText } from '@/redux/layers/layers.slice'; -import removeElementFromLayer from '@/components/Map/MapViewer/utils/shapes/layer/utils/removeElementFromLayer'; -import updateElement from '@/components/Map/MapViewer/utils/shapes/layer/utils/updateElement'; +import removeElementFromLayer from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/removeElementFromLayer'; +import updateElement from '@/components/Map/MapViewer/utils/mapElementsRendering/layer/utils/updateElement'; export default async function processLayerText({ data, diff --git a/src/components/SPA/MinervaSPA.component.tsx b/src/components/SPA/MinervaSPA.component.tsx index f086919b6aefbb458cd037d06c64459aacad5c8b..2eca246e72719456fae611db6cd60c73f9a167ae 100644 --- a/src/components/SPA/MinervaSPA.component.tsx +++ b/src/components/SPA/MinervaSPA.component.tsx @@ -5,8 +5,8 @@ import { useReduxBusQueryManager } from '@/utils/query-manager/useReduxBusQueryM import { twMerge } from 'tailwind-merge'; import { useEffect } from 'react'; import { PluginsManager } from '@/services/pluginsManager'; +import { Modal } from '@/components/FunctionalArea/Modal'; import { useInitializeStore } from '../../utils/initialize/useInitializeStore'; -// import { Modal } from '../FunctionalArea/Modal'; import { ContextMenu } from '../FunctionalArea/ContextMenu'; import { CookieBanner } from '../FunctionalArea/CookieBanner'; @@ -24,6 +24,7 @@ export const MinervaSPA = (): JSX.Element => { <div className={twMerge('relative', manrope.variable)}> <FunctionalArea /> <Map /> + <Modal /> <ContextMenu /> <CookieBanner /> </div> diff --git a/src/shared/ColorPicker/ColorTilePicker.component.tsx b/src/shared/ColorPicker/ColorTilePicker.component.tsx index ce47fc4d0e3393a55b7d7bda172240f13d216034..b2668bdecd98c784378811efdad3753e829f762a 100644 --- a/src/shared/ColorPicker/ColorTilePicker.component.tsx +++ b/src/shared/ColorPicker/ColorTilePicker.component.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'; import ColorPicker, { Color, ColorPickerProps } from '@rc-component/color-picker'; import { Color as RgbIntAlphaColor } from '@/types/models'; import '@rc-component/color-picker/assets/index.css'; -import { rgbToHex } from '@/components/Map/MapViewer/utils/shapes/style/rgbToHex'; +import { rgbToHex } from '@/components/Map/MapViewer/utils/mapElementsRendering/style/rgbToHex'; type ColorTilePickerProps = { initialColor?: RgbIntAlphaColor;