Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat [188128]: Set up react project #36

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pandid.xml
pandid.trig
rml/segments.trig
client/.idea
.idea
.vs
client/Boundaries/Dexpi2Svg/test.svg
rml/C03V04.trig
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be that this one is not used, just the one in www?

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions www/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
5,017 changes: 5,017 additions & 0 deletions www/DISC_EXAMPLE-02-02.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest not committing this, rather putting a link or info about where to find it

Large diffs are not rendered by default.

47 changes: 24 additions & 23 deletions www/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# Select boundary in browser

1) Run the dexpi.rdfox script, the documentation for this script is found [here](../rdfox/README.md)
2) Open the dexpi.html file in a browser
2) Run the frontend as described in [RunGuide.md](./RunGuide.md)
3) Select the boundary points and an internal component
- Ctrl+left click to select or deselect the internal component
1) If the node is not a member of the internal class:
- Add the node to the internal class to indicate that it is selected
- Update rdfox with the following triple :nodeId a :insideBoundary .
2) If the node is a member of the internal class:
- Remove the node from the internal class to indicate that it is deselected
- Update rdfox, delete the following triple :nodeId a :insideBoundary .
3) If the node is not a member of the internal class, but is a member of the boundary class:
- Add the node to the internal class, and remove it from the boundary class.
- Update rdfox, insert the following triple :nodeId a :insideBoundary .
- Update rdfox, delete the following triple :nodeId a :boundary .
- Left click to select or deselect boundary nodes
1) If the node is not a member of the boundary class:
- Add the node to the boundary class to indicate that it is selected
- Update rdfox with the following triple :nodeId a :boundary .
2) If the node is a member of the boundary class:
- Remove the node from the boundary class to indicate that it is deselected
- Update rdfox, delete the following triple :nodeId a :boundary .
3) If the node is not a member of the boundary class, but is a member of the internal class:
- Add the node to the boundary class, and remove it from the internal class.
- Update rdfox, insert the following triple :nodeId a :boundary .
- Update rdfox, delete the following triple :nodeId a :insideBoundary .
- Ctrl+left click to select or deselect the internal component
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Ctrl+left click to select or deselect the internal component
- Shift+left click to select or deselect the internal component

1) If the node is not a member of the internal class:
- Add the node to the internal class to indicate that it is selected
- Update rdfox with the following triple :nodeId a :insideBoundary .
2) If the node is a member of the internal class:
- Remove the node from the internal class to indicate that it is deselected
- Update rdfox, delete the following triple :nodeId a :insideBoundary .
3) If the node is not a member of the internal class, but is a member of the boundary class:
- Add the node to the internal class, and remove it from the boundary class.
- Update rdfox, insert the following triple :nodeId a :insideBoundary .
- Update rdfox, delete the following triple :nodeId a :boundary .
- Left click to select or deselect boundary nodes
1) If the node is not a member of the boundary class:
- Add the node to the boundary class to indicate that it is selected
- Update rdfox with the following triple :nodeId a :boundary .
2) If the node is a member of the boundary class:
- Remove the node from the boundary class to indicate that it is deselected
- Update rdfox, delete the following triple :nodeId a :boundary .
3) If the node is not a member of the boundary class, but is a member of the internal class:
- Add the node to the boundary class, and remove it from the internal class.
- Update rdfox, insert the following triple :nodeId a :boundary .
- Update rdfox, delete the following triple :nodeId a :insideBoundary .
4) Hit enter to query RDFox for the boundary - the output of the query can be found in the logs.
53 changes: 25 additions & 28 deletions www/RunGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ This guide will help you run the NOAKADEXPI program that converts DEPI XML files

## Prerequisites

