Closed abgruszecki closed 3 years ago
We could add separate tab for sealed subclasses
, or we can add graphical representation to Graph
that would would have indicate that two classes are related to each other. It can be either some text/symbol (e. g. closed lock 🔒) attached to arrows or we can try add clusters
that d3 js supports that add background rectangle aggregating given graph nodes.
Which solution do you feel is the most straightforward @romanowski @abgruszecki @pikinier20 ?
I am not sure about another tab but adding information if the class is sealed and mark sealed parents in Graph, Supertypes, Known subtypes should be enough.
cluster
also sounds promising.
Also adding closed lock for every sealed member in graph would be nice. Clusters might get ugly when sb creates sealed trait and then extend it with another sealed trait etc.
@Katrix do you have any thoughts on that?
With the way Scala3doc works now, we wouldn't display a separate tab, just a toggle-able section. I think that still might make sense. Really, the first thing I want to see when going to a page of a class like Option
is the list of all of its children.
Maybe make the distinction between a sealed trait an an enum. For an enum they should definitively be front and center IMO. I'd still like to keep the known subtypes section though
I made a small prototype, how do you find it?
I think the locks are really noisy, visually. I think it'd look better if the lock was displayed only next to the types which are actually sealed. If we really want to display more information than that, then perhaps we should display the inheritance arrows with a different color when the parent is sealed?
only next to the types which are actually sealed
do you mean next to trait A
and trait B1
in our case or next to children of trait A
and trait B1
or next to both parent and children? Also, it can be hard to have straightforward solution to have lock next to rectangle, the easy way to achieve that is to appended the lock to the name.
I understand that trait A
and trait B1
are the ones actually defined as sealed? If yes, then I was suggesting displaying a lock next to those.
If we can only display the lock inside the box, then maybe we should just display the sealed
keyword?
Yes, we can, though the idea behind graph was to reduce information about the nodes to minimum, as it will expand rectangles size greatly. Will show updated version soon.
@abgruszecki how do you like it?
@BarkingBad I think it looks fine. It even helps a bit visually that the sealed types have larger boxes, it helps distinguish them from the rest.
In Scaladoc, one could see the children of sealed traits by opening "known subclasses", but this always felt a bit hidden.
Should we instead display them more prominently, perhaps in a separate tab?