‹ BackHN Continuity

Thread

Show HN: Reladraw – A diagram language where you decide where to place things

413 points · 119 comments · jpwalsh234

  1. v9v · · focus · HN ↗
    Great! Reminds me of Pikchr a bit <a href="https:&#x2F;&#x2F;pikchr.org&#x2F;home&#x2F;doc&#x2F;trunk&#x2F;homepage.md" rel="nofollow">https:&#x2F;&#x2F;pikchr.org&#x2F;home&#x2F;doc&#x2F;trunk&#x2F;homepage.md
    1. jpwalsh234 · · focus · HN ↗
      Thanks! The big difference is that Pikchr uses &quot;turtle&quot; graphics (where a cursor walks along and draws shapes). Reladraw lets you state relationships and relative positions.

      So, if you have a container with children, or multiple nodes off to the right of another, with links between them, adding or resizing one adjusts the rest, without re-specifying positions the way turtle graphics would require.

      1. gandreani · · focus · HN ↗
        Can you share an example?

        I&#x27;ve been playing with pikchr quite a bit and it has containers and you can specify links relative to the container. I can picture (pun not intended) your counter-example

        1. jpwalsh234 · · focus · HN ↗
          Great question, I had to noodle that one over a bit, but I think it helped me clarify that difference between pikchr and reladraw. My container example was a poor one, and you are right that pikchr can handle adding elements to a container without fiddling.

          My main objection to pikchr is that it is turtle graphics plus coordinate offsets, which to me feels like the wrong tool when I want to say &quot;I have A to the left, and B, C, and D all right of A&quot;. I don&#x27;t want to have to translate that to turtle graphic movements like saying &quot;there&#x27;s a group, draw B, move down some amount, place C, move down again, place D&quot;.

          Similarly, if I&#x27;m thinking at the level of abstraction of nodes and edges and relative positions, it feels awkward to say something like this in pikchr (where the 0.2 is a guess to fiddle with):

            arrow from Web.s down 0.2 then right until even with DB.s then to DB.s
          
          Rather than saying in reladraw:

            edge web -&gt; db   from: bottom  to: bottom
          
          I think it&#x27;s less a matter of &quot;reladraw can do it, but pikchr cannot&quot;. It&#x27;s more like, &quot;both can get to the same destination, but how you get there is a matter of taste and how you express your intent&quot;.

          For example in pikchr:

            A: box &quot;A&quot; fit
            G: [
              down
              B: box &quot;B&quot; fit
              move 0.1
              C: box &quot;C&quot; fit
              move 0.1
              D: box &quot;D&quot; fit
              move 0.1
              E: box &quot;E&quot; fit
            ] with .w at A.e+(0.5,0)
            arrow from A to G.B chop
            arrow from A to G.C chop
            arrow from A to G.D chop
            arrow from A to G.E chop
          
          To me, it&#x27;s not as clear that your intent is that you want several nodes right of A. However, in reladraw, it&#x27;s clearer to me that the intent is &quot;these things are right of A&quot;:

            node a &quot;A&quot;
            node b &quot;B&quot;  right of a
            node c &quot;C&quot;  right of a
            node d &quot;D&quot;  right of a
            node e &quot;E&quot;  right of a
            edge a -&gt; b
            edge a -&gt; c
            edge a -&gt; d
            edge a -&gt; e
          
          However, that&#x27;s a subjective taste thing and I could see some people liking the pikchr approach.
          1. gandreani · · focus · HN ↗
            This is a great example! Thank you

            I think you&#x27;re right that it&#x27;s a matter of taste and that the intent is better represented by reladraw.

            If I can point some personal downsides of pikchr is that there&#x27;s no loops and when using macros you can&#x27;t use parameters to create object labels.

            For example, Triangle$1: line...

            Just some thoughts in case you&#x27;re looking for future inspiration for the language

            1. jpwalsh234 · · focus · HN ↗
              Oh interesting! I plan to add custom attributes, functions, variables. I was also thinking about macros and will add your parameters for object labels in as another idea. Thanks :)
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.