Git Product home page Git Product logo

react-gojs's Introduction

Join the chat at https://gitter.im/XComponent/xcomponent NuGet Twitter URL

XComponent Resource Center

XComponent is a platform to easily create, monitor and share microservices. In XComponent, a microservice is a set of components. Each component is based on state machines (States machines are designed graphically). This approach is powerful and flexible because it enables you to size or resize your microservices as you want.

Authentication component

Microservices are developed in C# (.NET 4.5.2 or above).

XComponent community edition provides the following tools :

  • For Windows only :
    • NuGet XCStudio : the IDE to design components and microservices
    • NuGet XCSpy : a test and monitoring tool for XComponent microservices
  • Multi platform tools :
    • NuGet XCBuild : the tool that generates and builds microservices designed with XCStudio
    • NuGet XCBridge : the WebSocket bridge to communicate with microservices through a WebSocket connection
    • NuGet XCRuntime : the execution environment for XComponent microservices
  • Online tools :
    • Website XCSpyWeb : the web version of XCSpy available online
  • Apis (to communicate with XComponent microservices through a reactive Api) :
    • npm Reactive XComponent JS Api : The Javascript Api that uses the XCBridge
    • NuGet Reactive XComponent .NET Api : The C# Api
    • github Reactive XComponent Python Api : The Python Api (Still under construction)

Note: "Microservice architectural style is an approach to develop a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms. These services are built around business capabilities and independently deployable by fully automated deployment machinery.” James Lewis & Martin Fowler

Building Microservices with XComponent

  • Define your Components according to a business logic or a technical logic

Note: In XComponent, a “Component” is a set of state machines (micro-orchestration)

  • Link the components (Composition) between them
  • Create the APIs
  • Create your Microservices as sets of Components
  • Deploy your microservices and run them with XCRuntime (under Windows or Mono)

With XComponent, your microservices have the following avantages:

  • They can communicate each other in Real-Time
  • You can communicate with your microservices in Real-Time using XComponent Apis
  • You can easily resize your microservices
  • You can migrate from a Monolith to a full microservices architecture without a line of code !
  • XComponent platform is fully asynchronous and it is running on the top of a RabbitMQ middleware. Nevertheless, the complexity of this kind of architecture is hidden to the developper
  • You can monitor in Real-Time the status of your microservices For a better understanding of XComponent, and for more details, we suggest to read the user guide or to jump to the Hello World sample.

Thanks to the Use Cases section, you will able to understand:

  • How to develop microservices with XCStudio
  • How to run them with XCRuntime
  • How to consume microservices with XComponent Apis

Prerequisite

Install

All samples will directly download XComponent Community Edition from Nuget. Nevertheless, if for some reasons, you need an MSI, you can get one in the releases page.

Documentation

User Guide

Use Cases

Click here to see XComponent examples.

It is a good starting point to understand how the XComponent platform works.

Test Framework

Click here to have details about the Test Framework.

Sequence Diagram Control

Click here to have details about the Sequence Diagram Control.

Questions ?

If you have any questions about this sample, please create a Github issue for us!

You can also join us on Slack!

react-gojs's People

Contributors

dljcollette avatar fredericcarre avatar julien-molina avatar maurelio1234 avatar sagaritrockz avatar sjoerd-otten-nl avatar soshimozi avatar victorwinberg avatar xcomponentadmin 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  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  avatar  avatar

react-gojs's Issues

ModelChangeEvent not being recognised on importing diagram from json file

I m importing diagram from a json file, after which ModelChangeEvent is not being recognised.

 // import data from json file 
    public importFromFile = () => {
        // Make a request for data from file
        axios.get('/file.json' )
            .then((response) => {
                const newModel = new go.GraphLinksModel(response.data.stages, response.data.links);
                const newDiagram = this.state.diagram;
                newDiagram.model = newModel;
                this.setState({
                    diagram: newDiagram
                });
            })
            .catch((error) => {
                console.log(error);
            });
    }

I cloned react / redux / react-gojs example.
Rest of the code works fine If i don’t upload diagram from file and just add a node the diagram it recognizes
ModelChangeEvent.

