northwoodssoftware / gojs-angular-basic Goto Github PK
View Code? Open in Web Editor NEWSimple project demonstrating usage of our GoJS/Angular components
License: Other
Simple project demonstrating usage of our GoJS/Angular components
License: Other
export class AppComponent {
@ViewChild('myDiagram', { static: true }) public myDiagramComponent: DiagramComponent;
public parentGrpColor = '#FFDD33';
public initDiagram(){
console.log(this.parentGrpColor);
When i try the above code to access variable or function it throws not defined error. I need to set the colors dynamically, and also need to retrieve data from service.
How can i get rid of that error am current getting running exactly codes as from from this repo?
It happens on this line "import * as go from 'gojs';" in app.component.ts and inspector.component.ts
E:\AngularProject\gojs-angular-basic>ng serve
No projects support the 'serve' target.
Error: No projects support the 'serve' target.
at ServeCommand.initialize (E:\AngularProject\gojs-angular-basic\node_modules@angular\cli\models\architect-command.js:50:19)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
I was trying to use the boilerplate to get better understanding of go-js in Angular
Post cloning the repo when I run 'npm install' for the repo to install its dependencies it produces the error
I am using Angular 9+ on my windows 10.
How can I resolve it?
Thanks a lot !!
I'm running the sample just fine. Now I have added a context menu on shape (taken from he tutorial : https://gojs.net/latest/samples/blockEditor.html)
So inside the InitDiagram function, I have added the following below code. The context menu shows up just fine and the clickfunction gets fired when clicking on a menu item. The model is updated with the new shape, however the UI is not updated. The shape remains a rectangle. I believe there is some extra steps to take because of Angular. What am I missing ?
` dia.nodeTemplate.contextMenu =
$("ContextMenu",
$("ContextMenuButton",
$(go.Panel, "Horizontal",
FigureButton("Rectangle"), FigureButton("RoundedRectangle"), FigureButton("Ellipse"), FigureButton("Diamond")
)
));
function FigureButton(fig, propname = 'figure') {
return $(go.Shape,
{
width: 32, height: 32, scale: 0.5, fill: "lightgray", figure: fig,
margin: 1, background: "transparent",
mouseEnter: (e, shape) => { shape.fill = "dodgerblue"; },
mouseLeave: (e, shape) => { shape.fill = "lightgray"; },
click: ClickFunction(propname, fig), contextClick: ClickFunction(propname, fig)
});
}
// PROPNAME is the name of the data property that should be set to the given VALUE.
function ClickFunction(propname, value) {
return (e, obj) => {
e.handled = true; // don't let the click bubble up
e.diagram.model.commit((m) => {
m.set(obj.part.adornedPart.data, propname, value);
});
};
`}``
we want to use gojs-debug for dev builds, when we try to pull it, we get an error that go
module is already exists/created
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.