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

Remove autoImpl and return more from autoSpec #1504

Merged
merged 3 commits into from
May 13, 2023
Merged

Remove autoImpl and return more from autoSpec #1504

merged 3 commits into from
May 13, 2023

Conversation

tophtucker
Copy link
Contributor

To support compiling an autoSpec to the equivalent source using explicit marks. This expands the returned surface area of autoSpec a lot; so far we’ve been treating it as an undocumented and unstable function for mostly internal use, so maybe that’s OK.

The giant switch statements could be rewritten to something more like:

const MARKS = {
  barX,
  barY…
}
// in auto
markImpl = MARKS[markImpl]

but I seem to remember you saying you’d prefer the explicitness of a switch.

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

I thought of a way to avoid the verbosity of the switch statements, and to retain the symbolic references internally (and minimize the diff). This removes a little bit of error checking, but I don’t think we really needed that anyway since the names are only generated internally and we already have unit tests for it.

@mbostock mbostock enabled auto-merge (squash) May 13, 2023 15:24
@mbostock mbostock merged commit 06608eb into main May 13, 2023
1 check passed
@mbostock mbostock deleted the toph/autospec2 branch May 13, 2023 15:26
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* Remove autoImpl and return more from autoSpec

* object to dry identifier/name conversion

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
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

2 participants