homotopy-io / homotopy-rs

A Rust/WASM implementation of homotopy.io
https://homotopy.io
BSD 3-Clause "New" or "Revised" License
84 stars 7 forks source link

Render vertices as boxes #460

Open calintat opened 2 years ago

calintat commented 2 years ago

As discussed in our meeting today, it would be nice to have an option to render vertices as boxes instead of points.

jamievicary commented 2 years ago

You mean vertices, not 0-cells.

calintat commented 2 years ago

Yes oops.

calintat commented 2 years ago

@thud to clarify what we mean here, we want the option to draw vertices as boxes with vertical wires going in/out:

Screenshot 2022-06-28 at 09 37 43

I just realised this might be trickier than I expected, so let's start by replacing the vertices with boxes (these can be squares for now). After that, we can think about making the wires vertical, which will also require changing the surfaces.

Ideally, this will be an option that can be toggled for each generator (#520), but for now it's fine if this is a global setting.

thud commented 2 years ago

Thanks, that clears it up a little. I've been working on making the vertices individually restylable (ie. each vertex can be a box or a circle or some other shape). I think this will be relatively straightforward to finish but it may conflict slightly with the global setting.

For now I'll keep working on individual styles. Let me know if I should refocus on the global setting instead.

calintat commented 2 years ago

Perfect, that's even better.

thud commented 2 years ago

Quick written update on this: currently working on changing the shape of individual vertices.

Changes to state management will be non-trivial as it stands. Next attempt at implementation will involve sharing the GeneratorInfo struct with homotopy-graphics.

doctorn commented 2 years ago

Nice work @thud! Maybe split out a GeneratorStyle struct that can be shared rather than sharing the whole GeneratorInfo?

Let me know if you need a hand making your state changes backwards compatible with the serialiser!

thud commented 2 years ago

Maybe split out a GeneratorStyle struct that can be shared rather than sharing the whole GeneratorInfo?

Oh yeah, that's much better actually. I'll work that through today and see what I can get running.

calintat commented 2 years ago

We might also need the name if say we decided to label the vertices, so it might be good to share the whole GeneratorInfo just for future convenience.

jamievicary commented 2 years ago

We definitely need tooltips showing the generator name when we hover the mouse cursor over the diagram.

On Fri, 1 Jul 2022, 11:29 Calin Tataru, @.***> wrote:

We might also need the name if say we decided to label the vertices, so it might be good to share the whole GeneratorInfo just for future convenience.

— Reply to this email directly, view it on GitHub https://github.com/homotopy-io/homotopy-rs/issues/460#issuecomment-1172140146, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQ4OHQQBTZ65XLWBTTBHO3VR227BANCNFSM5UL5EVJA . You are receiving this because you commented.Message ID: @.***>

calintat commented 2 years ago

We already have that right? Also it's not related to this bug I think.

jamievicary commented 2 years ago

This is a GitHub bug. I made that comment months ago by email and it only just got processed.

calintat commented 2 years ago

Haha interesting.