๐Ÿ“ฆ apache / datafusion

๐Ÿ“„ dependency-graph.md ยท 181 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181<!---
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->

# Workspace Dependency Graph

This page shows the dependency relationships between DataFusion's workspace
crates. This only includes internal dependencies, external crates like `Arrow` are not included

The dependency graph is auto-generated by `docs/scripts/generate_dependency_graph.sh` to ensure it stays up-to-date, and the script now runs automatically as part of `docs/build.sh`.

## Dependency Graph for Workspace Crates

<!--
  Below is an embedded .svg file, with interactive functionalities like drag/zoom-in/etc.
  -->

```{raw} html
<div id="workspace-deps-wrapper" style="border:1px solid #d4d4d8;border-radius:10px;overflow:hidden;background:#fff;">
  <div id="workspace-deps-inline" style="min-height:760px;width:100%;background:#f8fafc;overflow:hidden;padding:0;margin:0;">
```

```{eval-rst}
.. raw:: html
   :file: ../../_static/data/deps.svg
```

```{raw} html
  </div>
  <div style="padding:10px 12px;background:#f1f5f9;border-top:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;">
    <span style="color:#334155;font-size:0.95rem;">Interactive SVG (pan, zoom, search)</span>
    <div style="display:flex;align-items:center;gap:6px;">
      <button id="workspace-deps-zoom-out" type="button" style="padding:6px 10px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#334155;cursor:pointer;">โˆ’</button>
      <button id="workspace-deps-zoom-in" type="button" style="padding:6px 10px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#334155;cursor:pointer;">+</button>
    </div>
    <a href="../../_static/data/deps.svg" target="_blank" rel="noopener"
       style="font-weight:600;color:#2563eb;text-decoration:none;">Open SVG โ†—</a>
  </div>
</div>
<script>
  (function () {
    const host = document.getElementById("workspace-deps-inline");
    if (!host) {
      return;
    }

    const svg = host.querySelector("svg");
      if (!svg) {
        host.textContent = "Unable to load dependency graph.";
        host.style.display = "flex";
        host.style.alignItems = "center";
        host.style.justifyContent = "center";
      host.style.background = "#f8fafc";
      return;
    }

    svg.removeAttribute("width");
    svg.removeAttribute("height");
    svg.style.width = "100%";
    svg.style.height = "100%";
    svg.style.cursor = "grab";
    svg.style.touchAction = "none";

    const rawViewBox = (svg.getAttribute("viewBox") || "").split(/\s+/).map(Number);
    if (rawViewBox.length !== 4 || rawViewBox.some((v) => Number.isNaN(v))) {
      return;
    }

    const initial = {
      x: rawViewBox[0],
      y: rawViewBox[1],
      width: rawViewBox[2],
      height: rawViewBox[3],
    };

    const state = { ...initial };
    const applyViewBox = () => {
      svg.setAttribute("viewBox", `${state.x} ${state.y} ${state.width} ${state.height}`);
    };

    let isPanning = false;
    let last = { x: 0, y: 0 };

    svg.addEventListener("pointerdown", (event) => {
      isPanning = true;
      last = { x: event.clientX, y: event.clientY };
      svg.setPointerCapture(event.pointerId);
      svg.style.cursor = "grabbing";
    });

    const endPan = (event) => {
      if (event && svg.hasPointerCapture(event.pointerId)) {
        svg.releasePointerCapture(event.pointerId);
      }
      isPanning = false;
      svg.style.cursor = "grab";
    };

    svg.addEventListener("pointerup", endPan);
    svg.addEventListener("pointerleave", endPan);
    svg.addEventListener("pointercancel", endPan);

    const zoomBy = (factor) => {
      const targetWidth = state.width * factor;
      const targetHeight = state.height * factor;
      const minSize = Math.max(initial.width * 0.05, 10);
      const maxSize = initial.width * 20;
      const clampedWidth = Math.min(Math.max(targetWidth, minSize), maxSize);
      const clampedHeight = Math.min(Math.max(targetHeight, minSize), maxSize);

      state.x += (state.width - clampedWidth) / 2;
      state.y += (state.height - clampedHeight) / 2;
      state.width = clampedWidth;
      state.height = clampedHeight;
      applyViewBox();
    };

    const normalizeDelta = (deltaY, deltaMode) => {
      // Make trackpad/wheel zoom feel smooth across devices.
      const multiplier = deltaMode === 1 ? 16 : deltaMode === 2 ? window.innerHeight : 1;
      return deltaY * multiplier;
    };

    svg.addEventListener("pointermove", (event) => {
      if (!isPanning) {
        return;
      }
      const scaleX = state.width / svg.clientWidth;
      const scaleY = state.height / svg.clientHeight;
      state.x -= (event.clientX - last.x) * scaleX;
      state.y -= (event.clientY - last.y) * scaleY;
      last = { x: event.clientX, y: event.clientY };
      applyViewBox();
    });

    svg.addEventListener("wheel", (event) => {
      event.preventDefault();

      const delta = normalizeDelta(event.deltaY, event.deltaMode);
      const factor = Math.exp(delta * 0.0015); // smaller magnitude for smoother scrolling
      zoomBy(factor);
    }, { passive: false });

    const zoomIn = document.getElementById("workspace-deps-zoom-in");
    const zoomOut = document.getElementById("workspace-deps-zoom-out");
    if (zoomIn) {
      zoomIn.addEventListener("click", () => zoomBy(0.9));
    }
    if (zoomOut) {
      zoomOut.addEventListener("click", () => zoomBy(1.1));
    }
  })();
</script>
```

### Legend

- black lines: normal dependency
- blue lines: dev-dependency
- green lines: build-dependency
- dotted lines: optional dependency (could be removed by disabling a cargo feature)

Transitive dependencies are intentionally ignored to keep the graph readable.

The dependency graph is generated through `cargo depgraph` by `docs/scripts/generate_dependency_graph.sh`.