fastapi-voyager 0.10.2__tar.gz → 0.10.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/PKG-INFO +5 -1
  2. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/README.md +4 -0
  3. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/filter.py +1 -1
  4. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/version.py +1 -1
  5. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/voyager.py +15 -4
  6. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/index.html +2 -2
  7. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/vue-main.js +9 -4
  8. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/test_filter.py +3 -3
  9. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/.gitignore +0 -0
  10. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/.python-version +0 -0
  11. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/LICENSE +0 -0
  12. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/pyproject.toml +0 -0
  13. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/__init__.py +0 -0
  14. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/cli.py +0 -0
  15. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/module.py +0 -0
  16. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/render.py +0 -0
  17. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/server.py +0 -0
  18. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/type.py +0 -0
  19. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/type_helper.py +0 -0
  20. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/render-graph.js +0 -0
  21. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/route-code-display.js +0 -0
  22. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/schema-code-display.js +0 -0
  23. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/schema-field-filter.js +0 -0
  24. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/graph-ui.js +0 -0
  25. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/graphviz.svg.css +0 -0
  26. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/graphviz.svg.js +0 -0
  27. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/android-chrome-192x192.png +0 -0
  28. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/android-chrome-512x512.png +0 -0
  29. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/apple-touch-icon.png +0 -0
  30. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon-16x16.png +0 -0
  31. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon-32x32.png +0 -0
  32. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon.ico +0 -0
  33. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/site.webmanifest +0 -0
  34. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/quasar.min.css +0 -0
  35. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/quasar.min.js +0 -0
  36. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/__init__.py +0 -0
  37. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/demo.py +0 -0
  38. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/demo_anno.py +0 -0
  39. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/programatic.py +0 -0
  40. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/service/__init__.py +0 -0
  41. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/service/schema.py +0 -0
  42. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/test_analysis.py +0 -0
  43. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/test_generic.py +0 -0
  44. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/test_import.py +0 -0
  45. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/test_module.py +0 -0
  46. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/tests/test_type_helper.py +0 -0
  47. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/uv.lock +0 -0
  48. {fastapi_voyager-0.10.2 → fastapi_voyager-0.10.3}/voyager.jpg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-voyager
3
- Version: 0.10.2
3
+ Version: 0.10.3
4
4
  Summary: Visualize FastAPI application's routing tree and dependencies
5
5
  Project-URL: Homepage, https://github.com/allmonday/fastapi-voyager
6
6
  Project-URL: Source, https://github.com/allmonday/fastapi-voyager
@@ -236,6 +236,10 @@ or you can open router_viz.dot with vscode extension `graphviz interactive previ
236
236
  - 0.10.2
237
237
  - [x] fix graph height
238
238
  - [x] show version in title
239
+ - 0.10.3
240
+ - [x] fix focus in brief-mode
241
+ - [x] ui: adjust focus position
242
+ - [x] refactor naming
239
243
 
240
244
  #### 0.11
241
245
  - [ ] enable/disable module cluster (to save space)
@@ -209,6 +209,10 @@ or you can open router_viz.dot with vscode extension `graphviz interactive previ
209
209
  - 0.10.2
210
210
  - [x] fix graph height
211
211
  - [x] show version in title
212
+ - 0.10.3
213
+ - [x] fix focus in brief-mode
214
+ - [x] ui: adjust focus position
215
+ - [x] refactor naming
212
216
 
213
217
  #### 0.11
214
218
  - [ ] enable/disable module cluster (to save space)
