How to use the @projectstorm/react-diagrams.AbstractNodeFactory function in @projectstorm/react-diagrams

To help you get started, we’ve selected a few @projectstorm/react-diagrams examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magma / magma / symphony / app / fbcnms-projects / hub / app / components / workflow / pages / diagramBuilder / NodeModels / DecisionNode / DecisionNodeFactory.js View on Github external
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 * @format
 */
import * as React from 'react';
import * as SRD from '@projectstorm/react-diagrams';
import {DecisionNode} from './DecisionNode';
import {DecisionNodeModel} from './DecisionNodeModel';

export class DecisionNodeFactory extends SRD.AbstractNodeFactory {
  constructor() {
    super('decision');
  }

  generateReactWidget(
    diagramEngine: SRD.DiagramEngine,
    node: SRD.NodeModel,
  ): JSX.Element {
    return ;
  }

  getNewInstance() {
    return new DecisionNodeModel();
  }
}
github magma / magma / symphony / app / fbcnms-projects / hub / app / components / workflow / pages / diagramBuilder / NodeModels / EndNode / CircleEndNodeFactory.js View on Github external
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 * @format
 */
import * as React from 'react';
import * as SRD from '@projectstorm/react-diagrams';
import {CircleEndNodeModel} from './CircleEndNodeModel';
import {CircleNodeEnd} from './CircleNodeEnd';

export class CircleEndNodeFactory extends SRD.AbstractNodeFactory {
  constructor() {
    super('end');
  }

  generateReactWidget(
    diagramEngine: SRD.DiagramEngine,
    node: SRD.NodeModel,
  ): JSX.Element {
    return ;
  }

  getNewInstance() {
    return new CircleEndNodeModel();
  }
}
github magma / magma / symphony / app / fbcnms-projects / hub / app / components / workflow / pages / diagramBuilder / NodeModels / ForkNode / ForkNodeFactory.js View on Github external
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 * @format
 */
import * as React from 'react';
import * as SRD from '@projectstorm/react-diagrams';
import {ForkNode} from './ForkNode';
import {ForkNodeModel} from './ForkNodeModel';

export class ForkNodeFactory extends SRD.AbstractNodeFactory {
  constructor() {
    super('fork');
  }

  generateReactWidget(
    diagramEngine: SRD.DiagramEngine,
    node: SRD.NodeModel,
  ): JSX.Element {
    return ;
  }

  getNewInstance() {
    return new ForkNodeModel();
  }
}
github magma / magma / symphony / app / fbcnms-projects / hub / app / components / workflow / pages / diagramBuilder / NodeModels / JoinNode / JoinNodeFactory.js View on Github external
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 * @format
 */
import * as React from 'react';
import * as SRD from '@projectstorm/react-diagrams';
import {JoinNode} from './JoinNode';
import {JoinNodeModel} from './JoinNodeModel';

export class JoinNodeFactory extends SRD.AbstractNodeFactory {
  constructor() {
    super('join');
  }

  generateReactWidget(
    diagramEngine: SRD.DiagramEngine,
    node: SRD.NodeModel,
  ): JSX.Element {
    return ;
  }

  getNewInstance() {
    return new JoinNodeModel();
  }
}
github magma / magma / symphony / app / fbcnms-projects / hub / app / components / workflow / pages / diagramBuilder / NodeModels / StartNode / CircleStartNodeFactory.js View on Github external
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 * @format
 */
import * as React from 'react';
import * as SRD from '@projectstorm/react-diagrams';
import {CircleNodeStart} from './CircleNodeStart';
import {CircleStartNodeModel} from './CircleStartNodeModel';

export class CircleStartNodeFactory extends SRD.AbstractNodeFactory {
  constructor() {
    super('start');
  }

  generateReactWidget(
    diagramEngine: SRD.DiagramEngine,
    node: SRD.NodeModel,
  ): JSX.Element {
    return ;
  }

  getNewInstance() {
    return new CircleStartNodeModel();
  }
}