Comments (5)
Hi @otyrrell,
Strange! I did not have an issue with your example.
(Note that your code is not quite fully reproducible. You're missing a BaseModel
import and a List
import.)
Can you provide the output of erd.create(A).to_dot()
?
As well, can you provide the version of Pydantic, Pygraphviz, and Graphviz that you are using?
EDIT: I am noticing though that my version is missing the O so something is still a little wacky here...
from erdantic.
Sorry, I didn't copy the full code, please see full segment below:
import erdantic as erd
from erdantic.examples.pydantic import Party
from typing import List
from pydantic import BaseModel
# Easy one-liner
erd.draw(Party, out="diagram.png")
class B(BaseModel):
"""
B Class
"""
id: str
class A(BaseModel):
"""
A Class
"""
list_b: List[B]
erd.draw(A, out="A.jpg")
result = erd.create(A).to_dot()
print(result)
This provides the output:
digraph "Entity Relationship Diagram" {
graph [fontcolor=gray66,
fontsize=9,
label="Created by erdantic v0.6.0 <https://github.com/drivendataorg/erdantic>",
nodesep=0.5,
rankdir=LR,
ranksep=1.5
];
node [fontsize=14,
label="\N",
shape=plain
];
"__main__.A" [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>A</b></td></tr><tr><td>list_b</td><td port="list_b">List[B]</td></tr></table>>,
tooltip="__main__.A

A Class
"];
"__main__.B" [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>B</b></td></tr><tr><td>id</td><td port="id">str</td></tr></table>>,
tooltip="__main__.B

B Class
"];
"__main__.A":list_b:e -> "__main__.B":_root:w [arrowhead=crowodot];
}
Name: erdantic
Version: 0.6.0
Name: pydantic
Version: 2.3.0
Name: pygraphviz
Version: 1.11
GraphViz version 9.0.0 on Windows 10 x64
Only other thing I found is that it seems very specific to crow notation; when I changed "crow" to "icurve" on line 55 in erd.py it all works as expected (although showing the curve notation not the required crows foot)
from erdantic.
The DOT output looks like what I expect, and copy-pasting it into this online renderer seems to produce the expected image. https://dreampuf.github.io/GraphvizOnline
So that suggests something funky is happening at the pygraphviz/graphviz level. Will find some time to dig into this more.
from erdantic.
Thank you for clarifying. I agree it does appear to be some sort of bug/unexpected behaviour within pygraphviz/graphviz. I couldn't find any relevant reports of crow foot notation having issues. I guess next step is understanding whether it is in the graphviz or the pygraphviz layer?
from erdantic.
I'm not seeing this anymore with pygraphviz 1.12
, graphviz 9.0.0
. Closing as resolved unless there are additional details provided.
from erdantic.
Related Issues (20)
- Failed build on main branch (tests #209) HOT 1
- Update tests to handle Typer >= 0.6 - Failed build on main branch (tests #211) HOT 2
- Failed build on main branch (tests #212) HOT 1
- NBConvert does not handle SVG correctly causing docs build to fail HOT 6
- Add extra Column HOT 2
- ERROR: Cannot unpack file pip-unpack-fpbmoqaz\erdantic.git (content-type: text/html; charset=utf-8); cannot detect archive format HOT 3
- No module found error without setting PYTHONPATH HOT 2
- styling diagrams to become more UML-like HOT 2
- Feature: Customizable graph label -> remove erdantic watermark HOT 4
- Support for pydbantic HOT 2
- Support pydantic field's alias
- Create edges for Constrained Lists HOT 1
- Support for Pydantic V2 HOT 1
- Failed build: tests HOT 1
- Failed build: tests HOT 1
- Allow user to provide custom cardinality and modality HOT 2
- Modality `zero` should only be determined by Optional typing HOT 2
- Create edges with modality and cardinality on left and right-hand side HOT 1
- Failed build: tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erdantic.