Skip to content

Commit 88d8d46

Browse files
committed
feat: initial implementation of solid-g6
1 parent 72c62bb commit 88d8d46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+14532
-297
lines changed

README.md

Lines changed: 846 additions & 52 deletions
Large diffs are not rendered by default.

bun.lock

Lines changed: 455 additions & 196 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "template-solidjs-library",
2+
"name": "@dschz/solid-g6",
33
"version": "0.0.0",
44
"license": "MIT",
55
"exports": "./src/index.tsx",

package.json

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "template-solidjs-library",
2+
"name": "@dschz/solid-g6",
33
"version": "0.0.0",
4-
"description": "Template for SolidJS library using tsup for bundling. Configured with Bun, NVM, TypeScript, ESLint, Prettier, Vitest, and GHA",
4+
"description": "A SolidJS component library for graph visualization, powered by @antv/g6",
55
"type": "module",
66
"author": "Daniel Sanchez <dsanc89@icloud.com>",
77
"license": "MIT",
8-
"homepage": "https://github.com/thedanchez/template-solidjs-library#readme",
8+
"homepage": "https://github.com/dsnchz/solid-g6#readme",
99
"repository": {
1010
"type": "git",
11-
"url": "https://github.com/thedanchez/template-solidjs-library.git"
11+
"url": "https://github.com/dsnchz/solid-g6.git"
1212
},
1313
"bugs": {
14-
"url": "https://github.com/thedanchez/template-solidjs-library/issues"
14+
"url": "https://github.com/dsnchz/solid-g6/issues"
1515
},
1616
"publishConfig": {
1717
"access": "public"
@@ -50,33 +50,38 @@
5050
"typecheck": "tsc --noEmit"
5151
},
5252
"devDependencies": {
53-
"@changesets/cli": "^2.29.3",
53+
"@antv/g6": "^5.0.48",
54+
"@changesets/cli": "^2.29.4",
55+
"@solid-primitives/resize-observer": "^2.1.1",
5456
"@solidjs/router": "^0.15.3",
5557
"@solidjs/testing-library": "^0.8.10",
56-
"@tailwindcss/vite": "^4.1.5",
58+
"@tailwindcss/vite": "^4.1.8",
59+
"@tanstack/solid-query": "^5.80.6",
5760
"@testing-library/jest-dom": "^6.6.3",
58-
"@types/bun": "^1.2.12",
59-
"@typescript-eslint/eslint-plugin": "^8.32.0",
60-
"@typescript-eslint/parser": "^8.32.0",
61-
"@vitest/coverage-istanbul": "^3.1.3",
62-
"eslint": "^9.26.0",
61+
"@types/bun": "^1.2.15",
62+
"@types/dagre": "^0.7.52",
63+
"@typescript-eslint/eslint-plugin": "^8.33.1",
64+
"@typescript-eslint/parser": "^8.33.1",
65+
"@vitest/coverage-istanbul": "^3.2.2",
66+
"eslint": "^9.28.0",
6367
"eslint-plugin-simple-import-sort": "^12.1.1",
6468
"eslint-plugin-solid": "^0.14.5",
65-
"globals": "^16.1.0",
69+
"globals": "^16.2.0",
6670
"jiti": "^2.4.2",
6771
"jsdom": "^26.1.0",
6872
"prettier": "^3.5.3",
69-
"solid-js": "^1.9.6",
70-
"tailwindcss": "^4.1.5",
71-
"tsup": "^8.4.0",
73+
"solid-js": "^1.9.7",
74+
"tailwindcss": "^4.1.8",
75+
"tsup": "^8.5.0",
7276
"tsup-preset-solid": "^2.2.0",
7377
"typescript": "^5.8.3",
74-
"typescript-eslint": "^8.32.0",
78+
"typescript-eslint": "^8.33.1",
7579
"vite": "^6.3.5",
7680
"vite-plugin-solid": "^2.11.6",
77-
"vitest": "^3.1.3"
81+
"vitest": "^3.2.2"
7882
},
7983
"peerDependencies": {
84+
"@antv/g6": ">=5.0.0",
8085
"solid-js": ">=1.6.0"
8186
}
8287
}

playground/App.tsx

Lines changed: 127 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,155 @@
11
import { Route, Router } from "@solidjs/router";
2-
import { ErrorBoundary, For, type JSX, type ParentProps } from "solid-js";
2+
import { QueryClient, QueryClientProvider } from "@tanstack/solid-query";
3+
import type { Component, ParentProps } from "solid-js";
4+
import { ErrorBoundary } from "solid-js";
35

46
import { Navbar } from "./Navbar";
7+
import { Behaviors } from "./pages/Behaviors";
8+
import { EdgeTypes } from "./pages/EdgeTypes";
59
import { ErrorPage } from "./pages/Error";
10+
import { GraphChildren } from "./pages/GraphChildren";
611
import { Home } from "./pages/Home";
12+
import { Layouts } from "./pages/Layouts";
13+
import { NodeTypes } from "./pages/NodeTypes";
714
import { NotFound } from "./pages/NotFound";
15+
import { Overview } from "./pages/Overview";
16+
import { States } from "./pages/States";
817

