Giter Site home page Giter Site logo

ishaanshettigar / idg10-gui-hackathon Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 2.72 MB

Building an interactive GUI to help design subsea field layouts using JointJS with plain HTML,CSS and JS

HTML 9.67% JavaScript 83.69% CSS 6.55% Dockerfile 0.09%
diagram javascript joint jointjs css html

idg10-gui-hackathon's Introduction

Ishaan Shettigar

๐Ÿ‘‹ Hello! I'm Ishaan Shettigar, I'm currently in my final year studying CSE at PES University, Bangalore.

About Me

  • ๐Ÿ”ญ I'm currently working on a computer vision project that involves detecting osteoporosis and osteoarthritis from knee X-ray images as well as a project that converts natural language queries into valid SQL queries using generative AI.
  • ๐ŸŒฑ I'm continuously learning and exploring, my fields of interest include GenerativeAI, Crypto/Web3, AI/ML and FullStack Web Dev.
  • ๐Ÿ‘ฏ I'm currently learning React and would love to contribute to any open-source repositories to further my understanding in it.

Technologies I Love

  • Languages: Python, JavaScript, C/C++, Solidity (Ethereum), Java
  • Frameworks: React (currently learning), Node.js, MERN, FastAPI, Django
  • Tools: Git, OpenCV, pandas, Keras
  • Databases: MariaDB, MongoDB, PostgreSQL, MySQL,

My GitHub Stats

Top Langs

Your GitHub Stats

Thank you for visiting my GitHub profile. Feel free to explore my projects, get in touch, or collaborate on exciting projects. ๐Ÿš€

idg10-gui-hackathon's People

Contributors

abhay-ramesh avatar ishaanshettigar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

idg10-gui-hackathon's Issues

Decoupling for readability

Create one js file for all element tools
Create one js file for all link tools
Create a js file for all custom elements

Think about where to expose Link settings

Other than the 18 parameters per link there should also be options to change the settings of the link. These settings will be the same as those provided by the JointJs framework.

Settings:

Link Router - normal/manhattan/metro/right-angle/orthogonal

The default router is 'normal'; this can be changed with the defaultRouter paper option. Example:

paper.options.defaultRouter = {
    name: 'orthogonal',
    args: {
        padding: 10
    }
});

The 'manhattan' and 'metro' routers are our smart routers; they automatically avoid obstacles (elements) in their way.

The 'orthogonal', 'manhattan' and 'rightAngle' routers generate routes consisting exclusively of vertical and horizontal segments. The 'metro' router generates routes consisting of orthogonal and diagonal segments.

JointJS also contains mechanisms to define one's own custom routers.

Connector - normal/rounded/smooth/curve/straight/jumpover
The default connector is 'normal'; this can be changed with the defaultConnector paper option. Example:

paper.options.defaultConnector = {
    name: 'straight',
    args: {
        cornerType: 'line',
        cornerRadius: 20
    }
}

(more info here)

Advanced Settings:

SnapLinks: (true/false)
SourceArrowHead: (provide 2 or 3 ready-to-use connectors)
TargetArrowHead: (provide 2 or 3 ready-to-use connectors) (Describe in the documentation how one can specify their own custom arrowheads)
Boundary: display the boundary of the link on hover or whenever you show the link tools

Whenever a pan event is triggered on the paper, change the cursor from pointer to something more appropriate

Not sure yet, how to implement this but off the top of my head we could create a function to change the cursor and put that function in the onPan section as seen below. This should change the cursor while you are panning.

paperPanAndZoom = svgPanZoom("#paper-div svg", {
   fit: false,
   center: false,
   zoomScaleSensitivity: 0.03,
   panEnabled: false,
   controlIconsEnabled: true
   onPan: (oldPan, newPan) => { /* This is the function */}
})

Create the logic for the "Installation & Construction Vessel" and "Subsea Intervention" parameters and modals

  1. Create a JSON representation for the "Installation & Construction Vessel" and "Subsea Intervention" based on the specification PPT.
  2. Create a button next to the respective select boxes for "Installation & Construction Vessel" and "Subsea Intervention".
  3. Create a modal that appears on clicking the above button.
  4. The input and select boxes should be created based on the JSON. We need to check what value is there in the select box and then match it with the JSON, to get the right info.
  5. Make sure this is represented in the BOM and the downloadable csv.

Fix the hover modal position when modal is out of bounds for PLET and UTH

The hover modal is wildly out of position due to the fact that we are defining the distance of the modal from the hovered coordinates in terms of the elements height (in case of out of bounds on the Y axis) and width (in case of out of bounds on the X axis). This is an error simply due to the fact that these elements PLET and UTH have a much larger size. Not visually tho, the elements bounding box is itself larger than the others.

Possible solutions:

  1. Redefine/Re-draw them.
  2. Figure out a different way to display the out of bounds cases.

Below are two images depicting the error.
image
image

On uploading a file, the element tools are not loaded

When a user tries to upload an old .idg file, the diagram loads fine however the element and link tools are not loaded.
If we try adding new elements and links, tools are displayed on them but not on the previously loaded data.

Use browser local storage to store the current sessions state

This is a required feature as the user should not have the inconvenience of redrawing the diagrams if they accidentally close the tab.

Possible ways to save the diagram:

  • Ctrl + S triggers the saving
  • Save every 5 minutes/1 minutes/30 seconds.
  • Save once every graph.on("change", function) event

We will be utilizing browser local storage

Link cannot connect to anything when just created [BUG]

image

Everything was fine until I added the addLinkToolsNew function and call it during the graph.on('add', ....) event.
Maybe if we hide the tools while the link is pressed (pointerdown), then this bug will not happen.

For some reason it seems to want to connect to itself despite the fact that the validateConnection option while defining mainPaper prevents that from happening.

Fix the Bill of Material to CSV

When dealing with the new parameters it is really important to generate the excel file. An engineer will design the pipeline using this software but some high level exec will play around with the values in the excel file.

Features

  1. One excel file for components, one sheet for each component in the diagram
  2. One excel file for links, one sheet for each link in the diagram.

Make the displayed paper grid actually reflect the real grid after zooming in via scroll

The pan and zoom feature is only available in the infinite_paper.html and infinite_paper.js files.
When we try to zoom in, it works perfectly fine, but the background grid does not change. We need to change the grid size and re-render the paper's background on zoom.

This can quickly be done once you figure out how to re-render the grid in joint js.

Then in the place where we create a svgPanZoom object we just add the following parameters and the corresponding functions to it like so:

paperPanAndZoom = svgPanZoom("#paper-div svg", {
    fit: false,
    center: false,
    zoomScaleSensitivity: 0.03,
    panEnabled: false,
    controlIconsEnabled: true,
    onZoom: ()=>{
      /*Insert function to re-render here*/
     }
})

you could also try to use the beforeZoom: callback_function parameter

Prompt to ask the user for confirmation before deleting element

This prompt should be fired whether the user tries to delete an element whether they click on the x icon or they highlight the element by clicking on it and then press the delete key.

We can react to the graph.remove event listener to ask the user if they really want to remove the object (Are you sure?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.