@@ -106,7 +106,7 @@ def filter_graph(
106
106
  return _tags, _routes, _nodes, _links
107
107
 
108
108
 
109
- def filter_subgraph(
109
+ def filter_subgraph_by_module_prefix(
110
110
  *,
111
111
  tags: list[Tag],
112
112
  routes: list[Route],
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "0.10.2"
2
+ __version__ = "0.10.3"
@@ -14,7 +14,7 @@ from fastapi_voyager.type_helper import (
14
14
  )
15
15
  from pydantic import BaseModel
16
16
  from fastapi_voyager.type import Route, SchemaNode, Link, Tag, LinkType, FieldType, PK, CoreData
17
- from fastapi_voyager.filter import filter_graph, filter_subgraph
17
+ from fastapi_voyager.filter import filter_graph, filter_subgraph_by_module_prefix
18
18
  from fastapi_voyager.render import Renderer
19
19
  import pydantic_resolve.constant as const
20
20
 
@@ -308,14 +308,25 @@ class Voyager:
308
308
  return renderer.render_dot(_tags, _routes, _nodes, _links)
309
309
 
310
310
  def render_brief_dot(self, module_prefix: str | None = None):
311
- _tags, _routes, _nodes, _links = filter_subgraph(
312
- module_prefix=module_prefix,
311
+ _tags, _routes, _nodes, _links = filter_graph(
312
+ schema=self.schema,
313
+ schema_field=self.schema_field,
313
314
  tags=self.tags,
314
315
  routes=self.routes,
315
316
  nodes=self.nodes,
316
317
  links=self.links,
318
+ node_set=self.node_set,
319
+ )
320
+
321
+ _tags, _routes, _nodes, _links = filter_subgraph_by_module_prefix(
322
+ module_prefix=module_prefix,
323
+ tags=_tags,
324
+ routes=_routes,
325
+ nodes=_nodes,
326
+ links=_links,
317
327
  )
318
- renderer = Renderer(show_fields=self.show_fields, module_color=self.module_color, schema=None)
328
+
329
+ renderer = Renderer(show_fields=self.show_fields, module_color=self.module_color, schema=self.schema)
319
330
 
320
331
  _tags, _routes, _links = self.handle_hide(_tags, _routes, _links)
321
332
  return renderer.render_dot(_tags, _routes, _nodes, _links, True)
@@ -152,7 +152,6 @@
152
152
  shift + click to see schema's dependencies without
153
153
  unrelated nodes
154
154
  </li>
155
- <li>alt + click to see schema details</li>
156
155
  </ul>
157
156
  </div>
158
157
  </q-tooltip>
@@ -286,7 +285,8 @@
286
285
  v-show="schemaCodeName"
287
286
  @update:model-value="val => onFocusChange(val)"
288
287
  label="Focus"
289
- style="position: absolute; left: 8px; top: 8px; z-index: 10; background: rgba(255,255,255,0.85); border-radius: 4px; padding: 2px 8px;"
288
+ title="pick a schema and toggle focus on to display related nodes only"
289
+ style="position: absolute; left: 8px; bottom: 8px; z-index: 10; background: rgba(255,255,255,0.85); border-radius: 4px; padding: 2px 8px;"
290
290
  size="sm"
291
291
  />
292
292
  </div>
@@ -93,7 +93,6 @@ const app = createApp({
93
93
  await onGenerate(false, null)
94
94
  setTimeout(() => {
95
95
  const ele = $(`[data-name='${schemaCodeName.value}'] polygon`)
96
- debugger
97
96
  ele.click()
98
97
  }, 1)
99
98
  }
@@ -121,11 +120,13 @@ const app = createApp({
121
120
  const graphUI = new GraphUI("#graph", {
122
121
  onSchemaShiftClick: (id) => {
123
122
  if (state.rawSchemas.has(id)) {
123
+ resetDetailPanels()
124
124
  schemaFieldFilterSchema.value = id;
125
125
  showSchemaFieldFilter.value = true;
126
126
  }
127
127
  },
128
128
  onSchemaClick: (id) => {
129
+ resetDetailPanels()
129
130
  if (state.rawSchemas.has(id)) {
130
131
  schemaCodeName.value = id;
131
132
  state.detailDrawer = true;
@@ -136,9 +137,7 @@ const app = createApp({
136
137
  }
137
138
  },
138
139
  resetCb: () => {
139
- state.detailDrawer = false;
140
- showRouteDetail.value = false;
141
- schemaCodeName.value = ''
140
+ resetDetailPanels()
142
141
  }
143
142
  });
144
143
 
@@ -212,6 +211,12 @@ const app = createApp({
212
211
  showSchemaFieldFilter.value = true;
213
212
  }
214
213
 
214
+ function resetDetailPanels() {
215
+ state.detailDrawer = false
216
+ showRouteDetail.value = false;
217
+ schemaCodeName.value = ''
218
+ }
219
+
215
220
  async function onReset() {
216
221
  state.tag = null;
217
222
  state.routeId = "";
@@ -1,4 +1,4 @@
1
- from fastapi_voyager.filter import filter_subgraph
1
+ from fastapi_voyager.filter import filter_subgraph_by_module_prefix
2
2
  from fastapi_voyager.type import Tag, Route, SchemaNode, Link, PK
3
3
 
4
4
 
@@ -42,7 +42,7 @@ def test_filter_subgraph_filters_nodes_and_links():
42
42
  routes = [route]
43
43
  nodes = [node_a, node_b]
44
44
 
45
- _, _, filtered_nodes, filtered_links = filter_subgraph(
45
+ _, _, filtered_nodes, filtered_links = filter_subgraph_by_module_prefix(
46
46
  tags=tags,
47
47
  routes=routes,
48
48
  links=links,
@@ -110,7 +110,7 @@ def test_filter_subgraph_handles_cycles_and_multiple_matches():
110
110
 
111
111
  nodes = [node_root, node_mid, node_target1, node_target2]
112
112
 
113
- _, _, filtered_nodes, filtered_links = filter_subgraph(
113
+ _, _, filtered_nodes, filtered_links = filter_subgraph_by_module_prefix(
114
114
  tags=[tag],
115
115
  routes=[route],
116
116
  links=links,