Skip to content

Commit

Permalink
Release v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kumilingus authored Oct 23, 2017
1 parent 55d8e38 commit 38edad2
Show file tree
Hide file tree
Showing 35 changed files with 1,662 additions and 760 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
23-10-2017 (v2.0.0)
* Typescript definitions refactored (breaking change of the release)
* JointJS now compatible with Lodash v4 (see `demo/lodash4` for instructions)
* Geometry - add Polyline with pointAtLength(), length(), closesPointLength(), closestPoint() and convexHull()
* Geometry - add cross(), dot(), squaredDistance(), closestPoint(), closestPointNormalizedLength(), vector(), vectorAngle(), angleBetween() to Point
* Vectorizer - add children() and getBBox()
* Vectorizer - fix parseTransformString() and matrixToTransformString()
* Vectorizer - make the text `y` coordinate based on the first line `line-height` in text()
* Vectorizer - add option to define the end-of-line character for text()
* layout.DirectedLayout - add ability to position labels
* layout.DirectedLayout - fix bug when the elements passed do not include their parents
* dia.Paper - add `clickThreshold`, `moveThreshold` and `preventDefaultBlankAction` options
* dia.Paper - add cancelRenderViews() for async mode
* dia.CellView - do not reset node's transform attribute if no transform applied update()
* dia.Element - position() can be called with { deep: true } option to set position of the embeds
* dia.attributes - `text` attribute takes `x` into account
* dia.attributes - add `event` for easier events handling on CellViews and `resetOffset` for paths to start at 0,0
* dia.LinkView - stop triggering link:connect/link:disconnnect when connection not allowed
* dia.LinkView - can sendToken() backwards
* highlighters.Stroke - fix for magnets inside scalable group and with zero width or height

31-03-2017 (v1.1.0)
* add TypeScript definitions
* update jQuery v3.1.1
Expand Down
2 changes: 1 addition & 1 deletion dist/geometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JointJS v1.2.0-beta (2017-10-19) - JavaScript diagramming library
/*! JointJS v2.0.0 (2017-10-23) - JavaScript diagramming library
This Source Code Form is subject to the terms of the Mozilla Public
Expand Down
2 changes: 1 addition & 1 deletion dist/geometry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/joint.core.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 71 additions & 19 deletions dist/joint.core.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JointJS v1.2.0-beta (2017-10-19) - JavaScript diagramming library
/*! JointJS v2.0.0 (2017-10-23) - JavaScript diagramming library


This Source Code Form is subject to the terms of the Mozilla Public
Expand Down Expand Up @@ -3847,7 +3847,7 @@ V = Vectorizer = (function() {

var joint = {

version: '1.2.0-beta',
version: '2.0.0',

config: {
// The class name prefix config is for advanced use only.
Expand Down Expand Up @@ -6089,7 +6089,7 @@ joint.dia.Graph = Backbone.Model.extend({

var commonAncestor = joint.util.toArray(cellsAncestors.shift()).find(function(ancestor) {
return cellsAncestors.every(function(cellAncestors) {
return cellAncestors.includes(ancestor)
return cellAncestors.includes(ancestor);
});
});

Expand Down Expand Up @@ -6448,18 +6448,18 @@ joint.dia.Graph = Backbone.Model.extend({
},

// Disconnect links connected to the cell `model`.
disconnectLinks: function(model, options) {
disconnectLinks: function(model, opt) {

this.getConnectedLinks(model).forEach(function(link) {

link.set(link.get('source').id === model.id ? 'source' : 'target', { x: 0, y: 0 }, options);
link.set(link.get('source').id === model.id ? 'source' : 'target', { x: 0, y: 0 }, opt);
});
},

// Remove links connected to the cell `model` completely.
removeLinks: function(model, options) {
removeLinks: function(model, opt) {

joint.util.invoke(this.getConnectedLinks(model), 'remove', options);
joint.util.invoke(this.getConnectedLinks(model), 'remove', opt);
},

// Find all elements at given point
Expand Down Expand Up @@ -6489,7 +6489,7 @@ joint.dia.Graph = Backbone.Model.extend({
opt = joint.util.defaults(opt || {}, { searchBy: 'bbox' });

var bbox = element.getBBox();
var elements = (opt.searchBy == 'bbox')
var elements = (opt.searchBy === 'bbox')
? this.findModelsInArea(bbox)
: this.findModelsFromPoint(bbox[opt.searchBy]());

Expand Down Expand Up @@ -6528,6 +6528,8 @@ joint.dia.Graph = Backbone.Model.extend({
});

joint.util.invoke(cells, 'translate', dx, dy, opt);

return this;
},

resize: function(width, height, opt) {
Expand Down Expand Up @@ -6567,7 +6569,7 @@ joint.dia.Graph = Backbone.Model.extend({

hasActiveBatch: function(name) {
if (name) {
return this._batches[name];
return !!this._batches[name];
} else {
return joint.util.toArray(this._batches).some(function(batches) {
return batches > 0;
Expand Down Expand Up @@ -6660,10 +6662,58 @@ joint.util.wrapWith(joint.dia.Graph.prototype, ['resetCells', 'addCells', 'remov
set: 'xlink:show'
},

xlinkRole: {
set: 'xlink:role'
},

xlinkType: {
set: 'xlink:type'
},

xlinkArcrole: {
set: 'xlink:arcrole'
},

xlinkTitle: {
set: 'xlink:title'
},

xlinkActuate: {
set: 'xlink:actuate'
},

xmlSpace: {
set: 'xml:space'
},

xmlBase: {
set: 'xml:base'
},

xmlLang: {
set: 'xml:lang'
},

preserveAspectRatio: {
set: 'preserveAspectRatio'
},

requiredExtension: {
set: 'requiredExtension'
},

requiredFeatures: {
set: 'requiredFeatures'
},

systemLanguage: {
set: 'systemLanguage'
},

externalResourcesRequired: {
set: 'externalResourceRequired'
},

filter: {
qualify: util.isPlainObject,
set: function(filter) {
Expand Down Expand Up @@ -9273,13 +9323,13 @@ joint.dia.Link = joint.dia.Cell.extend({
return connectionAncestor || null;
},

// Is source, target and the link itself embedded in a given element?
isRelationshipEmbeddedIn: function(element) {
// Is source, target and the link itself embedded in a given cell?
isRelationshipEmbeddedIn: function(cell) {

var elementId = joint.util.isString(element) ? element : element.id;
var cellId = (joint.util.isString(cell) || joint.util.isNumber(cell)) ? cell : cell.id;
var ancestor = this.getRelationshipAncestor();

return !!ancestor && (ancestor.id === elementId || ancestor.isEmbeddedIn(elementId));
return !!ancestor && (ancestor.id === cellId || ancestor.isEmbeddedIn(cellId));
}
},
{
Expand Down Expand Up @@ -10392,10 +10442,10 @@ joint.dia.LinkView = joint.dia.CellView.extend({

} else if (paperOptions.linkConnectionPoint) {

var view = end === 'target' ? this.targetView : this.sourceView;
var magnet = end === 'target' ? this.targetMagnet : this.sourceMagnet;
var view = (end === 'target') ? this.targetView : this.sourceView;
var magnet = (end === 'target') ? this.targetMagnet : this.sourceMagnet;

spot = paperOptions.linkConnectionPoint(this, view, magnet, reference);
spot = paperOptions.linkConnectionPoint(this, view, magnet, reference, end);

} else {

Expand Down Expand Up @@ -10520,7 +10570,7 @@ joint.dia.LinkView = joint.dia.CellView.extend({
if (availableMagnets.length > 0) {
// highlight all available magnets
for (var j = 0, m = availableMagnets.length; j < m; j++) {
view.highlight(availableMagnets[j], { magnetAvailability: true })
view.highlight(availableMagnets[j], { magnetAvailability: true });
}
// highlight the entire view
view.highlight(null, { elementAvailability: true });
Expand All @@ -10543,7 +10593,7 @@ joint.dia.LinkView = joint.dia.CellView.extend({
var view = this.paper.findViewByModel(id);
if (view) {
for (var j = 0, m = markedMagnets.length; j < m; j++) {
view.unhighlight(markedMagnets[j], { magnetAvailability: true })
view.unhighlight(markedMagnets[j], { magnetAvailability: true });
}
view.unhighlight(null, { elementAvailability: true });
}
Expand Down Expand Up @@ -11235,6 +11285,8 @@ joint.dia.Paper = joint.mvc.View.extend({
if (this._background) {
this.updateBackgroundImage(this._background);
}

return this;
},

// For storing the current transformation matrix (CTM) of the paper's viewport.
Expand Down Expand Up @@ -12494,7 +12546,7 @@ joint.dia.Paper = joint.mvc.View.extend({
options.height = gridSize * (ctm.d || 1) * (options.scaleFactor || 1);

if (!refs.exist(id)) {
refs.add(id, V('pattern', { id: id, patternUnits: 'userSpaceOnUse' }, V(options.markup)))
refs.add(id, V('pattern', { id: id, patternUnits: 'userSpaceOnUse' }, V(options.markup)));
}

var patternDefVel = refs.get(id);
Expand Down
2 changes: 1 addition & 1 deletion dist/joint.core.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions dist/joint.core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/joint.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 38edad2

Please sign in to comment.