Giter VIP home page Giter VIP logo

Comments (5)

icarofonseca avatar icarofonseca commented on July 24, 2024

Include button to add blocks, text fields to define block positions. Move app to master and document on wiki when it's done.

from vesseljs.

icarofonseca avatar icarofonseca commented on July 24, 2024

There is a beta version of the app on https://shiplab.github.io/vesseljs/examples/Ship_stability_with_blocks.html. Give me feedback on whether you like the direction the app is going.

Next features should add:

  • Text fields to define x and y positions of blocks. The app should include a warning that the x position is merely for spatial arrangement, as the library does not support trim calculations.
  • A button to update calculations and visualizations. Calculations are not responsive enough for the current onchange approach.
  • Documentation on wiki.

from vesseljs.

EliasHasle avatar EliasHasle commented on July 24, 2024

I think it is a sensible extension of the table approach. It is one possible way of editing the block configuration. I am working on a more visually oriented approach. I guess there is no reason we can't have both, or at least experiment with both.

Regarding responsivity, I agree that modifying immediately on every single change might not be the best solution. I don't particularly like having to click a button either, though. Maybe we can use a setInterval that calls an update function every second or so (maybe more). Each onChange then should set a shared confModified flag that is checked by the update function before doing any expensive calculations, and reset to false afterwards. Actually, that may not turn out to be perfectly thread-safe. Maybe we even need to use some version numbers, storing one appliedConfVersion and one currentConfVersion, reading the currentConfVersion at the beginning of the update function, and updating appliedConfVersion at the end of it.

The thread-safety concerns may also be ungrounded. Maybe we can just try with a simple boolean flag first, and change only if necessary.

from vesseljs.

EliasHasle avatar EliasHasle commented on July 24, 2024

OK, now I looked at the code. Right, it is not a good solution to rebuild the entire visualization on every change. It is the easiest solution, though. I believe a better solution will be to add an interface to the Ship3D prototype, for simultaneously modifying the Ship3D and the underlying Ship. Then we probably also want a proper interface in the Ship prototype.

My initial concern about calculations was with the draft and geometric attributes, and that concern is still alive.

from vesseljs.

icarofonseca avatar icarofonseca commented on July 24, 2024

I'm working on a new version of the code, I should commit in some minutes. Then you can suggest any improvements based on the new version. But the points you made on your post will remain, though.

from vesseljs.

Related Issues (20)

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.