╒═══╕
│x │
diff --git a/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap b/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap
index b0e94bbd504..ae872021f9f 100644
--- a/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap
+++ b/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap
@@ -14,7 +14,7 @@ exports[`CodeViews CodeStatusbar displays statusBarMessage 1`] = `
class="sc-jcFjpl cdUBmZ"
>
Started streaming 1 records after 5 ms and completed after 10 ms.
diff --git a/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap b/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap
index 96c747d53b3..0fb029bfe80 100644
--- a/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap
+++ b/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap
@@ -7,16 +7,16 @@ exports[`SchemaFrame renders empty 1`] = `
>
@@ -24,10 +24,10 @@ exports[`SchemaFrame renders empty 1`] = `
None
|
@@ -35,33 +35,33 @@ exports[`SchemaFrame renders empty 1`] = `
@@ -69,24 +69,24 @@ exports[`SchemaFrame renders empty 1`] = `
None
|
|
|
|
|
@@ -121,46 +121,46 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = `
>
@@ -168,62 +168,62 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = `
None
|
|
|
|
|
|
|
@@ -231,24 +231,24 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = `
None
|
|
|
|
|
@@ -283,16 +283,16 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
>
@@ -300,10 +300,10 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
ON :Movie(released) ONLINE
|
@@ -311,13 +311,13 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
@@ -325,10 +325,10 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
ON ( book:Book ) ASSERT book.isbn IS UNIQUE
|
@@ -365,46 +365,46 @@ exports[`SchemaFrame renders results for Neo4j >= 4.2 1`] = `
>
@@ -412,34 +412,34 @@ exports[`SchemaFrame renders results for Neo4j >= 4.2 1`] = `
|
node_label_property
|
|
|
|
[
"released"
]
|
ONLINE
|
@@ -447,33 +447,33 @@ exports[`SchemaFrame renders results for Neo4j >= 4.2 1`] = `
@@ -481,32 +481,32 @@ exports[`SchemaFrame renders results for Neo4j >= 4.2 1`] = `
constraint_550b2518
|
UNIQUE
|
node
|
[
"Movie"
]
|
[
"released"
diff --git a/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.tsx b/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.tsx
index 7a2455e3a66..0dba941a653 100644
--- a/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.tsx
+++ b/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.tsx
@@ -31,17 +31,31 @@ import {
import { ClipboardCopier } from '../ClipboardCopier'
import { ShowMoreOrAll } from '../ShowMoreOrAll/ShowMoreOrAll'
import { VizItemProperty } from 'neo4j-arc/common'
+import {
+ GraphInteractionCallBack,
+ NODE_PROP_UPDATE
+} from '../../../graph-visualization'
export const ELLIPSIS = '\u2026'
export const WIDE_VIEW_THRESHOLD = 900
export const MAX_LENGTH_NARROW = 150
export const MAX_LENGTH_WIDE = 300
type ExpandableValueProps = {
+ nodeId: string
+ propKey: string
value: string
width: number
type: string
+ onGraphInteraction: GraphInteractionCallBack
}
-function ExpandableValue({ value, width, type }: ExpandableValueProps) {
+function ExpandableValue({
+ nodeId,
+ propKey,
+ value,
+ width,
+ type,
+ onGraphInteraction
+}: ExpandableValueProps) {
const [expanded, setExpanded] = useState(false)
const maxLength =
@@ -56,7 +70,17 @@ function ExpandableValue({ value, width, type }: ExpandableValueProps) {
valueShown += valueIsTrimmed ? ELLIPSIS : ''
return (
- <>
+
+ onGraphInteraction(NODE_PROP_UPDATE, {
+ nodeId: nodeId,
+ propKey: propKey,
+ propVal: e.currentTarget.textContent
+ })
+ }
+ >
{type.startsWith('Array') && '['}
{valueIsTrimmed && (
@@ -65,7 +89,7 @@ function ExpandableValue({ value, width, type }: ExpandableValueProps) {
)}
{type.startsWith('Array') && ']'}
- >
+
)
}
@@ -75,14 +99,23 @@ type PropertiesViewProps = {
totalNumItems: number
moreStep: number
nodeInspectorWidth: number
+ onGraphInteraction?: GraphInteractionCallBack
}
export const PropertiesTable = ({
visibleProperties,
totalNumItems,
onMoreClick,
moreStep,
- nodeInspectorWidth
+ nodeInspectorWidth,
+ onGraphInteraction
}: PropertiesViewProps): JSX.Element => {
+ let id = ''
+ for (let i = 0; i < visibleProperties.length; i++) {
+ if (visibleProperties[i].key == '') {
+ id = visibleProperties[i].value
+ }
+ }
+
return (
<>
@@ -95,9 +128,12 @@ export const PropertiesTable = ({
undefined)}
/>
diff --git a/src/neo4j-arc/graph-visualization/GraphVisualizer/DefaultPanelContent/DefaultDetailsPane.tsx b/src/neo4j-arc/graph-visualization/GraphVisualizer/DefaultPanelContent/DefaultDetailsPane.tsx
index 0c8363018f5..a02a7c0cf86 100644
--- a/src/neo4j-arc/graph-visualization/GraphVisualizer/DefaultPanelContent/DefaultDetailsPane.tsx
+++ b/src/neo4j-arc/graph-visualization/GraphVisualizer/DefaultPanelContent/DefaultDetailsPane.tsx
@@ -26,17 +26,20 @@ import { PaneBody, PaneHeader, PaneTitle, PaneWrapper } from './styled'
import { NodeLabel } from './NodeLabel'
import { RelType } from './RelType'
import { GraphStyleModel } from '../../models/GraphStyle'
+import { GraphInteractionCallBack } from '../Graph/GraphEventHandlerModel'
export const DETAILS_PANE_STEP_SIZE = 1000
export type DetailsPaneProps = {
vizItem: NodeItem | RelationshipItem
graphStyle: GraphStyleModel
nodeInspectorWidth: number
+ onGraphInteraction?: GraphInteractionCallBack
}
export function DefaultDetailsPane({
vizItem,
graphStyle,
- nodeInspectorWidth
+ nodeInspectorWidth,
+ onGraphInteraction
}: DetailsPaneProps): JSX.Element {
const [maxPropertiesCount, setMaxPropertiesCount] = useState(
DETAILS_PANE_STEP_SIZE
@@ -99,6 +102,7 @@ export function DefaultDetailsPane({
moreStep={DETAILS_PANE_STEP_SIZE}
totalNumItems={allItemProperties.length}
nodeInspectorWidth={nodeInspectorWidth}
+ onGraphInteraction={onGraphInteraction}
/>
diff --git a/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts b/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts
index aa15f6afc54..d64aba685ef 100644
--- a/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts
+++ b/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts
@@ -31,6 +31,8 @@ import {
import { Visualization } from './visualization/Visualization'
export const NODE_ON_CANVAS_CREATE = 'NODE_ON_CANVAS_CREATE'
+export const NODE_PROP_UPDATE = 'NODE_PROP_UPDATE'
+export const NODE_LABEL_UPDATE = 'NODE_LABEL_UPDATE'
export type GraphInteraction =
| 'NODE_EXPAND'
@@ -38,6 +40,8 @@ export type GraphInteraction =
| 'NODE_DISMISSED'
| 'NODE_ON_CANVAS_CREATE'
| typeof NODE_ON_CANVAS_CREATE
+ | typeof NODE_PROP_UPDATE
+ | typeof NODE_LABEL_UPDATE
export type GraphInteractionCallBack = (
event: GraphInteraction,
@@ -239,8 +243,14 @@ export class GraphEventHandlerModel {
new NodeModel(
newId.toString(),
['Undefined'],
- { name: 'New Node' },
- { name: 'string' }
+ {
+ name: 'New Node',
+ description: 'New Node'
+ },
+ {
+ name: 'string',
+ description: 'string'
+ }
)
])
this.visualization.update({ updateNodes: true, updateRelationships: true })
@@ -249,6 +259,7 @@ export class GraphEventHandlerModel {
this.onGraphInteraction(NODE_ON_CANVAS_CREATE, {
id: newId,
name: 'New Node',
+ description: 'New Node',
labels: ['Undefined']
})
}
diff --git a/src/neo4j-arc/graph-visualization/GraphVisualizer/GraphVisualizer.tsx b/src/neo4j-arc/graph-visualization/GraphVisualizer/GraphVisualizer.tsx
index b67b1360344..87bc6c09ad6 100644
--- a/src/neo4j-arc/graph-visualization/GraphVisualizer/GraphVisualizer.tsx
+++ b/src/neo4j-arc/graph-visualization/GraphVisualizer/GraphVisualizer.tsx
@@ -297,6 +297,7 @@ export class GraphVisualizer extends Component<
}}
DetailsPaneOverride={this.props.DetailsPaneOverride}
OverviewPaneOverride={this.props.OverviewPaneOverride}
+ onGraphInteraction={this.props.onGraphInteraction}
/>
)
diff --git a/src/neo4j-arc/graph-visualization/GraphVisualizer/NodeInspectorPanel.tsx b/src/neo4j-arc/graph-visualization/GraphVisualizer/NodeInspectorPanel.tsx
index 734d813b09e..12d9572c1e7 100644
--- a/src/neo4j-arc/graph-visualization/GraphVisualizer/NodeInspectorPanel.tsx
+++ b/src/neo4j-arc/graph-visualization/GraphVisualizer/NodeInspectorPanel.tsx
@@ -38,6 +38,7 @@ import { Resizable } from 're-resizable'
import { GraphStats } from '../utils/mapper'
import { GraphStyleModel } from '../models/GraphStyle'
import { VizItem } from '../types'
+import { GraphInteractionCallBack } from './Graph/GraphEventHandlerModel'
interface NodeInspectorPanelProps {
expanded: boolean
@@ -51,6 +52,7 @@ interface NodeInspectorPanelProps {
width: number
DetailsPaneOverride?: React.FC
OverviewPaneOverride?: React.FC
+ onGraphInteraction?: GraphInteractionCallBack
}
export const defaultPanelWidth = (): number =>
@@ -68,7 +70,8 @@ export class NodeInspectorPanel extends Component {
toggleExpanded,
width,
DetailsPaneOverride,
- OverviewPaneOverride
+ OverviewPaneOverride,
+ onGraphInteraction
} = this.props
const relevantItems = ['node', 'relationship']
const hoveringNodeOrRelationship =
@@ -120,6 +123,7 @@ export class NodeInspectorPanel extends Component {
vizItem={shownEl}
graphStyle={graphStyle}
nodeInspectorWidth={width}
+ onGraphInteraction={onGraphInteraction}
/>
) : (
|