Skip to content

Conversation

@saulshanabrook
Copy link
Member

@saulshanabrook saulshanabrook commented Oct 9, 2025

This PR extended the serialized spec to allow additional arbitrary string key value mappings on each class.

This would be helpful for inlining some values into class level attributes (egraphs-good/egraph-visualizer#4) and also in egglog to serialize let bindings on the class as metadata (egraphs-good/egglog#376)

TODO before merging:

TODO after merging:

This PR extended the serialized spec to allow additional arbitrary string key value mappings on each class.

This would be helpful for inlining some values into class level attributes (egraphs-good/egraph-visualizer#4) and also in egglog to serialize let bindings on the class as metadata (egraphs-good/egglog#376)

TODO before merging:

- [ ] Add support in graphviz visualizer and test it locally
- [ ] Add support in egglog for emitting let bindings here
- [ ] Add support in the javascript visualizer to display these

TODO after merging:

- [ ] Add support for turning some values automatically into extra class properties,  in line with egraphs-good/egraph-visualizer#4
saulshanabrook added a commit to egraphs-good/egraph-visualizer that referenced this pull request Oct 9, 2025
@saulshanabrook saulshanabrook marked this pull request as ready for review October 9, 2025 23:41
saulshanabrook added a commit to egraphs-good/egraph-visualizer that referenced this pull request Oct 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends the serialized specification to allow additional arbitrary string key-value mappings on each class, enabling inlining of values into class-level attributes and supporting metadata serialization in egglog.

  • Extended ClassData struct to include a flattened extra HashMap for arbitrary string key-value pairs
  • Updated graphviz visualizer to display extra class data as HTML table labels in subgraphs
  • Added test data demonstrating the new arbitrary class data functionality

Reviewed Changes

Copilot reviewed 4 out of 7 changed files in this pull request and generated 2 comments.

File Description
src/lib.rs Added HashMap import and extra field to ClassData struct with serde flattening
src/graphviz.rs Updated visualization logic to extract and display extra class data as HTML labels
tests/tiny.json Added test data with example arbitrary class data mappings
tests/round_trip.rs Changed debug output from file path to dot format content

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yihozhang
Copy link
Contributor

I'm merging this PR since I'm cutting a release for egglog and it seems this one is ready to go.

@yihozhang yihozhang merged commit f87f1aa into main Oct 19, 2025
4 checks passed
saulshanabrook added a commit to egraphs-good/egraph-visualizer that referenced this pull request Oct 26, 2025
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.

3 participants