darabos commited on
Commit
4d72daa
·
1 Parent(s): a509341

"Image" node type to display an image.

Browse files
server/executors/one_by_one.py CHANGED
@@ -119,7 +119,7 @@ def execute(ws, catalog, cache=None):
119
  result = [result]
120
  results.extend(result)
121
  else: # Finished all tasks without errors.
122
- if op.type == 'visualization' or op.type == 'table_view':
123
  data.display = results[0]
124
  for edge in edges[node.id]:
125
  t = nodes[edge.target]
 
119
  result = [result]
120
  results.extend(result)
121
  else: # Finished all tasks without errors.
122
+ if op.type == 'visualization' or op.type == 'table_view' or op.type == 'image':
123
  data.display = results[0]
124
  for edge in edges[node.id]:
125
  t = nodes[edge.target]
server/lynxkite_ops.py CHANGED
@@ -128,7 +128,7 @@ def execute(ws):
128
  data.inputs = {f'input{i}': None for i in range(len(inputs) + 1)}
129
  data.error = None
130
  outputs[node.id] = output
131
- if op.type == 'visualization' or op.type == 'table_view':
132
  data.display = output
133
 
134
  @op("Import Parquet")
 
128
  data.inputs = {f'input{i}': None for i in range(len(inputs) + 1)}
129
  data.error = None
130
  outputs[node.id] = output
131
+ if op.type == 'visualization' or op.type == 'table_view' or op.type == 'image':
132
  data.display = output
133
 
134
  @op("Import Parquet")
web/src/LynxKiteFlow.svelte CHANGED
@@ -19,6 +19,7 @@
19
  import { useQuery, useMutation, useQueryClient } from '@sveltestack/svelte-query';
20
  import NodeWithParams from './NodeWithParams.svelte';
21
  import NodeWithVisualization from './NodeWithVisualization.svelte';
 
22
  import NodeWithTableView from './NodeWithTableView.svelte';
23
  import NodeWithSubFlow from './NodeWithSubFlow.svelte';
24
  import NodeWithArea from './NodeWithArea.svelte';
@@ -50,6 +51,7 @@
50
  const nodeTypes: NodeTypes = {
51
  basic: NodeWithParams,
52
  visualization: NodeWithVisualization,
 
53
  table_view: NodeWithTableView,
54
  sub_flow: NodeWithSubFlow,
55
  area: NodeWithArea,
 
19
  import { useQuery, useMutation, useQueryClient } from '@sveltestack/svelte-query';
20
  import NodeWithParams from './NodeWithParams.svelte';
21
  import NodeWithVisualization from './NodeWithVisualization.svelte';
22
+ import NodeWithImage from './NodeWithImage.svelte';
23
  import NodeWithTableView from './NodeWithTableView.svelte';
24
  import NodeWithSubFlow from './NodeWithSubFlow.svelte';
25
  import NodeWithArea from './NodeWithArea.svelte';
 
51
  const nodeTypes: NodeTypes = {
52
  basic: NodeWithParams,
53
  visualization: NodeWithVisualization,
54
+ image: NodeWithImage,
55
  table_view: NodeWithTableView,
56
  sub_flow: NodeWithSubFlow,
57
  area: NodeWithArea,
web/src/NodeWithImage.svelte ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script lang="ts">
2
+ import { type NodeProps } from '@xyflow/svelte';
3
+ import NodeWithParams from './NodeWithParams.svelte';
4
+ type $$Props = NodeProps;
5
+ export let data: $$Props['data'];
6
+ </script>
7
+
8
+ <NodeWithParams {...$$props}>
9
+ {#if data.display}
10
+ <img src={data.display}/>
11
+ {/if}
12
+ </NodeWithParams>
13
+ <style>
14
+ </style>