theacodes / kicanvas

The KiCAD web viewer
https://kicanvas.org
Other
644 stars 33 forks source link

Cannot get the Schematic to be the default when using API to allow viewing both schematic and pct #79

Open bradanlane opened 9 months ago

bradanlane commented 9 months ago

I call the embedded API using the following:

    <script type="module" src="js/kicanvas.js"></script>
    <kicanvas-embed controls="full" controlslist="nodownload">
        <kicanvas-source src="files/project.kicad_pro"></kicanvas-source>
        <kicanvas-source src="files/project.kicad_sch"></kicanvas-source>
        <kicanvas-source src="files/project.kicad_pcb"></kicanvas-source>
    </kicanvas-embed>

It always starts with the PCB.

I have tried omitting the pro file and I have tried swapped the order. The PCB is always the default when the webpage is loaded.

What change do I need to make such that the schematic is the default?

theacodes commented 9 months ago

It always defaults to the PCB right now. We'd have to add a new attribute to control loading order.

On Mon, Feb 5, 2024 at 11:53 AM bradanlane @.***> wrote:

I call the embedded API using the following:

<script type="module" src="js/kicanvas.js"></script>
<kicanvas-embed controls="full" controlslist="nodownload">
    <kicanvas-source src="files/project.kicad_pro"></kicanvas-source>
    <kicanvas-source src="files/project.kicad_sch"></kicanvas-source>
    <kicanvas-source src="files/project.kicad_pcb"></kicanvas-source>
</kicanvas-embed>

It always starts with the PCB.

I have tried omitting the pro file and I have tried swapped the order. The PCB is always the default when the webpage is loaded.

What change do I need to make such that the schematic is the default?

— Reply to this email directly, view it on GitHub https://github.com/theacodes/kicanvas/issues/79, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I4YZ2R3YQNKPFV7OTR3YSEFAJAVCNFSM6AAAAABC2PPPDOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTSMBRG43TQNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

bradanlane commented 9 months ago

OK. Then it looks like it's just a documentation issue. The doc currently reads:

Note that if the files are all part of the same project, then the root schematic will be shown by default

I read this to mean, if I have multiple files from the same project, the schematic will be the default.