Skip to content

Remove autoImpl and return more from autoSpec#1504

Merged
mbostock merged 3 commits into
mainfrom
toph/autospec2
May 13, 2023
Merged

Remove autoImpl and return more from autoSpec#1504
mbostock merged 3 commits into
mainfrom
toph/autospec2

Conversation

@tophtucker

Copy link
Copy Markdown
Member

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.

@tophtucker tophtucker requested a review from mbostock April 28, 2023 03:20
Comment thread test/marks/auto-test.js

@mbostock mbostock left a comment

Copy link
Copy Markdown
Member

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
@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.

2 participants