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

Add interactive library explorer #1138

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

VojtechStep
Copy link
Collaborator

@JobPetrovcic created an interactive graph for exploring definitions in the library. This PR embeds the explorer on our website.

Some more work is still required outside of this repository, which is why this PR is a draft.

Co-authored-by: Job Petrovčič [email protected]

@VojtechStep VojtechStep changed the title Feature/job visualization Add interactive library explorer May 10, 2024
@fredrik-bakke fredrik-bakke added enhancement New feature or request website labels May 11, 2024
@VojtechStep
Copy link
Collaborator Author

Status update: we're coordinating with Job, his implementation should now be feature-complete and we're just figuring out some UX details. One of the killer features is tracking deep dependencies; for example, we can now directly see that the proof of funext from univalence doesn't cheat by using funext! The eq-htpy axiom is "observed"/"focused", and the popup says that funext-univalence doesn't contain it in its dependency closure. But it does depend on univalence, as shown in the second screenshot.
20240817 194800 screen
20240817 200026 screen

@fredrik-bakke
Copy link
Collaborator

fredrik-bakke commented Sep 26, 2024

The WIP interactive explorer can be accessed here: https://jobpetrovcic.github.io/visualize

EDIT: See up-to-date link below.

@fredrik-bakke
Copy link
Collaborator

@VojtechStep Can this interactive explorer tell you if a certain rewrite rule was used in the definition of an entry?

@JobPetrovcic
Copy link
Contributor

Oops, I forgot to delete the link you mentioned, @fredrik-bakke. That one is from when we were testing stuff.

Here is the up-to-date link: https://jobpetrovcic.github.io/Unimath-Visualization-Deployment/visualize.html

@fredrik-bakke
Copy link
Collaborator

Oh, thank you!

@VojtechStep VojtechStep force-pushed the feature/job-visualization branch 3 times, most recently from 8b33d99 to 1e9b94f Compare October 5, 2024 17:29
@VojtechStep VojtechStep marked this pull request as ready for review October 5, 2024 17:29
@VojtechStep
Copy link
Collaborator Author

This one is now ready for review. @JobPetrovcic would you check if you're okay with the prose I added around the embedded graph explorer?

Can this interactive explorer tell you if a certain rewrite rule was used in the definition of an entry?

Unfortunately it can't. I'm not in a position to say if Agda stores this information anywhere for it to be possible.

@fredrik-bakke
Copy link
Collaborator

I'll try to see if I can find the time tonight to review this PR! 💪

@VojtechStep
Copy link
Collaborator Author

I'll rebase it once I get off work

@fredrik-bakke
Copy link
Collaborator

fredrik-bakke commented Oct 7, 2024

This may be outside the scope of this review so just let me know if that's the case, but would it be possible to make the font usage of the explorer consistent with the library? Consider the six numbered fonts in this image:

Screenshot 2024-10-07 at 20 13 41

Ideally, the fonts at 3, 4, and 6 would be the same as 1, while font 2 and 5 would be the same as our agda code.

(I'm working on a suggested revision of the visualization file, which is why the content is slightly different here)

scripts/generate_main_index_file.py Outdated Show resolved Hide resolved
VISUALIZATION.md Show resolved Hide resolved
VISUALIZATION.md Outdated Show resolved Hide resolved
VISUALIZATION.md Outdated Show resolved Hide resolved
VISUALIZATION.md Outdated Show resolved Hide resolved
VISUALIZATION.md Outdated Show resolved Hide resolved
@EgbertRijke
Copy link
Collaborator

This looks great and I very much approve this PR. Very nicely done!

Fredrik made some good suggestions that I second, and I have no further suggestions for changes.

Thank you @JobPetrovcic for this very nice addition to the library!

@VojtechStep
Copy link
Collaborator Author

This may be outside the scope of this review so just let me know if that's the case

Regarding this and other feature requests: Job says he realistically won't be able to work on the underlying explorer until at least February, so that part has a feature-freeze. But he does have the intention to revisit it later, so we should collect feature requests/bugs in the meantime

@fredrik-bakke
Copy link
Collaborator

Thanks for the clarification! Where should this be filed?

@JobPetrovcic
Copy link
Contributor

This may be outside the scope of this review so just let me know if that's the case, but would it be possible to make the font usage of the explorer consistent with the library? Consider the six numbered fonts in this image:

Screenshot 2024-10-07 at 20 13 41 Ideally, the fonts at 3, 4, and 6 would be the same as 1, while font 2 and 5 would be the same as our agda code.

(I'm working on a suggested revision of the visualization file, which is why the content is slightly different here)

I can change the fonts. Which fonts do you use? Currently, the visualization uses sans-serif, although 3, I think, does not (unintentionally).

@fredrik-bakke
Copy link
Collaborator

@JobPetrovcic The font hierarchy that is specified for agda code in the library is

  --mono-font: Menlo, Source Code Pro, Consolas, Monaco, Lucida Console,
    Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New,
    monospace;

Fonts elsewhere in the HTML seem to be specified via the hierarchy

font-family: "Open Sans", sans-serif

Copy link
Collaborator

@fredrik-bakke fredrik-bakke left a comment

Choose a reason for hiding this comment

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

Since every further change that was discussed is waiting for changes on the side of Job's, I suggest that we move ahead and merge this. 😁

@JobPetrovcic
Copy link
Contributor

I changed the fonts for 2, 5 to DejaVu Sans Mono and the rest to Open sans.

@fredrik-bakke
Copy link
Collaborator

Very nice! Thank you for adding that; I see the changes are live already.

@VojtechStep
Copy link
Collaborator Author

@JobPetrovcic

I changed the fonts for 2, 5 to DejaVu Sans Mono and the rest to Open sans

Unfortunately just changing the font-family to Open Sans doesn't do anything, unless the person viewing the website already has the font installed. We ship the font file at https://unimath.github.io/agda-unimath/fonts/open-sans-v17-all-charsets-regular.woff2 and then have a CSS file containing

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans Regular'), local('OpenSans-Regular'),
       url('open-sans-v17-all-charsets-regular.woff2') format('woff2');
}

to define the Open Sans font family. It is not inherited by the iframe.

Also the cascade for --mono-font that we have is written in this way because we accommodate for people having different fonts. If you pick just DejaVu Sans Mono, then people without it installed will likely see a different font used for our codeblocks and the monospace in the explorer.

Again, it's not a problem to leave this until you have more time to spend on the project. Let's not lull ourselves into considering this as implemented.

@JobPetrovcic
Copy link
Contributor

Oh, I did not know that, thank you. I reverted it, although it should take some time (~2h) for the deployment to be set back.

@fredrik-bakke
Copy link
Collaborator

Merging now after talking with Vojtech. Thank you so much again for this contribution!

@fredrik-bakke fredrik-bakke merged commit ccbfda1 into UniMath:master Oct 8, 2024
4 checks passed
@VojtechStep VojtechStep deleted the feature/job-visualization branch October 8, 2024 20:08
@JobPetrovcic
Copy link
Contributor

Nice! Thank you all for the swift and efficient review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants