Code Monkey home page Code Monkey logo

gojs-angular-basic's People

Contributors

dependabot[bot] avatar rjohnson465 avatar simonsarris avatar walternorthwoods avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gojs-angular-basic's Issues

Access this variable inside diagram init

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.

Cannot find module 'gojs'.

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

ng serve cannot run the project

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)

`npm install` giving ''Unexpected end of JSON input''

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 !!

using context menu with angular component

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);
    });
  };
`}``

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.