How to use the min-dash.map function in min-dash

To help you get started, we’ve selected a few min-dash 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 bpmn-io / diagram-js / lib / features / copy-paste / CopyPaste.js View on Github external
forEach(element.labels, function(label) {
          addElementData(label, depth);
        });

        addElementData(element, depth);
      });
    }

    forEach([ element.attachers, element.incoming, element.outgoing ], addRelatedElements);

    addElementData(element, depth);

    return element.children;
  });

  elements = map(elementsData, function(elementData) {
    return elementData.element;
  });

  // (2) copy elements
  elementsData = map(elementsData, function(elementData) {
    elementData.descriptor = {};

    self._eventBus.fire('copyPaste.copyElement', {
      descriptor: elementData.descriptor,
      element: elementData.element,
      elements: elements
    });

    return elementData;
  });
github bpmn-io / bpmn-js / test / spec / features / rules / Helper.js View on Github external
function get(elementId) {

  if (isArray(elementId)) {
    return map(elementId, get);
  }

  var element;

  if (isString(elementId)) {
    element = getBpmnJS().invoke(function(elementRegistry) {
      return elementRegistry.get(elementId);
    });

    if (!element) {
      throw new Error('element #' + elementId + ' not found');
    }

    return element;
  }
github bpmn-io / bpmn-js / test / spec / features / copy-paste / BpmnCopyPasteSpec.js View on Github external
function mapProperty(shapes, prop) {
  return map(shapes, function(shape) {
    return shape[prop];
  });
}
github zeebe-io / zeebe-modeler / app / lib / menu / menu-builder.js View on Github external
label: 'Keyboard Shortcuts',
        click: () => app.emit('menu:action', 'show-shortcuts')
      },
      getSeparatorTemplate(),
      {
        label: 'Search Feature Requests',
        click: () => browserOpen('https://github.com/camunda/camunda-modeler/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement')
      },
      {
        label: 'Report Issue',
        click: () => browserOpen('https://github.com/camunda/camunda-modeler/issues/new/choose')
      },
      getSeparatorTemplate()
    ];

    const providedMenus = map(this.options.providers, provider => provider.helpMenu)
      .filter(menu => Boolean(menu.length));

    const middlePart = providedMenus.reduce((helpMenus, current) => {
      return [
        ...helpMenus,
        ...current.map(mapHelpMenuTemplate),
        getSeparatorTemplate()
      ];
    }, []);

    const bottomPart = [
      {
        label: 'Version ' + app.version,
        enabled: false
      }
    ];
github bpmn-io / cmmn-js / lib / import / CmmnImporter.js View on Github external
function collectWaypoints(waypoints) {
  return map(waypoints, function(p) {
    return { x: p.x, y: p.y };
  });
}
github bpmn-io / diagram-js / lib / features / move / MovePreview.js View on Github external
function getAllDraggedElements(shapes) {
    var allShapes = selfAndAllChildren(shapes, true);

    var allConnections = map(allShapes, function(shape) {
      return (shape.incoming || []).concat(shape.outgoing || []);
    });

    return flatten(allShapes.concat(allConnections));
  }
github nikku / camunda-playground / packages / client / src / components / viewer / features / ProcessInstance.js View on Github external
_getActivities(processInstance, filterFn) {
    const elementRegistry = this._elementRegistry;

    const { trace } = processInstance;

    let activities = values(trace);

    if (isFunction(filterFn)) {
      activities = filter(activities, filterFn);
    }

    return map(activities, ({ activityId }) => elementRegistry.get(activityId));
  }
github bpmn-io / diagram-js / lib / features / copy-paste / CopyPaste.js View on Github external
forEach(elements, function(element) {
    if (isConnection(element)) {
      element.waypoints = map(element.waypoints, function(waypoint) {
        return {
          x: waypoint.x - bbox.x - bbox.width / 2,
          y: waypoint.y - bbox.y - bbox.height / 2
        };
      });
    }

    assign(element, {
      x: element.x - bbox.x - bbox.width / 2,
      y: element.y - bbox.y - bbox.height / 2
    });
  });