-
Notifications
You must be signed in to change notification settings - Fork 24
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
testing elkjs #528
testing elkjs #528
Conversation
@@ -279,7 +279,8 @@ export abstract class PrimitiveComponent< | |||
* schematic components | |||
*/ | |||
computeSchematicPropsTransform(): Matrix { | |||
return compose(translate(this.props.schX ?? 0, this.props.schY ?? 0)) | |||
// need to find a way to make schX and schY 0 before autolayout and apply them after autolayout | |||
return compose(translate(0, 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i talked about this on stream today at the 25m point, drew a diagram
this._queueAsyncEffect("schematic-layout", async () => { | ||
try { | ||
await layoutSchematicWithElk(db) | ||
this._markDirty("SchematicLayout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
const ports = db.schematic_port.list() | ||
|
||
const elk = new Elk({ | ||
workerUrl: "./node_modules/elkjs/lib/elk-worker.min.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll need to load this via blobUrl probably (unfortunately)
will require bundling step, similar to @tscircuit/eval-webworker
I'm thinking maybe we create a separate package for this just to simplify where this code lives and to make as many test cases as possible, but not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great, so my thought on this is, we might not want to remove the old stuff which I know how to improve (the schematic autolayout algo) versus ElkJS which I don't know the limitations of we might wanna create an repo for a new node project that specifically test the elk JS layout.
We could have a repo that's just filled with tests that we can use to test lots of different layouts, kind of like this: https://github.com/tscircuit/schematic-autolayout
We could literally use the setup in this repo, but I would start anew using snapshot testing, i created a repo here: https://github.com/tscircuit/elkjs-autolayout
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
This PR was closed because it has been inactive for 1 day since being marked as stale. |
this is just a showcase; do not merge