A lot API is missing :(

Event such as click a node, I didn't see it. I think just use GoJS would be fine; however, this repo show a good sample for using gojs.

Multiple links between two nodes not being rendered after init

I'm trying to add multiple links between two nodes after initialisation via:

<GojsDiagram model={myModel} linkKeyProperty="key" />

I do have linkKeyProperty="key" defined as described in #83. My model looks initially looks like this:

{
  nodeDataArray: [{type: "Company", key: "id1"}, {type: "Person", , key: "id2"}],
  linkDataArray: [{from: "id1", key: "id1-id2-worksAt", text: "WorksAt", to: "id2", type: "WorksAt"}]
}

After updating after initialisation, it looks like this:

{
  nodeDataArray: [{type: "Company", key: "id1"}, {type: "Person", , key: "id2"}],
  linkDataArray: [{from: "id1", key: "id1-id2-worksAt", to: "id2", type: "WorksAt"}, {from: "id1", key: "id1-id2-buysAt", to: "id2", type: "BuysAt"}]
}

I was expecting that the diagram would render the second node but it does only do that when it was already included on initial render.

It did find applyAddRemoveLinksFromModel in GojsDiagram.tsx is checking for el.from === e.from && el.to === e.to, which means that it will not return a second link added to the model which has the same from and to as and existing link. A possible fix could be checking for the unique identifier linkKeyProperty, like el.from === e.from && el.to === e.to && el[this.props.linkKeyProperty] === e[this.props.linkKeyProperty]. The array linksToAdd now includes an object representing a second link added after initialisation. However, it still doesn't render in the diagram after calling (this.myDiagram.model as GojsModel).addLinkDataCollection(linksToAdd); I can't look for a possible bug in the source of this file since it's minified.

Could you confirm that after (this.myDiagram.model as GojsModel).addLinkDataCollection(linksToAdd); the diagram should render the new link? What could be the reason that the second link is not being rendered?

Migrate from travis to circleci

We want to use the same CI on every project (open source and internally).
As we mainly use circleci, we want to migrate this project to circleci

modelChangedEvent Add triggered twice: on drag enter & drop

Hi! Awesome integration!

With a palette and a diagram where allowDrop is true, when the user drags a node from the palette onto the diagram, the add event is triggered twice. Once when the cursor enters the diagram and again on the drop.

function createDiagram(id) {
  const diagram = $(go.Diagram, id, {
    allowDrop: true, // permit accepting drag-and-drops
  })
 //...
}

Edit React GoJs

Add an onModelChange event

Add a callback to notify when the diagram model has changed internally.
This callback is very useful to keep your model (provided as prop) in sync with the diagram (especially in designer perspective)

How to access the created diagram object

I want to have buttons to control the zoom levels of my canvas.
I want to call mydiagram.commandHandler.increaseZoom() to achieve that. How can I access the diagram created in this case?

GojsDiagram does not render in a pure component

I copied the example project into a new one and put the GojsDiagram into a pure component.

const NormDiagram = ({ model, createDiagram, modelChangeHandler, ...props }) => {

  return <div className="row">
    <Global styles={ css`
      canvas {
        outline: none;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0); /* mobile webkit */
      }
      ` }
    />
    <div className="col-md-10 col-md-offset-1">
      <GojsDiagram
        css={ css`
          width: 70%;
          flex: 1 1 auto;
          margin: auto;
        ` }
        key="gojsDiagram"
        diagramId="myDiagramDiv"
        model={ model }
        createDiagram={ createDiagram }
        className="myDiagram"
        onModelChange={ modelChangeHandler }
      />
    </div>
  </div>
}

applyIncrementalJson cannot change Model properties

This error appears with GoJS 2.1.x due to an API change.
As we don't want to do significant developments in the repository, I will downgrade goJS to the latest 2.0.x version.
If you want to use the latest goJS version, just use the official gojs-react library.

Issue with setting additional model variables.

I am trying to set additional model state variables but for some reason the additional variables are not carried into the gojs canvas. the variables I'm trying to set are copiesArrays , copiesArrayObject, Below is where i'm trying to set the variables.

render() {
return [

];
}

Links doesn't get updated after model changes

I was playing with model binding properties to change the look and feeling about the nodes and edges and i realise that for nodes is working but it isn't for links.
Any idea why it isn't my links updating?

Check https://codesandbox.io/embed/kxq6zx47y7 a way to reproduce this issue. Just click into the button to generate a random look and feeling for all nodes and links.

Edit: added same example in vanilla gojs(https://codesandbox.io/embed/9opn15521w), but as you could see it is working. So something related with how model links get updates.
Edit2: after checking more in deep how this lib works i notice that maybe it could be a gojs problem, check following example(https://codesandbox.io/embed/5j9jwyo4k) into Diagram.js method refreshModel, i use applyIncrementalJson method and then you see that links somehow are not updated

modelData

It doesn't look like modelData is supported within the model object. Any chance this is a priority in the near future?

Fix npm ignore

Some techincal files should not be included in our npm package.
For example, .prettierrc, travis.yml etc...

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.