Mustafa7 - @Seve for this issue: https://github...

@Seve for this issue: https://github.com/tscircuit/tscircuit/issues/789 I did some research in schematic-symbols repo and this is the output: the blue lines/traces connects to the port center, that is why there is a gap. So where do you think the issue is?(in core or circuit-to-svg or in the symbols repo)
GitHub
Fix minor "offsets" in schematic svgs · Issue #789 · tscircuit/ts...
May be due to schematic-symbols repo or the integration into tscircuit/core Probably NOT an issue with circuit-to-svg (probably) /bounty $100
No description
65 Replies
Seve
Seve2w ago
I still don't understand the port center seems like a totally ok place to connect the red dot is the port center no?
Mustafa7
Mustafa7OP2w ago
yes
Seve
Seve2w ago
is that not aligned with the black line?
Mustafa7
Mustafa7OP2w ago
the black line ends at the starting of the red square
Seve
Seve2w ago
great find wait no that's right right? the black line ends at the red square
Mustafa7
Mustafa7OP2w ago
yea but the blue line should not start from the black line?
Seve
Seve2w ago
can you go to excalidraw.com and make an exaggerated diagram use a red square, a blue line and a black line the red square, the end of the black line, and the start of the blue line should all be the same afaik
Rishabh
Rishabh2w ago
I guess what he is trying to say is that, the port which used to be there a circle generally. The trace is starting from the center of it, while the port (black line) ends at the left end of the circle/port
Seve
Seve2w ago
so the issue has to do with the circle radius?
Rishabh
Rishabh2w ago
@Mustafa7 Draw a circle inplace of the red square. Cause the port used to be that before we removed it. It can give a better picture
Mustafa7
Mustafa7OP2w ago
Yes
Seve
Seve2w ago
which one of these is currently the state of the issue?
No description
Seve
Seve2w ago
if it's v2 then it's a schematic-symbols bug if it's v1 i don't think there should be any issues i think it's probably v2 in which case, we should throw an error if a port center is ever not exactly at the end of a line
Rishabh
Rishabh2w ago
I think this is what he mean't
No description
Rishabh
Rishabh2w ago
A v3
Mustafa7
Mustafa7OP2w ago
yes this one
Mustafa7
Mustafa7OP2w ago
No description
Rishabh
Rishabh2w ago
We could add an offset to either the port pinLenght for this to fix, or the other way to the trace start point
nailoo
nailoo2w ago
@Rishabh Could you please check it once? I'm doing the same thing — just adding the offset for this. what do you think ? https://github.com/tscircuit/core/pull/1366
Seve
Seve2w ago
@nailoo your fix is very complicated when i think @Mustafa7 might have identified a data issue in the schematic-symbols repo we don't want to have custom logic unless it's absolutely necessary, in this case i'm not sure it is
Mustafa7
Mustafa7OP2w ago
@Seve what do you think? where should it be fixed? in the symbols or core?
Seve
Seve2w ago
please create the exaggerated excalidraw of the issue i still don't know what the issue is you could temporarliy replace the red block with a thin cross to demonstrate i suspect it's a data issue, but i haven't seen any proof, so i can't help because i don't know what the issue is
Mustafa7
Mustafa7OP2w ago
@Seve ig it looks right for the icled_right svg but there is gaps in capacitor and resistor svgs. Is this the correct visualization?
Mustafa7
Mustafa7OP2w ago
No description
No description
No description
Mustafa7
Mustafa7OP2w ago
@Rishabh
Rishabh
Rishabh2w ago
It looks like the port position is incorrect in the svg's
Seve
Seve2w ago
yea let's fix those port positions the cross is even better than the square, we should switch to the cross it's very clear now @Mustafa7 i think you should programmatically error in the test that generates all the snapshots if a port center is not exactly at the end of a line with a chip. I think what happened is people haphazardly dragged these things on the svg and now we are going to have these issues all over the place unless we test for it it'll also give you all the relevant symbols to fix
Mustafa7
Mustafa7OP2w ago
@Seve @Rishabh These are all the symbols that needs to be fixed
Mustafa7
Mustafa7OP2w ago
should i proceed to fix? we just have to fix the data in the json files right?
Seve
Seve2w ago
Yes i think so if the issue is those offsets
Mustafa7
Mustafa7OP2w ago
@Seve This is how it should be right, just to let you know
Mustafa7
Mustafa7OP2w ago
No description
Mustafa7
Mustafa7OP2w ago
Also should i remove the red square and make it cross?
Seve
Seve2w ago
i think it's a good idea to use a cross instead of the red square permanently yes yes that looks right
Mustafa7
Mustafa7OP2w ago
this is a big pr. is this fine or should i do it in small parts?
Rishabh
Rishabh2w ago
LGTM! let's see what Seve has to say
Mustafa7
Mustafa7OP2w ago
@Seve can you check this
Mustafa7
Mustafa7OP2w ago
@Seve after updating the schematic-symbols symbols other than the chip does not have offsets. So why is the chip has offsets? is it because the chip symbol is implemented in the core itself?
No description
Rishabh
Rishabh2w ago
The dimensions for the chip is being constructed in core but the pinLength is being constructed in circuit-to-svg for the chip. Is this your question? You might have to look into the circuit-to-svgfor fixing the gap for chips regarding this
Mustafa7
Mustafa7OP2w ago
Ok i'll update the rest in core and look for chip in circuit-to-svg
Seve
Seve2w ago
i could be wrong but it might be a core bug. It really depends on the exact coordinates the chip is drawn with. Rishabh is right that it could be circuit to svg
Mustafa7
Mustafa7OP2w ago
ill look for chip and fix it in the next pr and then claim it @Seve can we merge this
Mustafa7
Mustafa7OP2w ago
After this, I'll then update the deps in core, eval and tscircuit @Seve @Seve this pr is not been counted on contribution-tracker for me🥲 That was the main pr for the issue🥲
Seve
Seve2w ago
probably too big, yes seems like a contribution tracker bug or something
Mustafa7
Mustafa7OP2w ago
Ok
Mustafa7
Mustafa7OP2w ago
@Seve can you check this, also if you could mark it higher that would be helpful 🥲https://github.com/tscircuit/circuit-to-svg/pull/329
Mustafa7
Mustafa7OP2w ago
@Seve addressed the review
Mustafa7
Mustafa7OP2w ago
Mustafa7
Mustafa7OP2w ago
@Rishabh
Rishabh
Rishabh2w ago
It has merge conflicts
Mustafa7
Mustafa7OP2w ago
Oh ok, i think the dep update is already merged I'll close it
Mustafa7
Mustafa7OP2w ago
@Seve
Seve
Seve2w ago
Iiuc you also need to make sure runframe and tscircuit.com have the updated schematic symbols
Mustafa7
Mustafa7OP2w ago
I'll do that
Mustafa7
Mustafa7OP2w ago
@Seve https://github.com/tscircuit/tscircuit/pull/808 on runframe eval is already updated, so i updated the runframe as in the tscircuit
Mustafa7
Mustafa7OP2w ago
after this i'll update it on tscircuit.com
Mustafa7
Mustafa7OP2w ago
@Seve
Seve
Seve2w ago
hehe you know for dep updates you can tag any maintainer is it possible to have a multi-user tag with discord i've added @anyreviewer

Did you find this page helpful?