How to use the jointjs.shapes.standard function in jointjs

To help you get started, we’ve selected a few jointjs 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 ProcessMaker / modeler / src / mixins / resizeConfig.js View on Github external
configureResize() {
      this.shape.listenTo(this.paper, 'element:pointerup', cellView => {
        if (cellView.model.component && cellView.model.component === this) {
          /* Resize limits must be re-calculated if the the pool or lane is moved */
          this.calculateElementLimits();
        }
      });

      const pointBottomRight = new shapes.standard.EmbeddedImage();
      const pointBottomLeft = new shapes.standard.EmbeddedImage();
      const pointTopRight = new shapes.standard.EmbeddedImage();
      const pointTopLeft = new shapes.standard.EmbeddedImage();

      this.anchorPoints = [
        pointBottomRight,
        pointBottomLeft,
        pointTopRight,
        pointTopLeft,
      ];

      const { x, y, width, height } = this.shape.getBBox();

      this.anchorPoints.forEach(point => {
        point.set('isDrag', true);
        point.set('previousPosition', point.position());
github ProcessMaker / modeler / src / mixins / resizeConfig.js View on Github external
configureResize() {
      this.shape.listenTo(this.paper, 'element:pointerup', cellView => {
        if (cellView.model.component && cellView.model.component === this) {
          /* Resize limits must be re-calculated if the the pool or lane is moved */
          this.calculateElementLimits();
        }
      });

      const pointBottomRight = new shapes.standard.EmbeddedImage();
      const pointBottomLeft = new shapes.standard.EmbeddedImage();
      const pointTopRight = new shapes.standard.EmbeddedImage();
      const pointTopLeft = new shapes.standard.EmbeddedImage();

      this.anchorPoints = [
        pointBottomRight,
        pointBottomLeft,
        pointTopRight,
        pointTopLeft,
      ];

      const { x, y, width, height } = this.shape.getBBox();

      this.anchorPoints.forEach(point => {
        point.set('isDrag', true);
        point.set('previousPosition', point.position());
      });
github ProcessMaker / modeler / src / components / nodes / sequenceFlow / sequenceFlow.vue View on Github external
mounted() {
    this.shape = new shapes.standard.Link();
    this.shape.connector('rounded', { radius: 5 });
    this.createLabel();

    const conditionExpression = this.node.definition.conditionExpression;
    if (conditionExpression) {
      this.label = conditionExpression.body;
    }

    this.shape.addTo(this.graph);
    this.shape.component = this;
  },
};
github ProcessMaker / modeler / src / components / nodes / gateway / shape.js View on Github external
import { dia, shapes } from 'jointjs';

const iconSize = 18;

export default dia.Element.define('processmaker.components.nodes.gateway.Shape', {
  markup: [
    ...shapes.standard.Polygon.prototype.markup,
    { tagName: 'image', selector: 'image' },
  ],
  attrs: {
    body: {
      strokeWidth: 2,
      stroke: '#000000',
      refPointsKeepOffset: '40,0, 80,40, 40,80, 0,40',
      fill: '#FFFFFF',
    },
    label: {
      textVerticalAnchor: 'top',
      textAnchor: 'middle',
      refX: '50%',
      refY: '50',
      fontSize: 14,
      fill: '#333333',
github ProcessMaker / modeler / src / components / nodes / intermediateEvent / shape.js View on Github external
import { shapes, util } from 'jointjs';
import { markersMarkup, markersAttrs } from '@/mixins/hasMarkers';

export default shapes.standard.Circle.extend({

  markup: [{
    tagName: 'circle',
    selector: 'body',
  },{
    tagName: 'circle',
    selector: 'body2',
  }, {
    tagName: 'text',
    selector: 'label',
  }, {
    tagName: 'image',
    selector: 'image',
  },
  markersMarkup('topLeft'),
  markersMarkup('topCenter'),
github ProcessMaker / modeler / src / mixins / crownConfig.js View on Github external
this.crownConfig.forEach(({ id, title, icon, clickHandler }) => {
        const button = new shapes.standard.EmbeddedImage();
        this.buttons.push(button);

        button.set('onClick', clickHandler);
        button.set('elementMove', false);
        button.attr({
          root: {
            display: 'none',
            'data-test': id,
            'data-title': title || '',
          },
          body: {
            fill: 'none',
            stroke: 'none',
            opacity: 0.8,
            cursor: 'pointer',
          },
github ProcessMaker / modeler / src / components / nodes / startEvent / eventShape.js View on Github external
import { shapes, util } from 'jointjs';
import { markersMarkup, markersAttrs } from '@/mixins/hasMarkers';

export default shapes.standard.Circle.extend({

  markup: [{
    tagName: 'circle',
    selector: 'body',
  }, {
    tagName: 'text',
    selector: 'label',
  }, {
    tagName: 'image',
    selector: 'image',
  },
  markersMarkup('topLeft'),
  markersMarkup('topCenter'),
  markersMarkup('topRight'),
  markersMarkup('bottomLeft'),
  markersMarkup('bottomCenter'),
github ProcessMaker / modeler / src / components / nodes / boundaryEvent / shape.js View on Github external
import { shapes, util } from 'jointjs';

export default shapes.standard.Circle.extend({

  markup: [{
    tagName: 'circle',
    selector: 'body',
  },{
    tagName: 'circle',
    selector: 'body2',
  }, {
    tagName: 'text',
    selector: 'label',
  }, {
    tagName: 'image',
    selector: 'image',
  }],

  defaults: util.deepSupplement({
github ProcessMaker / modeler / src / components / nodes / association / association.vue View on Github external
mounted() {
    this.shape = new shapes.standard.Link({ router: { name: 'normal' } });
    this.shape.attr({
      line: {
        stroke: 'black',
        strokeWidth: '4',
        strokeLinecap: 'round',
        strokeDasharray: '1, 8',
        strokeDashoffset: '5',
        targetMarker: {
          'type': 'image',
          'xlink:href': associationHead,
          'width': 20,
          'height': 20,
          'y': -10,
        },
        sourceMarker: {
          'type': 'image',
github ProcessMaker / modeler / src / components / nodes / boundaryEvent / shape.js View on Github external
cy: 18,
        r: 15,
        strokeWidth: 0.85,
        stroke: '#212529',
        fill: '#FFF',
      },
      image: {
        refX: 5,
        refY: 5,
        ref: 'circle',
        width: 26,
        height: 26,
      },
    },

  }, shapes.standard.Circle.prototype.defaults),
});