Skip to content

Commit a82d141

Browse files
committed
some improvements to the Palette. Readme updated.
1 parent 92f6a69 commit a82d141

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
This project provides a basic example of using GoJS in an Angular app.
66
Check out the [Intro page on using GoJS with Angular](https://gojs.net/latest/intro/angular.html) for more information.
77

8-
It makes use of the [gojs-angular](https://github.com/NorthwoodsSoftware/gojs-angular) package to handle some boilerplate for setting up Diagram, Palette and Overview components.
8+
It makes use of the [gojs-angular](https://github.com/NorthwoodsSoftware/gojs-angular) package to handle setting up Diagram, Palette and Overview components.
99

10-
When running the sample, try moving around nodes, adding / deleting nodes, editing text in the inspector, relinking, undoing (Ctrl-Z), re-doing (Ctrl-Y), etc. within the diagram and you'll notice the changes are reflected in app-level data. You'll also notice that changes
11-
made in the inspector are reflected in the diagram.
10+
When running the sample, try moving / adding / deleting nodes, editing text in the inspector, relinking nodes via ports, undoing (Ctrl-Z), and re-doing (Ctrl-Y) within the diagram. You'll notice the changes are reflected in app-level data. You'll also notice that changes
11+
made in the inspector are reflected in the diagram.
1212

1313
## Installation
1414

@@ -35,5 +35,5 @@ The page will reload if you make edits.<br>
3535

3636
## Learn More
3737

38-
To learn Angular, check out the [Angular's official site](https://angular.io/).
38+
To learn Angular, check out [Angular's official site](https://angular.io/).
3939
To learn GoJS, check out [gojs.net](https://gojs.net).

src/app/app.component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body {
1414
.myPaletteDiv {
1515
background: lightcyan;
1616
border: 1px solid navy;
17-
width: 200px;
17+
width: 125px;
1818
height: 300px;
1919
}
2020

src/app/app.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class AppComponent {
118118
new go.Binding('fill', 'color')
119119
),
120120
$(go.TextBlock, { margin: 8 },
121-
new go.Binding('text', 'key'))
121+
new go.Binding('text'))
122122
);
123123

124124
palette.model = $(go.GraphLinksModel,
@@ -129,8 +129,8 @@ export class AppComponent {
129129
return palette;
130130
}
131131
public paletteNodeData: Array<go.ObjectData> = [
132-
{ key: 'PaletteNode1', color: 'firebrick' },
133-
{ key: 'PaletteNode2', color: 'blueviolet' }
132+
{ key: 'PaletteNode1', text: "PaletteNode1", color: 'red' },
133+
{ key: 'PaletteNode2', text: "PaletteNode2", color: 'yellow' }
134134
];
135135
public paletteLinkData: Array<go.ObjectData> = [
136136
{ }
@@ -201,7 +201,12 @@ export class AppComponent {
201201
// here, we set skipsDiagramUpdate to false, since GoJS does not yet have this update
202202
this.skipsDiagramUpdate = false;
203203
this.diagramNodeData[index] = _.cloneDeep(newNodeData);
204+
// this.diagramNodeData[index] = _.cloneDeep(newNodeData);
204205
}
206+
207+
// var nd = this.observedDiagram.model.findNodeDataForKey(newNodeData.key);
208+
// console.log(nd);
209+
205210
}
206211

207212

0 commit comments

Comments
 (0)