Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display inheritance graph in model explorer #1114

Merged
merged 9 commits into from
Jun 22, 2023

Conversation

tillprochaska
Copy link
Contributor

@tillprochaska tillprochaska commented Jun 1, 2023

I keep referring to the schema YAML files when I need to find child schemata of a specific schema, so in addition to the list of parent schemata, I added a list of child schemata to the explorer pages. Then decided it probably makes sense to display the (partial) inheritance graph as an actual graph.

Screen Shot 2023-06-02 at 00 10 25

To do:

  • Show siblings
  • Handle schemata without parent or child schemata
  • Handle loading state

@pudo
Copy link
Contributor

pudo commented Jun 2, 2023

That's hella cool! Wow. Could you even render out a full hierarchy on the landing page for the schema docs?

@tillprochaska
Copy link
Contributor Author

Could you even render out a full hierarchy on the landing page for the schema docs?

It’s something I’d like to try out, but I’m a bit pessimistic about the result being usable/laid out in a usable way. :D

@tillprochaska
Copy link
Contributor Author

So, I tried to render a full inheritance graph in the same way, and this is the result… I tried to tweak some of the parameters (e.g. to get rectangular edges), but the results are still not usable.

full_graph_test

I implemented this using Mermaid because it’s so simple and I want to introduce it to the Aleph docs too (to be able to easily include flow charts in documentation articles). When I have some more time at some point, I might experiment a bit more, trying to render stuff directly using D3 or a DAG rendering library.

@tillprochaska tillprochaska force-pushed the feature/docs-inheritance-graph branch from eae137a to 8e3818a Compare June 2, 2023 15:19
@tillprochaska tillprochaska marked this pull request as ready for review June 5, 2023 10:31
@tillprochaska tillprochaska force-pushed the feature/docs-inheritance-graph branch from 80983f1 to 1a422c9 Compare June 5, 2023 10:32
@tillprochaska tillprochaska requested a review from pudo June 5, 2023 13:50
@tillprochaska tillprochaska changed the title WIP: Display inheritance graph in model explorer Display inheritance graph in model explorer Jun 8, 2023
@Rosencrantz
Copy link
Contributor

Generally looks pretty amazing. Only comment, and I don't think it is something that we have to address right away, is that for some schemata it can be very difficult to read the generated graph. Interval is a good example of this.

@Rosencrantz Rosencrantz self-requested a review June 19, 2023 08:23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this css.txt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a workaround, see commit message: 5194802

@tillprochaska
Copy link
Contributor Author

Only comment, and I don't think it is something that we have to address right away, is that for some schemata it can be very difficult to read the generated graph.

@Rosencrantz Yes, I’m aware of that. Was thinking about an option to expand the diagram or something like that, but I agree, this is something we do not need to address right away.

For example to display a full graph of the model on the explorer index page…
This is a workaround due to an Astro bug. The bug has been fixed, but we're still on an older Astro version, and using a different file extension works fine for now.
Most people using the model explorer will probably search for the schema name as that is what they use when creating mappings, writing crawlers, debugging problems with Aleph etc. The schema label is still visible on the index page, but we now use the name consistently in headings, page titles, navigation links etc.
@tillprochaska tillprochaska force-pushed the feature/docs-inheritance-graph branch from 1a422c9 to 5c7ad7d Compare June 21, 2023 18:00
@tillprochaska tillprochaska merged commit 3ec49e0 into main Jun 22, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants