darabos commited on
Commit
5eed07a
·
1 Parent(s): f34988f

Small fixes. The CSS import order caused connectors to be tiny.

Browse files
lynxkite-app/README.md CHANGED
@@ -12,8 +12,8 @@ original LynxKite. The primary goals of this rewrite are:
12
  To run the backend:
13
 
14
  ```bash
15
- PYTHONPATH=. uv run pydantic2ts --module server.workspace --output ./web/src/apiTypes.ts --json2ts-cmd "npm exec --prefix web json2ts"
16
- uv run fastapi run server/main.py --reload
17
  ```
18
 
19
  To run the frontend:
 
12
  To run the backend:
13
 
14
  ```bash
15
+ uv pip install -e .
16
+ LYNXKITE_RELOAD=1 lynxkite
17
  ```
18
 
19
  To run the frontend:
lynxkite-app/data/NetworkX demo CHANGED
The diff for this file is too large to render. See raw diff
 
lynxkite-app/uv.lock CHANGED
@@ -212,7 +212,7 @@ version = "0.1.0"
212
  source = { editable = "." }
213
  dependencies = [
214
  { name = "fastapi", extra = ["standard"] },
215
- { name = "lynxkite-ops" },
216
  { name = "orjson" },
217
  { name = "pycrdt-websocket" },
218
  { name = "pydantic-to-typescript" },
@@ -222,7 +222,7 @@ dependencies = [
222
  [package.metadata]
223
  requires-dist = [
224
  { name = "fastapi", extras = ["standard"], specifier = ">=0.115.6" },
225
- { name = "lynxkite-ops", virtual = "../lynxkite-ops" },
226
  { name = "orjson", specifier = ">=3.10.13" },
227
  { name = "pycrdt-websocket", specifier = ">=0.15.3" },
228
  { name = "pydantic-to-typescript", specifier = ">=2.0.0" },
@@ -230,9 +230,9 @@ requires-dist = [
230
  ]
231
 
232
  [[package]]
233
- name = "lynxkite-ops"
234
  version = "0.1.0"
235
- source = { virtual = "../lynxkite-ops" }
236
 
237
  [[package]]
238
  name = "markdown-it-py"
 
212
  source = { editable = "." }
213
  dependencies = [
214
  { name = "fastapi", extra = ["standard"] },
215
+ { name = "lynxkite-core" },
216
  { name = "orjson" },
217
  { name = "pycrdt-websocket" },
218
  { name = "pydantic-to-typescript" },
 
222
  [package.metadata]
223
  requires-dist = [
224
  { name = "fastapi", extras = ["standard"], specifier = ">=0.115.6" },
225
+ { name = "lynxkite-core", virtual = "../lynxkite-core" },
226
  { name = "orjson", specifier = ">=3.10.13" },
227
  { name = "pycrdt-websocket", specifier = ">=0.15.3" },
228
  { name = "pydantic-to-typescript", specifier = ">=2.0.0" },
 
230
  ]
231
 
232
  [[package]]
233
+ name = "lynxkite-core"
234
  version = "0.1.0"
235
+ source = { virtual = "../lynxkite-core" }
236
 
237
  [[package]]
238
  name = "markdown-it-py"
lynxkite-app/web/src/main.tsx CHANGED
@@ -1,5 +1,6 @@
1
  import { StrictMode } from 'react'
2
  import { createRoot } from 'react-dom/client'
 
3
  import './index.css'
4
  import Directory from './Directory.tsx'
5
  import Workspace from './workspace/Workspace.tsx'
 
1
  import { StrictMode } from 'react'
2
  import { createRoot } from 'react-dom/client'
3
+ import '@xyflow/react/dist/style.css';
4
  import './index.css'
5
  import Directory from './Directory.tsx'
6
  import Workspace from './workspace/Workspace.tsx'
lynxkite-app/web/src/workspace/Workspace.tsx CHANGED
@@ -65,7 +65,6 @@ function LynxKiteFlow() {
65
  if (!state.workspace) return;
66
  if (!state.workspace.nodes) return;
67
  if (!state.workspace.edges) return;
68
- console.log('update', JSON.parse(JSON.stringify(state.workspace)));
69
  setNodes([...state.workspace.nodes] as Node[]);
70
  setEdges([...state.workspace.edges] as Edge[]);
71
  for (const node of state.workspace.nodes) {
@@ -121,7 +120,6 @@ function LynxKiteFlow() {
121
  const wedges = state.workspace?.edges;
122
  if (!wedges) return;
123
  for (const ch of changes) {
124
- console.log('edge change', ch);
125
  const edgeIndex = wedges.findIndex((e) => e.id === ch.id);
126
  if (ch.type === 'remove') {
127
  wedges.splice(edgeIndex, 1);
@@ -195,7 +193,6 @@ function LynxKiteFlow() {
195
  target: connection.target,
196
  targetHandle: connection.targetHandle!,
197
  };
198
- console.log(JSON.stringify(edge));
199
  state.workspace.edges!.push(edge);
200
  setEdges((oldEdges) => [...oldEdges, edge]);
201
  }, [state, setEdges]);
 
65
  if (!state.workspace) return;
66
  if (!state.workspace.nodes) return;
67
  if (!state.workspace.edges) return;
 
68
  setNodes([...state.workspace.nodes] as Node[]);
69
  setEdges([...state.workspace.edges] as Edge[]);
70
  for (const node of state.workspace.nodes) {
 
120
  const wedges = state.workspace?.edges;
121
  if (!wedges) return;
122
  for (const ch of changes) {
 
123
  const edgeIndex = wedges.findIndex((e) => e.id === ch.id);
124
  if (ch.type === 'remove') {
125
  wedges.splice(edgeIndex, 1);
 
193
  target: connection.target,
194
  targetHandle: connection.targetHandle!,
195
  };
 
196
  state.workspace.edges!.push(edge);
197
  setEdges((oldEdges) => [...oldEdges, edge]);
198
  }, [state, setEdges]);
lynxkite-app/web/src/workspace/nodes/NodeWithVisualization.tsx CHANGED
@@ -8,7 +8,6 @@ const NodeWithVisualization = (props: any) => {
8
  useEffect(() => {
9
  const opts = props.data?.display?.value;
10
  if (!opts || !chartsRef.current) return;
11
- console.log(chartsRef.current);
12
  chartsInstanceRef.current = echarts.init(chartsRef.current, null, { renderer: 'canvas', width: 250, height: 250 });
13
  chartsInstanceRef.current.setOption(opts);
14
  const onResize = () => chartsInstanceRef.current?.resize();
@@ -20,7 +19,7 @@ const NodeWithVisualization = (props: any) => {
20
  }, [props.data?.display?.value]);
21
  return (
22
  <NodeWithParams {...props}>
23
- <div className="box" draggable={false} ref={chartsRef} />;
24
  </NodeWithParams>
25
  );
26
  };
 
8
  useEffect(() => {
9
  const opts = props.data?.display?.value;
10
  if (!opts || !chartsRef.current) return;
 
11
  chartsInstanceRef.current = echarts.init(chartsRef.current, null, { renderer: 'canvas', width: 250, height: 250 });
12
  chartsInstanceRef.current.setOption(opts);
13
  const onResize = () => chartsInstanceRef.current?.resize();
 
19
  }, [props.data?.display?.value]);
20
  return (
21
  <NodeWithParams {...props}>
22
+ <div className="box" draggable={false} ref={chartsRef} />
23
  </NodeWithParams>
24
  );
25
  };
lynxkite-graph-analytics/src/lynxkite_plugins/graph_analytics/lynxkite_ops.py CHANGED
@@ -12,7 +12,8 @@ import polars as pl
12
  import traceback
13
  import typing
14
 
15
- op = ops.op_registration("LynxKite Graph Analytics")
 
16
 
17
 
18
  @dataclasses.dataclass
@@ -112,9 +113,9 @@ def disambiguate_edges(ws):
112
  seen.add((edge.target, edge.targetHandle))
113
 
114
 
115
- @ops.register_executor("LynxKite")
116
  async def execute(ws):
117
- catalog = ops.CATALOGS["LynxKite"]
118
  disambiguate_edges(ws)
119
  outputs = {}
120
  failed = 0
 
12
  import traceback
13
  import typing
14
 
15
+ ENV = "LynxKite Graph Analytics"
16
+ op = ops.op_registration(ENV)
17
 
18
 
19
  @dataclasses.dataclass
 
113
  seen.add((edge.target, edge.targetHandle))
114
 
115
 
116
+ @ops.register_executor(ENV)
117
  async def execute(ws):
118
+ catalog = ops.CATALOGS[ENV]
119
  disambiguate_edges(ws)
120
  outputs = {}
121
  failed = 0
lynxkite-graph-analytics/src/lynxkite_plugins/graph_analytics/networkx_ops.py CHANGED
@@ -5,6 +5,8 @@ import functools
5
  import inspect
6
  import networkx as nx
7
 
 
 
8
 
9
  def wrapped(name: str, func):
10
  @functools.wraps(func)
@@ -24,7 +26,7 @@ def wrapped(name: str, func):
24
 
25
 
26
  def register_networkx(env: str):
27
- ops.CATALOGS.setdefault(env, {})
28
  for name, func in nx.__dict__.items():
29
  if hasattr(func, "graphs"):
30
  sig = inspect.signature(func)
@@ -54,7 +56,7 @@ def register_networkx(env: str):
54
  outputs={"output": ops.Output(name="output", type=nx.Graph)},
55
  type="basic",
56
  )
57
- ops.CATALOGS[env][name] = op
58
 
59
 
60
- register_networkx("LynxKite")
 
5
  import inspect
6
  import networkx as nx
7
 
8
+ ENV = "LynxKite Graph Analytics"
9
+
10
 
11
  def wrapped(name: str, func):
12
  @functools.wraps(func)
 
26
 
27
 
28
  def register_networkx(env: str):
29
+ cat = ops.CATALOGS.setdefault(env, {})
30
  for name, func in nx.__dict__.items():
31
  if hasattr(func, "graphs"):
32
  sig = inspect.signature(func)
 
56
  outputs={"output": ops.Output(name="output", type=nx.Graph)},
57
  type="basic",
58
  )
59
+ cat[name] = op
60
 
61
 
62
+ register_networkx(ENV)