Skip to content
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

dot2tex produces tikz code with missing \filldraw lines #22070

Closed
seblabbe opened this issue Dec 16, 2016 · 12 comments
Closed

dot2tex produces tikz code with missing \filldraw lines #22070

seblabbe opened this issue Dec 16, 2016 · 12 comments

Comments

@seblabbe
Copy link
Contributor

Recent ticket #21918 brings up a problem with dot2tex.

edges = [(i,(i+1)%3,a) for i,a in enumerate('abc')]
G_no_labels = DiGraph(edges)
G_with_labels = DiGraph(edges)
C = [[0,1], [2]]
kwds = dict(subgraph_clusters=C,color_by_label=True,prog='dot',format='dot2tex')
G_no_labels.latex_options().set_options(edge_labels=False, **kwds)
G_with_labels.latex_options().set_options(edge_labels=True, **kwds)
sage: view(G_no_labels)    # works fine
sage: view(G_with_labels)  # is missing cluster rectangles

Other problematic examples were provided in #21918:comment:6.

Component: packages: optional

Author: Sébastien Labbé

Branch/Commit: 89d387a

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/22070

@seblabbe
Copy link
Contributor Author

comment:1

With labels, some \filldraw line is missing in one of the tikz scope:

sage: latex(G_no_labels)    # works fine
...
sage: latex(G_with_labels)
\begin{tikzpicture}[>=latex,line join=bevel,]
%%
\begin{scope}
  \pgfsetstrokecolor{black}
  \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
  \pgfsetstrokecolor{strokecol}
  \definecolor{fillcol}{rgb}{0.94,1.0,1.0};
  \pgfsetfillcolor{fillcol}
\end{scope}
\begin{scope}
  \pgfsetstrokecolor{black}
  \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
  \pgfsetstrokecolor{strokecol}
  \definecolor{fillcol}{rgb}{0.94,1.0,1.0};
  \pgfsetfillcolor{fillcol}
  \filldraw (25.0bp,8.0bp) -- (25.0bp,37.0bp) -- (53.0bp,37.0bp) -- (53.0bp,8.0bp) -- cycle;
\end{scope}
...
\end{tikzpicture}

It seems to be because of a missing elif op == 'F' clause inside of the function do_draw_op of dot2tex.py file (see #21918:comment:11).

@fchapoton
Copy link
Contributor

comment:2

this works fine now (9.2.beta1)

@seblabbe
Copy link
Contributor Author

comment:3

I agree. Same for me.

@fchapoton
Copy link
Contributor

comment:4

Should we add a doctest ?

@seblabbe
Copy link
Contributor Author

comment:5

maybe a minimal one which only tests the presence of two occurrences of "filldraw", to avoid it to be fragile to other changes in the output...

@seblabbe
Copy link
Contributor Author

New commits:

89d387a22070: dot2tex produces tikz code with missing \filldraw lines

@seblabbe
Copy link
Contributor Author

Commit: 89d387a

@seblabbe
Copy link
Contributor Author

Author: Sébastien Labbé

@seblabbe
Copy link
Contributor Author

Branch: u/slabbe/22070

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:7

C'est bon, le patchbot est tout vert. Je passe en positif. Merci

@vbraun
Copy link
Member

vbraun commented Jun 27, 2020

Changed branch from u/slabbe/22070 to 89d387a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants