Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

diagram-js

Package Overview
Dependencies
Maintainers
3
Versions
287
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diagram-js - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

2

lib/util/Elements.js

@@ -177,3 +177,3 @@ var _ = require('lodash');

y = bbox.y,
height = bbox.height || 0,
height = bbox.height || 0,
width = bbox.width || 0;

@@ -180,0 +180,0 @@

{
"name": "diagram-js",
"version": "0.8.0",
"version": "0.8.1",
"description": "A modeling framework for the web",

@@ -5,0 +5,0 @@ "scripts": {

@@ -90,7 +90,18 @@ 'use strict';

it('should show resize box', inject(function(lassoTool, canvas, dragging) {
beforeEach(inject(function(dragging) {
dragging.setOptions({ manual: true });
}));
var createEvent;
beforeEach(inject(function(canvas) {
createEvent = Events.scopedCreate(canvas);
}));
it('should show lasso box', inject(function(lassoTool, canvas, dragging) {
// when
lassoTool.activate(Events.create(canvas._svg, { x: 100, y: 100 }));
dragging.move(Events.create(canvas._svg, { x: 200, y: 300 }));
lassoTool.activate(createEvent({ x: 100, y: 100 }));
dragging.move(createEvent({ x: 200, y: 300 }));

@@ -101,4 +112,16 @@ // then

it('should select after lasso', inject(function(lassoTool, dragging, selection, elementRegistry) {
// when
lassoTool.activate(createEvent({ x: 100, y: 100 }));
dragging.move(createEvent({ x: 200, y: 300 }));
dragging.end();
// then
expect(selection.get()).toEqual([ elementRegistry.get('child') ]);
}));
});
});
'use strict';
var TestHelper = require('../../../TestHelper');
require('../../../TestHelper');

@@ -9,3 +9,2 @@ /* global bootstrapDiagram, inject */

var selectionModule = require('../../../../lib/features/selection');
var overlayModule = require('../../../../lib/features/overlays');

@@ -15,2 +14,4 @@

beforeEach(bootstrapDiagram({ modules: [ selectionModule ] }));
describe('bootstrap', function() {

@@ -25,2 +26,49 @@

});
ddescribe('selection box', function() {
var shape, shape2, connection;
beforeEach(inject(function(elementFactory, canvas) {
shape = elementFactory.createShape({
id: 'child',
x: 100, y: 100, width: 100, height: 100
});
canvas.addShape(shape);
shape2 = elementFactory.createShape({
id: 'child2',
x: 300, y: 100, width: 100, height: 100
});
canvas.addShape(shape2);
connection = elementFactory.createConnection({
id: 'connection',
waypoints: [ { x: 150, y: 150 }, { x: 150, y: 200 }, { x: 350, y: 150 } ],
source: shape,
target: shape2
});
canvas.addConnection(connection);
}));
it('should show box on select', inject(function(selection, canvas) {
// when
selection.select(connection);
// then
var gfx = canvas.getGraphics(connection),
outline = gfx.select('.djs-outline');
expect(outline).toBeDefined();
}));
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc