soteria-dag / soterd

A GoLang Implementation of Soteria DAG Protocol Daemon
http://www.soteriadag.org
ISC License
14 stars 9 forks source link

soterdash display dash shifting to right as the graph (dag) scrolls down. #7

Closed totaloutput closed 5 years ago

totaloutput commented 5 years ago

Describe the bug in soterdash, the dag display page will shift to right when you scroll down.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.soteriadag.org/
  2. Click on status
  3. click on DAG (if you are on mobile, click the menu then DAG)
  4. scroll down.

Expected behavior DAG displays and continue.

Screenshots image

image

image

this reproduce both on desktop and mobile.

colakong commented 5 years ago

@totaloutput this slide-to-the-right behaviour appears to come from graphviz. You can reproduce it with a dot file that doesn't contain any layout info.

Here's a graphviz .dot file of the current testnet dag. If you render it to svg with:

cat dag.dot | dot -Tsvg > dag.svg

You'll see the same slide-to-the-right.

I think we should look into whether graphviz dot file format supports layout rules, so that we can keep the history of dag fairly straight even when it's quite long.

colakong commented 5 years ago

Using the graph-level ordering=out attribute seems to help keep a tighter left-aligned graph for large dag renderings. In testing it didn't render beyond the boundaries of the screen.

I have a patch committed that applies this. We'll use it for now, and explore subgraphs or invisible edges as other means of maintaining layout if the need arises.

I'll push the patch along with the fix for #8.

colakong commented 5 years ago

A fix for this was included in soterd commit 2625c407 and soterdash commit eb5208d