varkor / quiver

A modern commutative diagram editor for the web.
https://q.uiver.app
MIT License
2.37k stars 78 forks source link

Allow vertex styling (e.g. circled vertices) #75

Open casouri opened 3 years ago

casouri commented 3 years ago

I'm trying to use quiver to draw finite automata, to do that, quiver would need a few additional features:

Right now I just draw in quiver and finish off by hand, but maybe you are interested in adding these features.

\[\begin{tikzcd}[cells={nodes={state}}]
    |[draw=none]| { } & {q_1} && |[accepting]| {q_3} && {q_4} \\
    \\
    &&& {q_5}
    \arrow["1", from=1-2, to=1-4]
    \arrow["0"', bend right, from=1-2, to=3-4]
    \arrow["{1,0}", bend left, from=1-4, to=1-6]
    \arrow["1", from=3-4, to=1-4]
    \arrow["0", bend left, from=1-6, to=1-4]
    \arrow["0", bend right, from=3-4, to=1-6]
    \arrow[from=1-1, to=1-2]
        \arrow["{1,0}", from=1-6, to=1-6, loop right]
\end{tikzcd}\]
\end{document} 
Screen Shot 2021-01-28 at 11 28 58 AM
varkor commented 3 years ago

There's an open issue for loops: #31. I'm not sure about adding vertex styling, because these features generally aren't used in commutative diagrams. It's certainly the case that this isn't a priority for me at the moment, but if you or someone else wanted to implement this feature, we could discuss how to do so.

casouri commented 3 years ago

Ok! I certainly don't have the time and knowledge to implement this feature. If no one is interested feel free to close this issue :)

davidson16807 commented 3 years ago

I would be interested in implementing this feature. I've used loops before in tikzcd-editor to depict when functions are idempotent, and it's the only feature from that app that I think is missing here.

I'll need some time to familiarize myself with the code. And I wouldn't mind some advice on how to implement. How do you think it should be handled in the UI? Something like tikzcd-editor, with a dedicated button in the cell corner? Maybe there could be a region in the cell that you could drag arrows to, like on the outer regions of the object you dragged from?

Also, what parts of code do you think will be modified?

varkor commented 3 years ago

@davidson16807: confusingly, the main issue for loops is #31 (I've renamed this issue accordingly). I'll respond there to keep discussion on-topic :)