How to use the jsplumb.addToDragSelection function in jsplumb

To help you get started, we’ve selected a few jsplumb 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 GraphWalker / graphwalker-project / graphwalker-studio / src / main / webapp / scripts / tags / js / Studio.js View on Github external
self.on('updated', function () {
            var selection = self.opts.selection.mapBy('view.domId');
            jsp.clearDragSelection();
            jsp.addToDragSelection(selection);

            var scalingFactor = MINIMAP_SIZE / CANVAS_SIZE;
            $('.minimap-element').each(function (i, el) {
                var view = JSON.parse($(el).attr('data-view'));
                $(el).css({
                    top: view.top * scalingFactor,
                    left: view.left * scalingFactor,
                    width: Math.max(view.width * scalingFactor, 2),
                    height: Math.max(view.height * scalingFactor, 2)
                }).show();
            });
        });