Graphinate 0.12.0__py3-none-any.whl
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.
- graphinate/__init__.py +18 -0
- graphinate/__main__.py +4 -0
- graphinate/builders/__init__.py +55 -0
- graphinate/builders/_builder.py +58 -0
- graphinate/builders/_d3.py +61 -0
- graphinate/builders/_graphql.py +521 -0
- graphinate/builders/_mermaid.py +45 -0
- graphinate/builders/_networkx.py +227 -0
- graphinate/cli.py +123 -0
- graphinate/color.py +100 -0
- graphinate/constants.py +4 -0
- graphinate/converters.py +94 -0
- graphinate/enums.py +44 -0
- graphinate/modeling.py +337 -0
- graphinate/renderers/__init__.py +5 -0
- graphinate/renderers/graphql.py +111 -0
- graphinate/renderers/matplotlib.py +82 -0
- graphinate/server/__init__.py +0 -0
- graphinate/server/starlette/__init__.py +31 -0
- graphinate/server/starlette/views.py +17 -0
- graphinate/server/web/__init__.py +25 -0
- graphinate/server/web/elements/index.html +23 -0
- graphinate/server/web/graphiql/index.html +160 -0
- graphinate/server/web/rapidoc/index.html +17 -0
- graphinate/server/web/static/images/logo-128.png +0 -0
- graphinate/server/web/static/images/logo.svg +50 -0
- graphinate/server/web/static/images/network_graph.png +0 -0
- graphinate/server/web/viewer/index.html +719 -0
- graphinate/server/web/voyager/index.html +55 -0
- graphinate/tools.py +7 -0
- graphinate/typing.py +83 -0
- graphinate-0.12.0.dist-info/METADATA +284 -0
- graphinate-0.12.0.dist-info/RECORD +36 -0
- graphinate-0.12.0.dist-info/WHEEL +4 -0
- graphinate-0.12.0.dist-info/entry_points.txt +2 -0
- graphinate-0.12.0.dist-info/licenses/LICENSE +165 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Graphinate - GraphiQL</title>
|
|
5
|
+
<style>
|
|
6
|
+
body {
|
|
7
|
+
height: 100%;
|
|
8
|
+
margin: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#graphiql {
|
|
14
|
+
height: 100vh;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.docExplorerHide {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.doc-explorer-contents {
|
|
23
|
+
overflow-y: hidden !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.docExplorerWrap {
|
|
27
|
+
width: unset !important;
|
|
28
|
+
min-width: unset !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.graphiql-explorer-actions select {
|
|
32
|
+
margin-left: 4px;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
35
|
+
|
|
36
|
+
<script
|
|
37
|
+
crossorigin
|
|
38
|
+
src="https://unpkg.com/react@17.0.2/umd/react.development.js"
|
|
39
|
+
integrity="sha384-xQwCoNcK/7P3Lpv50IZSEbJdpqbToWEODAUyI/RECaRXmOE2apWt7htari8kvKa/"
|
|
40
|
+
></script>
|
|
41
|
+
<script
|
|
42
|
+
crossorigin
|
|
43
|
+
src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"
|
|
44
|
+
integrity="sha384-E9IgxDsnjKgh0777N3lXen7NwXeTsOpLLJhI01SW7idG046SRqJpsW2rJwsOYk0L"
|
|
45
|
+
></script>
|
|
46
|
+
|
|
47
|
+
<script
|
|
48
|
+
crossorigin
|
|
49
|
+
src="https://unpkg.com/js-cookie@3.0.5/dist/js.cookie.min.js"
|
|
50
|
+
integrity="sha384-/vxhYfM1LENRhdpZ8dwEsQn/X4VhpbEZSiU4m/FwR+PVpzar4fkEOw8FP9Y+OfQN"
|
|
51
|
+
></script>
|
|
52
|
+
|
|
53
|
+
<link
|
|
54
|
+
crossorigin
|
|
55
|
+
rel="stylesheet"
|
|
56
|
+
href="https://unpkg.com/graphiql@2.4.7/graphiql.min.css"
|
|
57
|
+
integrity="sha384-486GcFFVcFN0yj7LIp/vn7DVsuf2CTytJlNuqjHg0zF2g72zra2gWCNV2HBxJgC6"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<link
|
|
61
|
+
crossorigin
|
|
62
|
+
rel="stylesheet"
|
|
63
|
+
href="https://cdn.jsdelivr.net/npm/@graphiql/plugin-explorer@0.1.15/dist/style.css"
|
|
64
|
+
integrity="sha384-kOrlMT58B3t0hTVIPFqWyg1oL4DKvxHNcC1X2qugv4fXd9ehKULhhjDLvBi3HoEK"
|
|
65
|
+
/>
|
|
66
|
+
</head>
|
|
67
|
+
|
|
68
|
+
<body>
|
|
69
|
+
<div id="graphiql" class="graphiql-container">Loading...</div>
|
|
70
|
+
<script
|
|
71
|
+
crossorigin
|
|
72
|
+
src="https://unpkg.com/graphiql@2.4.7/graphiql.min.js"
|
|
73
|
+
integrity="sha384-8da92RVD56z/pbOOnJ4Ud5qlhqEzDtJI6qVZjN88SCbOatpo4xVDeP3T0nmfTf+9"
|
|
74
|
+
></script>
|
|
75
|
+
<script
|
|
76
|
+
crossorigin
|
|
77
|
+
src="https://unpkg.com/@graphiql/plugin-explorer@0.1.15/dist/graphiql-plugin-explorer.umd.js"
|
|
78
|
+
integrity="sha384-730PslzMVMN3EMJOKuh/WVRaRwhaBbWE43IOXyR+DMDlQiYx0BjiPmoPZ+6qEa0C"
|
|
79
|
+
></script>
|
|
80
|
+
<script>
|
|
81
|
+
const EXAMPLE_QUERY = `# Welcome to GraphiQL 🍓
|
|
82
|
+
#
|
|
83
|
+
# GraphiQL is an in-browser tool for writing, validating, and
|
|
84
|
+
# testing GraphQL queries.
|
|
85
|
+
#
|
|
86
|
+
# Type queries into this side of the screen, and you will see intelligent
|
|
87
|
+
# typeaheads aware of the current GraphQL type schema and live syntax and
|
|
88
|
+
# validation errors highlighted within the text.
|
|
89
|
+
#
|
|
90
|
+
# GraphQL queries typically start with a "{" character. Lines that starts
|
|
91
|
+
# with a # are ignored.
|
|
92
|
+
#
|
|
93
|
+
# An example GraphQL query might look like:
|
|
94
|
+
#
|
|
95
|
+
# {
|
|
96
|
+
# field(arg: "value") {
|
|
97
|
+
# subField
|
|
98
|
+
# }
|
|
99
|
+
# }
|
|
100
|
+
#
|
|
101
|
+
# Keyboard shortcuts:
|
|
102
|
+
#
|
|
103
|
+
# Run Query: Ctrl-Enter (or press the play button above)
|
|
104
|
+
#
|
|
105
|
+
# Auto Complete: Ctrl-Space (or just start typing)
|
|
106
|
+
#
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
//**const fetchURL = window.location.href;
|
|
110
|
+
const fetchURL = `${window.location.protocol}//${window.location.host}/graphql`;
|
|
111
|
+
|
|
112
|
+
function httpUrlToWebSocketUrl(url) {
|
|
113
|
+
const parsedURL = new URL(url);
|
|
114
|
+
const protocol = parsedURL.protocol === "http:" ? "ws:" : "wss:";
|
|
115
|
+
parsedURL.protocol = protocol;
|
|
116
|
+
parsedURL.hash = "";
|
|
117
|
+
return parsedURL.toString();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const headers = {};
|
|
121
|
+
const csrfToken = Cookies.get("csrftoken");
|
|
122
|
+
|
|
123
|
+
if (csrfToken) {
|
|
124
|
+
headers["x-csrftoken"] = csrfToken;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const subscriptionsEnabled = JSON.parse("true");
|
|
128
|
+
const subscriptionUrl = subscriptionsEnabled
|
|
129
|
+
? httpUrlToWebSocketUrl(fetchURL)
|
|
130
|
+
: null;
|
|
131
|
+
|
|
132
|
+
const fetcher = GraphiQL.createFetcher({
|
|
133
|
+
url: fetchURL,
|
|
134
|
+
headers: headers,
|
|
135
|
+
subscriptionUrl,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
function GraphiQLWithExplorer() {
|
|
139
|
+
const [query, setQuery] = React.useState(EXAMPLE_QUERY);
|
|
140
|
+
const explorerPlugin = GraphiQLPluginExplorer.useExplorerPlugin({
|
|
141
|
+
query: query,
|
|
142
|
+
onEdit: setQuery,
|
|
143
|
+
});
|
|
144
|
+
return React.createElement(GraphiQL, {
|
|
145
|
+
fetcher: fetcher,
|
|
146
|
+
defaultEditorToolsVisibility: true,
|
|
147
|
+
plugins: [explorerPlugin],
|
|
148
|
+
query: query,
|
|
149
|
+
onEditQuery: setQuery,
|
|
150
|
+
inputValueDeprecation: true,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
ReactDOM.render(
|
|
155
|
+
React.createElement(GraphiQLWithExplorer),
|
|
156
|
+
document.getElementById("graphiql")
|
|
157
|
+
);
|
|
158
|
+
</script>
|
|
159
|
+
</body>
|
|
160
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html> <!-- Important: must specify -->
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
|
|
5
|
+
<script src="https://cdn.jsdelivr.net/npm/rapidoc@9.3.8/dist/rapidoc-min.min.js"
|
|
6
|
+
integrity="sha384-ZWO1wF+IJoaMeJCF6MU+iPg1/zSWwNApqbVQTa+x7p+eNq79TyujD2sCtCMwq7J/"
|
|
7
|
+
crossorigin="anonymous"></script>
|
|
8
|
+
<title>Graphinate - OpenAPI RapiDoc UI</title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<rapi-doc
|
|
12
|
+
spec-url="/schema"
|
|
13
|
+
theme="dark"
|
|
14
|
+
render-style = "read"
|
|
15
|
+
></rapi-doc>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Filters for shadow -->
|
|
3
|
+
<defs>
|
|
4
|
+
<filter id="circle-shadow" x="-50%" y="-50%" width="200%" height="500%">
|
|
5
|
+
<feDropShadow dx="6" dy="6" stdDeviation="1" flood-color="rgba(0, 0, 0, 0.8)"/>
|
|
6
|
+
</filter>
|
|
7
|
+
<filter id="text-shadow" x="-50%" y="-50%" width="200%" height="500%">
|
|
8
|
+
<feDropShadow dx="5" dy="5" stdDeviation="1" flood-color="rgba(0, 0, 0, 0.6)"/>
|
|
9
|
+
</filter>
|
|
10
|
+
</defs>
|
|
11
|
+
|
|
12
|
+
<text x="10" y="30"
|
|
13
|
+
font-family="serif"
|
|
14
|
+
font-size="40"
|
|
15
|
+
font-weight="500"
|
|
16
|
+
fill="darkviolet"
|
|
17
|
+
stroke="indigo"
|
|
18
|
+
stroke-width="0.5"
|
|
19
|
+
filter="url(#text-shadow)">𝔾raphinate
|
|
20
|
+
</text>
|
|
21
|
+
<!-- Background -->
|
|
22
|
+
<!--rect width="100%" height="100%" fill="#2E004F" /-->
|
|
23
|
+
|
|
24
|
+
<!-- Circle with shadow -->
|
|
25
|
+
<circle cx="100" cy="100" r="60" fill="indigo" stroke="rebeccapurple" stroke-width="0.5"
|
|
26
|
+
filter="url(#circle-shadow)"/>
|
|
27
|
+
<!-- Double-struck G with shadow -->
|
|
28
|
+
<text x="99" y="113"
|
|
29
|
+
font-family="serif"
|
|
30
|
+
font-size="108"
|
|
31
|
+
fill="darkviolet"
|
|
32
|
+
text-anchor="middle"
|
|
33
|
+
stroke="indigo"
|
|
34
|
+
stroke-width="0.5"
|
|
35
|
+
alignment-baseline="middle"
|
|
36
|
+
filter="url(#text-shadow)">
|
|
37
|
+
𝔾
|
|
38
|
+
</text>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<text x="10" y="190"
|
|
42
|
+
font-family="serif"
|
|
43
|
+
font-size="40"
|
|
44
|
+
font-weight="500"
|
|
45
|
+
fill="darkviolet"
|
|
46
|
+
stroke="indigo"
|
|
47
|
+
stroke-width="0.5"
|
|
48
|
+
filter="url(#text-shadow)">𝔾raphinate
|
|
49
|
+
</text>
|
|
50
|
+
</svg>
|
|
Binary file
|