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

graph_models style per app #1848

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahmad88me
Copy link

Idea

Style the generated model per app.

use case

Imagine you're working on a Django project composed of two distinct applications, namely 'app1' and 'app2'. These applications are interconnected, with models in each app having relationships not only within the same app but also across the two apps. To effectively visualise these intricate relationships, you're aiming to generate a comprehensive graph model. This graph will not only illustrate the internal model structures within each individual app but will also clearly depict the inter-app model relationships. The goal is to have a single, unified graphical representation that vividly differentiates the models of 'app1' and 'app2', while simultaneously showcasing the connections between them. Such a visual tool would be invaluable for understanding the complex architecture of your Django project at a glance.

How to use it

You can either have a .app-style.json or you can specify the style file using the --app-style option. It takes a path to the style file. The style file is a json file which has the app name as the key and the style as the value. Here is a sample one:

{
  "app1": {"bg": "#341b56"},
  "django.contrib.auth": {"bg": "#561b4c"},
  "app2":{"bg": "#1b3956"}
}

Further, I updated the django style to support the background change. So in the future, this can easily be extended to more styles (e.g., color, font, ..., etc.)

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

Successfully merging this pull request may close these issues.

None yet

1 participant