Before you start, ensure that you have the following repository structure on your local machine:
To run the code, you need to have Node.js installed. [You can download node here](https://nodejs.org/en).

- `NOAKADEXPI` repository located adjacent to the `SSI_DEXPI_TEMP` repository.
Open a terminal in the `www` directory, and run ```npm install```.

## Steps to Run the Program

1. **Navigate to the Tool Directory**

Open a command prompt or terminal window and navigate to the `Client/boundaries/Dexpi2svg` directory within the `NOAKADEXPI` repository.
Open a command prompt or terminal window and navigate to the `Client/boundaries/Dexpi2svg` directory within the
`NOAKADEXPI` repository.

2. **Run the Conversion Command**

Expand All @@ -22,28 +23,31 @@ Before you start, ensure that you have the following repository structure on you
dotnet run "<path-to-your-xml-file>" "<path-to-your-xslt-file>" > output.svg
```

Replace `<path-to-your-xml-file>` with the generic path to your DEPI XML file and `<path-to-your-xslt-file>` with the generic path to your XSLT file.
Replace `<path-to-your-xml-file>` with the generic path to your DEPI XML file and `<path-to-your-xslt-file>` with the
generic path to your XSLT file.

3. **Addressing Missing Symbol Error**

If you encounter an error about a missing symbol `PV001A_Origio.svg`, you will need to create it by following these steps:
If you encounter an error about a missing symbol `PV001A_Origio.svg`, you will need to create it by following these
steps:

a. Create a new file inside the `NOAKADEXPI/SYMBOL/Origo` directory.

b. Paste the following SVG content into the new file:

```xml
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
width="3.43931mm" height="17.4611mm" viewBox="-0.40625 -2.03125 0.8125 4.125">
<defs vector-effect="non-scaling-stroke" />
<g>
<g id="cell-SPPeGkMqv3PPZ88ONVvg-0" layer="Symbol">
<path d="M0 2L0-2" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10"
pointer-events="stroke" stroke-width="0.25" stroke-linecap="round"
stroke-linejoin="round" />
</g>
width="3.43931mm" height="17.4611mm" viewBox="-0.40625 -2.03125 0.8125 4.125">
<defs vector-effect="non-scaling-stroke" />
<g>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jeg tror jeg likte den gamle formateringa best, men det er jo virkelig ikke viktig.

<g id="cell-SPPeGkMqv3PPZ88ONVvg-0" layer="Symbol">
<path d="M0 2L0-2" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10"
pointer-events="stroke" stroke-width="0.25" stroke-linecap="round"
stroke-linejoin="round" />
</g>

<g id="cell-JrQDJ3AAwTKKgfP51pYv-3"
content="&lt;object label=&quot;Connection&quot; PipingConnector=&quot;Y&quot; LabelConnector=&quot;N&quot; SignalConnector=&quot;Y&quot; Direction=&quot;0, 180&quot; AuxiliaryConnector=&quot;N&quot;/&gt;"
Expand Down Expand Up @@ -79,28 +83,21 @@ Before you start, ensure that you have the following repository structure on you
vector-effect="non-scaling-stroke" />
</g>
</g>

</svg>
```

Name this file `PV001A_Origio.svg`.
Name this file `PV001A_Origio.svg`.

4. **Integrate the SVG Output**

Once you have the `output.svg` file, you can integrate it into your `dexpi.html` file:

a. Copy the full contents of `output.svg`.

b. Paste the copied SVG content into `dexpi.html` after the line `<?xml version='1.0' encoding='UTF-8'?>`.
Once you have the `output.svg` file, move it to ```www\src\assets```

Ensure that the end of your `dexpi.html` file only contains the following lines:

```html
<script src="script.js" crossorigin="anonymous"></script>
</body>
</html>
```

5. **View the Result**

Open `dexpi.html` in a web browser to view the SVG representation of your DEPI XML file. You should now be able to click on the components within the SVG as intended.
If you want to be able to create boundaries you must use RDFox aswell, to manage this see the README in client/boundaries.
In a terminal inside the `www` folder, run `npm run dev`. Click the link to open it in the browser. You should now be
able to
click on the components within the SVG as intended.
If you want to be able to create boundaries you must use RDFox as well, to manage this see the README in
client/boundaries.
34 changes: 0 additions & 34 deletions www/dexpi.html

This file was deleted.

Loading