Code Monkey home page Code Monkey logo

Comments (6)

PiotrJustyna avatar PiotrJustyna commented on June 17, 2024

OK, this is something I've been preparing myself for a while now. This change represents the hardest code in the application so far, so it will probably take a while to get it right.

Below is a sample problematic situation we can get into today:

diagram-troubleshooting-on

action 3 is a child of both:

  • question 2
  • question 3

which results in some problems:

  • it and its children should not be rendered twice
  • each icon should only be rendered once
  • there can be multiple connections from a child to its parents (we already have multiple connections from a parent to many children)

from drakon-renderer.

PiotrJustyna avatar PiotrJustyna commented on June 17, 2024

A reasonable next step would be to flesh out the troubleshooting mode with:

  • replace max width with an actually useful information like origin coordinates
  • a bool signifying whether an icon has already been rendered

from drakon-renderer.

PiotrJustyna avatar PiotrJustyna commented on June 17, 2024

OK, origin coordinates for troubleshooting done:

diagram-troubleshooting-on

from drakon-renderer.

PiotrJustyna avatar PiotrJustyna commented on June 17, 2024

I added a comment to the TODO function a while ago which stated:

-- we should have a bit of new logic here:
-- if, while iterating through the list of icons, you come across an icon
-- that is already in the returned collection of triples (rendering order, max width, (coordinates, diagram))
-- take that found end icon from the returned collection and mappend a connection to the new parent node to it

Now that I:

  • started working on adding the "already rendered" troubleshooting indicator
  • took the time to read the code very carefully

I realised that it would be impossible. That collection of triples I mentioned only contains nodes that are assigned to the current node as children - it doesn't contain all graph nodes. I will have to rethink how we keep track of already rendered nodes...

from drakon-renderer.

PiotrJustyna avatar PiotrJustyna commented on June 17, 2024

So at this stage I'm convinced that while rendering individual steps, we shouldn't also connect to their parents as, if we spot a new parent while iterating through the list of icons, we would have to retrace back to that already rendered icon and then connect it to the newly found parent. I feel it's unnecessarily complicated.

Additionally, I realised that even if I remove the functionality that connects newly rendered icons with their parents, the positioning will still be wrong (it already is wrong). Icons should not be rendered if they are already rendered.

I fear I will have to rethink this general group of functions:

[Icon] -> [Diagram]

from drakon-renderer.

PiotrJustyna avatar PiotrJustyna commented on June 17, 2024

Transferring the issue here to assign it to a roadmap project: #22

from drakon-renderer.

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.