9-
type Page = {
10-
readonly path: string;
11-
readonly component: () => JSX.Element;
12-
};
18+
export interface Page {
19+
path: string;
20+
name: string;
21+
title: string;
22+
icon: string;
23+
component: Component;
24+
}
1325

14-
const PAGES: readonly Page[] = [
26+
// Simple page definitions - keeping it minimal
27+
export const PAGES: Page[] = [
1528
{
1629
path: "/",
30+
name: "Home",
31+
title: "Home",
32+
icon: "🏠",
1733
component: Home,
1834
},
35+
{
36+
path: "/overview",
37+
name: "Overview",
38+
title: "Overview",
39+
icon: "📖",
40+
component: Overview,
41+
},
42+
{
43+
path: "/node-types",
44+
name: "Node Types",
45+
title: "Node Types",
46+
icon: "🔷",
47+
component: NodeTypes,
48+
},
49+
{
50+
path: "/edge-types",
51+
name: "Edge Types",
52+
title: "Edge Types",
53+
icon: "🔗",
54+
component: EdgeTypes,
55+
},
56+
{
57+
path: "/states",
58+
name: "Element States",
59+
title: "States",
60+
icon: "⚡",
61+
component: States,
62+
},
63+
{
64+
path: "/graph-children",
65+
name: "Graph Children",
66+
title: "Graph Children",
67+
icon: "👶",
68+
component: GraphChildren,
69+
},
70+
{
71+
path: "/behaviors",
72+
name: "Behaviors",
73+
title: "Behaviors",
74+
icon: "🎯",
75+
component: Behaviors,
76+
},
77+
{
78+
path: "/layouts",
79+
name: "Layouts",
80+
title: "Layouts",
81+
icon: "🌐",
82+
component: Layouts,
83+
},
1984
{
2085
path: "*",
86+
name: "Not Found",
87+
title: "Not Found",
88+
icon: "❓",
2189
component: NotFound,
2290
},
2391
];
2492

25-
const MainContent = (props: ParentProps) => {
93+
// Simple navigation structure
94+
export const NAV_STRUCTURE = [
95+
{
96+
name: "Home",
97+
icon: "🏠",
98+
pages: PAGES.filter((p) => p.path === "/"),
99+
},
100+
{
101+
name: "Documentation",
102+
icon: "📖",
103+
pages: PAGES.filter((p) => p.path === "/overview"),
104+
},
105+
{
106+
name: "Examples",
107+
icon: "📚",
108+
pages: PAGES.filter((p) => p.path !== "/" && p.path !== "/overview" && p.path !== "*"),
109+
},
110+
];
111+
112+
// Create query client
113+
const queryClient = new QueryClient({
114+
defaultOptions: {
115+
queries: {
116+
staleTime: 1000 * 60 * 5, // 5 minutes
117+
retry: 1,
118+
},
119+
},
120+
});
121+
122+
// Root layout component that includes the responsive navigation
123+
const RootLayout = (props: ParentProps) => {
26124
return (
27-
<main class="flex flex-col h-full w-full grow overflow-auto bg-app-background">
28-
{props.children}
29-
</main>
125+
<div class="min-h-screen bg-gray-100">
126+
{/* Responsive Navigation */}
127+
<Navbar />
128+
129+
{/* Main content area - responsive margins */}
130+
<div class="pt-16 md:pt-0 md:ml-64">
131+
<main class="min-h-screen">{props.children}</main>
132+
</div>
133+
</div>
30134
);
31135
};
32136

33-
const RootLayout = (props: ParentProps) => (
34-
<div id="root-screen" class="h-screen w-screen">
35-
<Navbar />
36-
<MainContent>{props.children}</MainContent>
37-
</div>
38-
);
39-
40137
export const App = () => {
41138
return (
42139
<ErrorBoundary fallback={(e, r) => <ErrorPage error={e} reset={r} />}>
43-
<Router root={RootLayout}>
44-
<For each={PAGES}>{(page) => <Route path={page.path} component={page.component} />}</For>
45-
</Router>
140+
<QueryClientProvider client={queryClient}>
141+
<Router root={RootLayout}>
142+
<Route path="/" component={Home} />
143+
<Route path="/overview" component={Overview} />
144+
<Route path="/layouts" component={Layouts} />
145+
<Route path="/node-types" component={NodeTypes} />
146+
<Route path="/edge-types" component={EdgeTypes} />
147+
<Route path="/behaviors" component={Behaviors} />
148+
<Route path="/states" component={States} />
149+
<Route path="/graph-children" component={GraphChildren} />
150+
<Route path="*" component={NotFound} />
151+
</Router>
152+
</QueryClientProvider>
46153
</ErrorBoundary>
47154
);
48155
};

0 commit comments

Comments
 (0)