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

biojs-vis-pinpad

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biojs-vis-pinpad - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

99

build/PinpadViewer.js

@@ -14,3 +14,2 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

category.title = catTitle;
category.index = pinPad.categories.length;
category.open = true;

@@ -35,5 +34,3 @@ category.data = [];

.on('click', function() {
categoryContainer.remove();
category.pinPad.categories.splice(category.index, 1);
category.pinPad.dispatcher.remove({category: category.title});
category.remove();
});

@@ -43,2 +40,19 @@

category.remove = function() {
while (category.elements.length !== 0) {
category.elements[0].remove(category.data[0].id, category.title, false);
}
};
category.removeDom = function() {
var index = _.findIndex(category.pinPad.categories, function(cat) {
return cat.title === category.title;
});
if (index !== -1) {
categoryContainer.remove();
category.pinPad.categories.splice(index, 1);
category.pinPad.dispatcher.remove({category: category.title});
}
};
category.toggle = function() {

@@ -57,6 +71,6 @@ if (category.padContainer.style('display') === 'none') {

category.addElement = function(id, sections) {
var elem = {sortAttribute: sections[0].title, id: id, sections: sections};
var sortedIndex = _.sortedIndex(category.data, elem, 'sortAttribute');
elem.sortedIndex = sortedIndex;
category.data.splice(sortedIndex, 0, elem);
var datum = {sortAttribute: sections[0].title, id: id, sections: sections};
var sortedIndex = _.sortedIndex(category.data, datum, 'sortAttribute');
datum.sortedIndex = sortedIndex;
category.data.splice(sortedIndex, 0, datum);
return sortedIndex;

@@ -68,3 +82,3 @@ };

if (sortedIndex === (category.data.length-1)) {
newElem = ElementFactory.createElement(category, category.data[category.data.length-1]);
newElem = ElementFactory.createElement(category, category.data[category.data.length-1]);
category.elements.push(newElem);

@@ -90,5 +104,16 @@ } else {

},
removeCategory: function(category) {
category.remove();
},
createElement: function(category, id, sections) {
var sortedIndex = category.addElement(id, sections);
return category.displayElements(sortedIndex);
},
removeElement: function(category, elId) {
var index = _.findIndex(category.data, function(datum){
return datum.id === elId;
});
if (index !== -1) {
ElementFactory.removeElement(category.elements[index], category.title);
}
}

@@ -165,3 +190,3 @@ };

} else {
tr.append('td').text(key.replace('_', ' '));
tr.append('td').text(key.replace(/_/g, ' '));
addValue(tr.append('td'), info);

@@ -197,3 +222,3 @@ }

var elemContainer = element.category.padContainer.append('div');
var elemContainer = element.category.padContainer.append('div').attr('id', 'pinned_elem_id_' + elem.id);
element.first(element.category.title, elemContainer, _.first(element.content.sections));

@@ -222,8 +247,3 @@ element.tail(element.table, _.tail(element.content.sections));

.on('click', function() {
container.remove();
element.category.elements.splice(element.sortedIndex, 1);
element.category.data.splice(element.sortedIndex, 1);
element.category.pinPad.dispatcher.remove({element: {
category: catTitle, id: element.content.id, sections: element.content.sections}
});
element.remove(element.content.id, catTitle);
});

@@ -247,6 +267,23 @@

Element.prototype.remove = function(id, catTitle) {
var element = this;
var container = d3.select('#' + 'pinned_elem_id_' + id);
container.remove();
element.category.elements.splice(element.sortedIndex, 1);
element.category.data.splice(element.sortedIndex, 1);
element.category.pinPad.dispatcher.remove({element: {
category: catTitle, id: element.content.id, sections: element.content.sections}
});
if (element.category.elements.length === 0) {
element.category.removeDom();
}
};
var ElementFactory = function () {
return {
createElement: function(category, element) {
return new Element(category, element);
createElement: function(category, elem) {
return new Element(category, elem);
},
removeElement: function(element, catTitle) {
element.remove(element.content.id, catTitle);
}

@@ -367,2 +404,24 @@ };

PinpadViewer.prototype.removeElement = function(id) {
var pinPad = this;
var category = _.find(pinPad.categories, function(cat) {
return _.some(cat.data, function(datum) {
return datum.id === id;
});
});
if (category) {
CategoryFactory.removeElement(category, id);
}
};
PinpadViewer.prototype.removeCategory = function(catTitle) {
var pinPad = this;
var category = _.find(pinPad.categories, function(cat) {
return cat.title === catTitle;
});
if (category) {
CategoryFactory.removeCategory(category);
}
};
/**

@@ -382,2 +441,2 @@ * Method responsible to say Hello

},{"./CategoryFactory":1,"d3":"d3","underscore":"underscore"}]},{},["biojs-vis-pinpad"])
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlc1xcYnJvd3NlcmlmeVxcbm9kZV9tb2R1bGVzXFxicm93c2VyLXBhY2tcXF9wcmVsdWRlLmpzIiwibGliXFxDYXRlZ29yeUZhY3RvcnkuanMiLCJsaWJcXEVsZW1lbnRGYWN0b3J5LmpzIiwibGliXFxQaW5wYWRWaWV3ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUNBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Q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HJcbiAgICB9O1xyXG59KCk7XHJcblxyXG5tb2R1bGUuZXhwb3J0cyA9IENhdGVnb3J5RmFjdG9yeTsiLCIvKmpzbGludCBub2RlOiB0cnVlICovXHJcbi8qanNoaW50IGxheGJyZWFrOiB0cnVlICovXHJcblwidXNlIHN0cmljdFwiO1xyXG5cclxudmFyIGQzID0gcmVxdWlyZSgnZDMnKTtcclxudmFyIF8gPSByZXF1aXJlKCd1bmRlcnNjb3JlJyk7XHJcblxyXG52YXIgaXNMaW5rID0gZnVuY3Rpb24oaW5mbykge1xyXG4gICAgaWYgKCh0eXBlb2YgaW5mbyA9PT0gJ29iamVjdCcpICYmICEoaW5mbyBpbnN0YW5jZW9mIEFycmF5KSkge1xyXG4gICAgICAgIHZhciBrZXlzID0gXy5rZXlzKGluZm8pO1xyXG4gICAgICAgIGlmICgoa2V5cy5sZW5ndGggPT09IDIpICYmIF8uY29udGFpbnMoa2V5cywgJ3ZhbHVlJykgJiYgXy5jb250YWlucyhrZXlzLCAnbGluaycpKSB7XHJcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiBmYWxzZVxyXG59O1xyXG5cclxudmFyIGFkZExpbmsgPSBmdW5jdGlvbihjb250YWluZXIsIGluZm9UZXh0LCBpbmZvTGluaykge1xyXG4gICAgaWYgKGluZm9MaW5rICYmIChpbmZvTGluayAhPT0gJy0nKSkge1xyXG4gICAgICAgIGNvbnRhaW5lci5hcHBlbmQoJ2EnKVxyXG4gICAgICAgICAgICAuYXR0cignaHJlZicsIGluZm9MaW5rKVxyXG4gICAgICAgICAgICAuYXR0cigndGFyZ2V0JywgJ19ibGFuaycpXHJcbiAgICAgICAgICAgIC50ZXh0KGluZm9UZXh0KTtcclxuICAgIH0gZWxzZSB7XHJcbiAgICAgICAgY29udGFpbmVyLnRleHQoaW5mb1RleHQpO1xyXG4gICAgfVxyXG59O1xyXG5cclxudmFyIGFkZFZhbHVlID0gZnVuY3Rpb24oY29udGFpbmVyLCBpbmZvKSB7XHJcbiAgICBpZiAoKHR5cGVvZiBpbmZvID09PSAnc3RyaW5nJykgfHwgKHR5cGVvZiBpbmZvID09PSAnbnVtYmVyJykgfHwgKHR5cGVvZiBpbmZvID09PSAnYm9vbGVhbicpKSB7XHJcbiAgICAgICAgY29udGFpbmVyLnRleHQoaW5mbyk7XHJcbiAgICB9IGVsc2UgaWYgKGlzTGluayhpbmZvKSkge1xyXG4gICAgICAgIGFkZExpbmsoY29udGFpbmVyLCBpbmZvLnZhbHVlLCBpbmZvLmxpbmspO1xyXG4gICAgfSBlbHNlIGlmIChpbmZvIGluc3RhbmNlb2YgQXJyYXkpIHtcclxuICAgICAgICBfLmVhY2goaW5mbywgZnVuY3Rpb24oZGF0dW0sIGluZGV4KSB7XHJcbiAgICAgICAgICAgIHZhciBzcGFuID0gY29udGFpbmVyLmFwcGVuZCgnc3BhbicpO1xyXG4gICAgICAgICAgICBhZGRWYWx1ZShzcGFuLCBkYXR1bSk7XHJcbiAgICAgICAgICAgIGlmIChpbmRleCAhPT0gKGluZm8ubGVuZ3RoLTEpKSB7XHJcbiAgICAgICAgICAgICAgICBjb250YWluZXIuYXBwZW5kKCdzcGFuJykudGV4dCgnLCAnKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfSBlbHNlIHtcclxuICAgICAgICBhZGREYXRhKGNvbnRhaW5lci5hcHBlbmQoJ3RhYmxlJyksIGluZm8pO1xyXG4gICAgfVxyXG59O1xyXG5cclxudmFyIGFkZERhdHVtID0gZnVuY3Rpb24odGFibGUsIGtleSwgaW5mbykge1xyXG4gICAgdmFyIHRyID0gdGFibGUuYXBwZW5kKCd0cicpO1xyXG4gICAgaWYgKGtleS5pbmRleE9mKCdzdHlsZWRfJykgPT09IDApIHtcclxuICAgICAgICB2YXIgbGVmdENvbCA9IHRyLmFwcGVuZCgndGQnKS50ZXh0KGluZm8ua2V5KTtcclxuICAgICAgICBpZi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RlZ29yeSwgZWxlbSkge1xyXG4gICAgdmFyIGVsZW1lbnQgPSB0aGlzO1xyXG4gICAgZWxlbWVudC5jYXRlZ29yeSA9IGNhdGVnb3J5O1xyXG4gICAgZWxlbWVudC5jb250ZW50ID0gZWxlbTtcclxuICAgIGVsZW1lbnQuaGVhZGVyID0gdW5kZWZpbmVkO1xyXG4gICAgZWxlbWVudC50YWJsZUNvbnRhaW5lciA9IHVuZGVmaW5lZDtcclxuICAgIGVsZW1lbnQudGFibGUgPSB1bmRlZmluZWQ7XHJcblxyXG4gICAgZWxlbWVudC50b2dnbGUgPSBmdW5jdGlvbigpIHtcclxuICAgICAgICBpZiAoZWxlbWVudC50YWJsZUNvbnRhaW5lci5zdHlsZSgnZGlzcGxheScpID09PSAnbm9uZScpIHtcclxuICAgICAgICAgICAgZWxlbWVudC50YWJsZUNvbnRhaW5lci5zdHlsZSgnZGlzcGxheScsICdibG9jaycpO1xyXG4gICAgICAgICAgICBlbGVtZW50LmhlYWRlci50aXRsZS5hdHRyKCdjbGFzcycsICd1cF9wcF9lbGVtZW50LW5hbWUgdXBfcGZ0dl9hcnJvdy1kb3duJyk7XHJcbiAgICAgICAgICAgIGVsZW1lbnQuY29udGVudC5vcGVuID0gdHJ1ZTtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICBlbGVtZW50LnRhYmxlQ29udGFpbmVyLnN0eWxlKCdkaXNwbGF5JywgJ25vbmUnKTtcclxuICAgICAgICAgICAgZWxlbWVudC5oZWFkZXIudGl0bGUuYXR0cignY2xhc3MnLCAndXBfcHBfZWxlbWVudC1uYW1lIHVwX3BmdHZfYXJyb3ctcmlnaHQnKTtcclxuICAgICAgICAgICAgZWxlbWVudC5jb250ZW50Lm9wZW4gPSBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICB9O1xyXG5cclxuICAgIHZhciBlbGVtQ29udGFpbmVyID0gZWxlbWVudC5jYXRlZ29yeS5wYWRDb250YWluZXIuYXBwZW5kKCdka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JcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcmV0dXJuIGZhbHNlXHJcbn07XHJcblxyXG52YXIgYWRkTGluayA9IGZ1bmN0aW9uKGNvbnRhaW5lciwgaW5mb1RleHQsIGluZm9MaW5rKSB7XHJcbiAgICBpZiAoaW5mb0xpbmsgJiYgKGluZm9MaW5rICE9PSAnLScpKSB7XHJcbiAgICAgICAgY29udGFpbmVyLmFwcGVuZCgnYScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdocmVmJywgaW5mb0xpbmspXHJcbiAgICAgICAgICAgIC5hdHRyKCd0YXJnZXQnLCAnX2JsYW5rJylcclxuICAgICAgICAgICAgLnRleHQoaW5mb1RleHQpO1xyXG4gICAgfSBlbHNlIHtcclxuICAgICAgICBjb250YWluZXIudGV4dChpbmZvVGV4dCk7XHJcbiAgICB9XHJcbn07XHJcblxyXG52YXIgYWRkVmFsdWUgPSBmdW5jdGlvbihjb250YWluZXIsIGluZm8pIHtcclxuICAgIGlmICgodHlwZW9mIGluZm8gPT09ICdzdHJpbmcnKSB8fCAodHlwZW9mIGluZm8gPT09ICdudW1iZXInKSB8fCAodHlwZW9mIGluZm8gPT09ICdib29sZWFuJykpIHtcclxuICAgICAgICBjb250YWluZXIudGV4dChpbmZvKTtcclxuICAgIH0gZWxzZSBpZiAoaXNMaW5rKGluZm8pKSB7XHJcbiAgICAgICAgYWRkTGluayhjb250YWluZXIsIGluZm8udmFsdWUsIGluZm8ubGluayk7XHJcbiAgICB9IGVsc2UgaWYgKGluZm8gaW5zdGFuY2VvZiBBcnJheSkge1xyXG4gICAgICAgIF8uZWFjaChpbmZvLCBmdW5jdGlvbihkYXR1bSwgaW5kZXgpIHtcclxuICAgICAgICAgICAgdmFyIHNwYW4gPSBjb250YWluZXIuYXBwZW5kKCdzcGFuJyk7XHJcbiAgICAgICAgICAgIGFkZFZhbHVlKHNwYW4sIGRhdHVtKTtcclxuICAgICAgICAgICAgaWYgKGluZGV4ICE9PSAoaW5mby5sZ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KVxyXG4gICAgICAgICAgICAudGV4dChpbmZvLnRpdGxlKTtcclxuICAgICAgICBhZGREYXRhKHRhYmxlLCBpbmZvLmluZm9ybWF0aW9uKTtcclxuICAgIH0gZWxzZSB7XHJcbiAgICAgICAgdHIuYXBwZW5kKCd0ZCcpLnRleHQoa2V5LnJlcGxhY2UoL18vZywgJyAnKSk7XHJcbiAgICAgICAgYWRkVmFsdWUodHIuYXBwZW5kKCd0ZCcpLCBpbmZvKTtcclxuICAgIH1cclxufTtcclxuXHJcbnZhciBhZGREYXRhID0gZnVuY3Rpb24odGFibGUsIGRhdGEpIHtcclxuICAgIF8uZWFjaChkYXRhLCBmdW5jdGlvbihpbmZvLCBrZXkpIHtcclxuICAgICAgICBhZGREYXR1bSh0YWJsZSwga2V5LCBpbmZvKTtcclxuICAgIH0pO1xyXG59O1xyXG5cclxudmFyIEVsZW1lbnQgPSBmdW5jdGlvbihjYXRlZ29yeSwgZWxlbSkge1xyXG4gICAgdmFyIGVsZW1lbnQgPSB0aGlzO1xyXG4gICAgZWxlbWVudC5jYXRlZ29yeSA9IGNhdGVnb3J5O1xyXG4gICAgZWxlbWVudC5jb250ZW50ID0gZWxlbTtcclxuICAgIGVsZW1lbnQuaGVhZGVyID0gdW5kZWZpbmVkO1xyXG4gICAgZWxlbWVudC50YWJsZUNvbnRhaW5lciA9IHVuZGVmaW5lZDtcclxuICAgIGVsZW1lbnQudGFibGUgPSB1bmRlZmluZWQ7XHJcblxyXG4gICAgZWxlbWVudC50b2dnbGUgPSBmdW5jdGlvbigpIHtcclxuICAgICAgICBpZiAoZWxlbWVudC50YWJsZUNvbnRhaW5lci5zdHlsZSgnZGlzcGxheScpID09PSAnbm9uZScpIHtcclxuICAgICAgICAgICAgZWxlbWVudC50YWJsZUNvbnRhaW5lci5zdHlsZSgnZGlzcGxheScsICdibG9jaycpO1xyXG4gICAgICAgICAgICBlbGVtZW50LmhlYWRlci50aXRsZS5hdHRyKCdjbGFzcycsICd1cF9wcF9lbGVt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clxuICAgIHJldHVybiAnaGVsbG8gJyArIG5hbWU7XHJcbn07XHJcblxyXG5tb2R1bGUuZXhwb3J0cyA9IFBpbnBhZFZpZXdlcjsiXX0=

@@ -1,14 +0,14 @@

� �Y_o��*6����V��E�,�{h���=�=�AK��[�T):�������(ٱ��S_b����8����y�=��%'<2TR� Z�G����A<�O�>=3=)2�II��׊��D�lg3���=�lVĚ�����N1�k���r�3�_&��V:"�LJe&[!�ɓ*%��@n� ���+���eR'�*xF�����|Z������Ͽ���кA~y��gG��R���iV����1�YYFy�>Q�M�[ef ���q�DU���)���~'���G�G���4Av�=��"[���YRr�3�����U���Mt\���xx|$��Oj�En��$�"��GS�=Ȃ�:W��8�*���o�J�ĥ���F�W �Yȶ3�^�+�TB�Ɗ�S�aJ��� ���8���҂�Nt��*.���
fX��O�=���Uk�8�Xq��aBr��
6 �x&q����9��uU��a����@2�szf��ߒ���ov�u��>�Kˍ�13ɞ�׶�y� �_�z����o&2qf��"�J�`��`N�ە<��@
l]1y�����'�yd[*f@8-v{�" 1V`^Us�57�����Ed���O�-�u���z�i�� �
v�ȅ]T��L�����bꂫi��Ļ�
��K[�f��D*�!�!so>�d� w�eJ6������>]����V�?}�����%T5���pe�L-Pٱ���N����:j���H9���Q���b����?1�� PEɀ�+[H�iW7| i��
J
�L���q�6ٳ�d�9s�o˭�N��]d2�䚃��H�#F��qP���P�!��� Hr��
�+�g�,�,�{�;Yխ�� �BCg9E� ��",rP�4�7�̴Z[��>�����
���+��B�q�i{
C�<>vJ��i"hԾf���Ӷ�����;��Tv��������6���V ��F|"dm��q���5�Œ����݈]n�7���l�׈j0 yf��/�BB�p�g�pXa�lF]U����)�?Ӏ��o йW��c�_oJ�����r�4�����^��;��� ����F�������m��ϝ��Ī ��g��C޹40}X���>jx+)А�io��r6ӵ�:!�#i�� v0T��ތfO��u��:ֶ��$��k{9Y���K� D�;f3�|c_�W����!'�m ������kLE��R���`,�a�J�[�Hj�)TimHoOZ��ݺg�" ��-�1[[����!V�s�1P �0@�"k� ��Q�K�M�(FO#���“ѯ����X}���s�����kP�h ׃�Khb��,��L�_!
� .
��X\����=��cզQ� �<��Ƙ�[����v��z��1Qzm�ֽ�%�����Y��W��2
k_{��Ć�e.CUo�����������H��`�����s 1!��d��@�"m�1/ѽ}wq���%Ƣaօ�(z`�N��iZ����(�<A6&7<g�Q�=�w�X��`�v�F5*h��'�kp|�ͷ�{�<�4 �)��b�r�ґ��s���̭[�;¤9`���l����?�zq��w�QG��%����ƃ�~#��u]JnZT��sL����h_�ĕ{U*����\�!��!k{%T�*k�2���ȋO]��Oo[=W���Z�C�_��~^s��L}y���!���� ��Ђ��m��UA������am}3ZB�4E\��O ��Z�kW�`Ũ߄���`��� �w�m=Ɠ�e����S�&(찌 &58�3A]���/��+#k�hX�m�Ch����c��$5'!_�Q������C���d8�a#T���u��td�CFT^�'���Z0��d� � �����7^��f[ �z'� �f���"��p_�G{�o4�ѭO��iA8�kG���~3NB1�*�Å�P"� ������f�)J��ݕ ��X}�.:�aծ2=�y@�b��Y@�*�D� �>��{�kU���<{�����K� ˿� ��i?��(��Z�A �ԭ�P�]ry��{�=M�p]�ԎL_ %��N=�̀=/Ku&m��0!7��}�+��˸������Ї����l�r�H
� �Y[o�6�+�J ��S�E^!d����>L���`$:fG!��L���sx�(ٹt�i_b�"���w����۽,�Pr�C%e�Q��Mz��L^��d��ӳ� a*)
��p��i'v>�k\���U���k9�@��2�qƴC�e!����J'�I��l+d5�Wվ�ȹ8'?�tmvZ=�ʬT/ȿ?}��_7�}������} ��P^[��Łm�6m~�5�p���JV�I��O4X�pg�,����5�Y{UU"/e�ӎ�tXɩ�]�g��c�KP�~���(�k���\ޙ�Z���*a��^�.9���A[�<=�}�g�Ѣ4�z� OH�I)��e�u[*�I�RU�P��c��4���(�u��ݰ�Zf������TfF���o�.��%<Ṵ��������Yg ���4LH�3���
t$�ʚ�-��}�i�M� ��e�Ol��l��R�u��nӰ�пI �0c ��4B��$��3ۚ� �,}\T�Q�2ÿ�Ĥ��� *=����]͓���۶ ����jd|֚'�A��b���ngP�#�,�f��F�v7������y^o���C�;ߛ�����"��c�<+�!mB��V�W�%�*d"=[AE��}�f /X�(�+T�פ�F��������}��n��K׋�
���1􄸬m���h}�ڔ;�/>'����,�D*ɉ�eTC>#Pt͠�/��'Pr[+��Ǵ �_�ٚ�����wv�gU���������������`���U�i��67` �p6��*JF2����B{( )��*@VTһ�c���c�%��2Hv�g���X�.S���<��$�oy=�{�F`�5�vu"N0�4��,$?B�y�2��]��וQ��'a���U�)��^��(�������.�qg��ɼ
�1g8a�$h;�
����_t�j>=>݉ɣ<B>�ǘOc��~�S"����82FQ��L9��l$�X(o������P������\�/h�S�T�4 �)AwC/�D)��"�#�`�"Q�B^ \��,�3![�d�#�fOi�}�}�O-�Frx�����,����V�a��p-$��'�gKO��V�,󦁇ɂ��/�������<�j���x�nnk����>�ᩣ�xzN� ��o߈����a>�U��,"���k�s)Pbf͆_�3�͑#/�+X3��%���m��D���� �^����<� �3՜���� }�ȣ�U�lA�ٚ��.m`V�'H{HT�=ٰ�
�K� �~�+0�.6�b5|K=�K��ցa�������ItJ;^CL����Cc���Dk�����^�#�� ��;o��m
���t�pb�)��
�&��w�ww�̐�7���I��� ^�[c`��y�'��
��6���3d4h������K�g,�$�yy�_"?o_�>��zM����4H�X C��ؼ�t�mt$UB%�y�^a�l�n1-{y�8%>y%�JSZQ�\�zr�Ȉ̘ϣ�i �E+�ݖϠ�MJrϼܟ���!����᫹2.�g�-7����Id�e�>�ЛqgŤ�'A ����)�~�ف«���!ү�%�V�2�y������z._F��
�{x�݌��h:�'�K�xtt=!;*X8�Tܖ�;e�2�X\��ύ{���=�����5�e�89���:H����c����=⡯~��8Mԣ��u���-��1GT�*�:�&�B��.D���M�w�p{����jO[<9��y�|%t�r��ҽ�[�#W�V:'w�sIƴ60�> 9 � �(0�#����=���R/@���A���{ �Q�g,�pG�������!<n� a����ۖ�Ϫ�䕪�*�C���>���DX4�S{��p��b{̍�шQ� iy���N�N|�=NM�
��u;@G�X6���.��2�Di^��=B sHJ@5<�laaG�A��aXxTгX.�(6`�*RJ�8�p�l|ɐXt�k����;��9��غc3Ҫ{���7�����&2�^�P8l�$�I��c��ȇ��-e�����W�2�5'�Q�m�b
^��כ�.)�r2,ƫ�XM�]tƛPT2܌�����4���rxx�G@z�,~�&z�d�n
=���T�td`���M`Wӂ�|�e��-��kL�j����U/͗�-+��i� @h:��3�f�V���@j���/�Ϗ��'D��b`�) ׍���� X0�tZ"!;�L�8���0:�/�7fڛ����}| &�Jt|���F�0֠Os��ĺV'���3�b�@�n�gr�z�ZVv���%ܤ��)���

@@ -1,1 +0,1 @@

require=function e(t,n,a){function o(i,p){if(!n[i]){if(!t[i]){var d="function"==typeof require&&require;if(!p&&d)return d(i,!0);if(r)return r(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[i]={exports:{}};t[i][0].call(c.exports,function(e){var n=t[i][1][e];return o(n?n:e)},c,c.exports,e,t,n,a)}return n[i].exports}for(var r="function"==typeof require&&require,i=0;i<a.length;i++)o(a[i]);return o}({1:[function(e,t,n){"use strict";var a=(e("d3"),e("underscore")),o=e("./ElementFactory"),r=function(e,t){var n=this;n.pinPad=e,n.title=t,n.index=e.categories.length,n.open=!0,n.data=[],n.elements=[];var r=n.pinPad.padContainer.append("div").classed("up_pp_category-container",!0);n.header=r.append("div").classed("up_pp_category-header",!0),n.header.title=n.header.append("a").attr("class","up_pp_category-name up_pftv_arrow-down").text(t).on("click",function(){n.toggle()}),n.header.append("span").classed("up_pp_iconContainer",!0).style("float","right").append("div").attr("class","up-pp-icon-trash up_pp_clickable-icon").on("click",function(){r.remove(),n.pinPad.categories.splice(n.index,1),n.pinPad.dispatcher.remove({category:n.title})}),n.padContainer=r.append("div").classed("up_pp_category-pad",!0),n.toggle=function(){"none"===n.padContainer.style("display")?(n.padContainer.style("display","block"),n.header.title.attr("class","up_pp_category-name up_pftv_arrow-down"),n.open=!0):(n.padContainer.style("display","none"),n.header.title.attr("class","up_pp_category-name up_pftv_arrow-right"),n.open=!1)},n.addElement=function(e,t){var o={sortAttribute:t[0].title,id:e,sections:t},r=a.sortedIndex(n.data,o,"sortAttribute");return o.sortedIndex=r,n.data.splice(r,0,o),r},n.displayElements=function(e){var t=void 0;return e===n.data.length-1?(t=o.createElement(n,n.data[n.data.length-1]),n.elements.push(t)):(n.padContainer.selectAll("*").remove(),a.each(n.data,function(a,r){var i=o.createElement(n,a);r===e&&(t=i)}),n.elements.splice(e,0,t)),t}},i=function(){return{createCategory:function(e,t){return new r(e,t)},createElement:function(e,t,n){var a=e.addElement(t,n);return e.displayElements(a)}}}();t.exports=i},{"./ElementFactory":2,d3:"d3",underscore:"underscore"}],2:[function(e,t,n){"use strict";var a=(e("d3"),e("underscore")),o=function(e){if("object"==typeof e&&!(e instanceof Array)){var t=a.keys(e);if(2===t.length&&a.contains(t,"value")&&a.contains(t,"link"))return!0}return!1},r=function(e,t,n){n&&"-"!==n?e.append("a").attr("href",n).attr("target","_blank").text(t):e.text(t)},i=function(e,t){"string"==typeof t||"number"==typeof t||"boolean"==typeof t?e.text(t):o(t)?r(e,t.value,t.link):t instanceof Array?a.each(t,function(n,a){var o=e.append("span");i(o,n),a!==t.length-1&&e.append("span").text(", ")}):d(e.append("table"),t)},p=function(e,t,n){var a=e.append("tr");if(0===t.indexOf("styled_")){var o=a.append("td").text(n.key);n.key_style&&o.attr("style",n.key_style);var r=a.append("td");n.value_style&&r.attr("style",n.value_style),i(r,n.value)}else 0===t.indexOf("subsection_")?(a.append("td").attr("colspan",2).classed("up_pp_table_subsection",!0).text(n.title),d(e,n.information)):(a.append("td").text(t.replace("_"," ")),i(a.append("td"),n))},d=function(e,t){a.each(t,function(t,n){p(e,n,t)})},s=function(e,t){var n=this;n.category=e,n.content=t,n.header=void 0,n.tableContainer=void 0,n.table=void 0,n.toggle=function(){"none"===n.tableContainer.style("display")?(n.tableContainer.style("display","block"),n.header.title.attr("class","up_pp_element-name up_pftv_arrow-down"),n.content.open=!0):(n.tableContainer.style("display","none"),n.header.title.attr("class","up_pp_element-name up_pftv_arrow-right"),n.content.open=!1)};var o=n.category.padContainer.append("div");n.first(n.category.title,o,a.first(n.content.sections)),n.tail(n.table,a.tail(n.content.sections)),n.content.open===!1&&n.toggle()};s.prototype.first=function(e,t,n){var a=this;a.header=t.append("div").classed("up_pp_element-header",!0),a.header.title=a.header.append("a").attr("class","up_pp_element-name up_pftv_arrow-down").text(n.title).on("click",function(){a.toggle()}),a.header.append("span").classed("up_pp_iconContainer",!0).style("float","right").append("div").attr("class","up-pp-icon-trash up_pp_clickable-icon").on("click",function(){t.remove(),a.category.elements.splice(a.sortedIndex,1),a.category.data.splice(a.sortedIndex,1),a.category.pinPad.dispatcher.remove({element:{category:e,id:a.content.id,sections:a.content.sections}})}),a.tableContainer=t.append("div"),a.table=a.tableContainer.append("table").attr("width","100%"),d(a.table,n.information)},s.prototype.tail=function(e,t){a.each(t,function(t){e.append("tr").classed("up_pp_element-section",!0).append("td").attr("colspan",2).text(t.title),d(e,t.information)})};var c=function(){return{createElement:function(e,t){return new s(e,t)}}}();t.exports=c},{d3:"d3",underscore:"underscore"}],"biojs-vis-pinpad":[function(e,t,n){"use strict";var a=e("d3"),o=e("underscore"),r=e("./CategoryFactory"),i={width:"250px",height:"500px",highlightColor:"green"},p=function(e){var t=a.select(e.options.el).text("").append("div").classed("up_pp_main-container",!0).style("width",e.options.width),n=t.append("div").classed("up_pp_mainTitle",!0);n.append("div").classed("up_pp_iconContainer",!0).append("div").classed("up-pp-icon-pin",!0).classed("up_pp_icon",!0),e.offsetTop=n.node().offsetHeight+n.node().offsetTop,e.padContainer=t.append("div").classed("up_pp_pad",!0).style("height",e.options.height),e.options.toPin&&e.addElement(e.options.toPin)},d=function(e){var t=this;t.options=o.extend({},i,e),t.offsetTop=void 0,t.categories=[],t.dispatcher=a.dispatch("duplication","add","remove"),t.getDispatcher=function(){return t.dispatcher},p(t)};d.prototype.addCategory=function(e){return r.createCategory(this,e)},d.prototype.addElement=function(e){var t=this,n=e.id&&o.some(t.categories,function(t){return o.some(t.data,function(t){return t.id===e.id})});if(n)return void t.dispatcher.duplication({element:e});var i=o.find(t.categories,function(t){return t.title===e.category});if(void 0===i&&(t.categories.push(t.addCategory(e.category)),t.dispatcher.add({category:e.category}),i=o.last(t.categories)),e.sections&&0!==e.sections.length){i.open||i.toggle();var p=r.createElement(i,e.id,e.sections),d=p.header.node().offsetTop;t.padContainer.node().scrollTop=d-t.offsetTop;var s=p.header.style("background-color");return p.header.transition().duration(1500).styleTween("background-color",function(){return a.interpolate(t.options.highlightColor,s)}),t.dispatcher.add({element:e}),p}},d.hello=function(e){return"hello "+e},t.exports=d},{"./CategoryFactory":1,d3:"d3",underscore:"underscore"}]},{},["biojs-vis-pinpad"]);
require=function e(t,n,a){function o(i,p){if(!n[i]){if(!t[i]){var d="function"==typeof require&&require;if(!p&&d)return d(i,!0);if(r)return r(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var s=n[i]={exports:{}};t[i][0].call(s.exports,function(e){var n=t[i][1][e];return o(n?n:e)},s,s.exports,e,t,n,a)}return n[i].exports}for(var r="function"==typeof require&&require,i=0;i<a.length;i++)o(a[i]);return o}({1:[function(e,t,n){"use strict";var a=(e("d3"),e("underscore")),o=e("./ElementFactory"),r=function(e,t){var n=this;n.pinPad=e,n.title=t,n.open=!0,n.data=[],n.elements=[];var r=n.pinPad.padContainer.append("div").classed("up_pp_category-container",!0);n.header=r.append("div").classed("up_pp_category-header",!0),n.header.title=n.header.append("a").attr("class","up_pp_category-name up_pftv_arrow-down").text(t).on("click",function(){n.toggle()}),n.header.append("span").classed("up_pp_iconContainer",!0).style("float","right").append("div").attr("class","up-pp-icon-trash up_pp_clickable-icon").on("click",function(){n.remove()}),n.padContainer=r.append("div").classed("up_pp_category-pad",!0),n.remove=function(){for(;0!==n.elements.length;)n.elements[0].remove(n.data[0].id,n.title,!1)},n.removeDom=function(){var e=a.findIndex(n.pinPad.categories,function(e){return e.title===n.title});-1!==e&&(r.remove(),n.pinPad.categories.splice(e,1),n.pinPad.dispatcher.remove({category:n.title}))},n.toggle=function(){"none"===n.padContainer.style("display")?(n.padContainer.style("display","block"),n.header.title.attr("class","up_pp_category-name up_pftv_arrow-down"),n.open=!0):(n.padContainer.style("display","none"),n.header.title.attr("class","up_pp_category-name up_pftv_arrow-right"),n.open=!1)},n.addElement=function(e,t){var o={sortAttribute:t[0].title,id:e,sections:t},r=a.sortedIndex(n.data,o,"sortAttribute");return o.sortedIndex=r,n.data.splice(r,0,o),r},n.displayElements=function(e){var t=void 0;return e===n.data.length-1?(t=o.createElement(n,n.data[n.data.length-1]),n.elements.push(t)):(n.padContainer.selectAll("*").remove(),a.each(n.data,function(a,r){var i=o.createElement(n,a);r===e&&(t=i)}),n.elements.splice(e,0,t)),t}},i=function(){return{createCategory:function(e,t){return new r(e,t)},removeCategory:function(e){e.remove()},createElement:function(e,t,n){var a=e.addElement(t,n);return e.displayElements(a)},removeElement:function(e,t){var n=a.findIndex(e.data,function(e){return e.id===t});-1!==n&&o.removeElement(e.elements[n],e.title)}}}();t.exports=i},{"./ElementFactory":2,d3:"d3",underscore:"underscore"}],2:[function(e,t,n){"use strict";var a=e("d3"),o=e("underscore"),r=function(e){if("object"==typeof e&&!(e instanceof Array)){var t=o.keys(e);if(2===t.length&&o.contains(t,"value")&&o.contains(t,"link"))return!0}return!1},i=function(e,t,n){n&&"-"!==n?e.append("a").attr("href",n).attr("target","_blank").text(t):e.text(t)},p=function(e,t){"string"==typeof t||"number"==typeof t||"boolean"==typeof t?e.text(t):r(t)?i(e,t.value,t.link):t instanceof Array?o.each(t,function(n,a){var o=e.append("span");p(o,n),a!==t.length-1&&e.append("span").text(", ")}):c(e.append("table"),t)},d=function(e,t,n){var a=e.append("tr");if(0===t.indexOf("styled_")){var o=a.append("td").text(n.key);n.key_style&&o.attr("style",n.key_style);var r=a.append("td");n.value_style&&r.attr("style",n.value_style),p(r,n.value)}else 0===t.indexOf("subsection_")?(a.append("td").attr("colspan",2).classed("up_pp_table_subsection",!0).text(n.title),c(e,n.information)):(a.append("td").text(t.replace(/_/g," ")),p(a.append("td"),n))},c=function(e,t){o.each(t,function(t,n){d(e,n,t)})},s=function(e,t){var n=this;n.category=e,n.content=t,n.header=void 0,n.tableContainer=void 0,n.table=void 0,n.toggle=function(){"none"===n.tableContainer.style("display")?(n.tableContainer.style("display","block"),n.header.title.attr("class","up_pp_element-name up_pftv_arrow-down"),n.content.open=!0):(n.tableContainer.style("display","none"),n.header.title.attr("class","up_pp_element-name up_pftv_arrow-right"),n.content.open=!1)};var a=n.category.padContainer.append("div").attr("id","pinned_elem_id_"+t.id);n.first(n.category.title,a,o.first(n.content.sections)),n.tail(n.table,o.tail(n.content.sections)),n.content.open===!1&&n.toggle()};s.prototype.first=function(e,t,n){var a=this;a.header=t.append("div").classed("up_pp_element-header",!0),a.header.title=a.header.append("a").attr("class","up_pp_element-name up_pftv_arrow-down").text(n.title).on("click",function(){a.toggle()}),a.header.append("span").classed("up_pp_iconContainer",!0).style("float","right").append("div").attr("class","up-pp-icon-trash up_pp_clickable-icon").on("click",function(){a.remove(a.content.id,e)}),a.tableContainer=t.append("div"),a.table=a.tableContainer.append("table").attr("width","100%"),c(a.table,n.information)},s.prototype.tail=function(e,t){o.each(t,function(t){e.append("tr").classed("up_pp_element-section",!0).append("td").attr("colspan",2).text(t.title),c(e,t.information)})},s.prototype.remove=function(e,t){var n=this,o=a.select("#pinned_elem_id_"+e);o.remove(),n.category.elements.splice(n.sortedIndex,1),n.category.data.splice(n.sortedIndex,1),n.category.pinPad.dispatcher.remove({element:{category:t,id:n.content.id,sections:n.content.sections}}),0===n.category.elements.length&&n.category.removeDom()};var l=function(){return{createElement:function(e,t){return new s(e,t)},removeElement:function(e,t){e.remove(e.content.id,t)}}}();t.exports=l},{d3:"d3",underscore:"underscore"}],"biojs-vis-pinpad":[function(e,t,n){"use strict";var a=e("d3"),o=e("underscore"),r=e("./CategoryFactory"),i={width:"250px",height:"500px",highlightColor:"green"},p=function(e){var t=a.select(e.options.el).text("").append("div").classed("up_pp_main-container",!0).style("width",e.options.width),n=t.append("div").classed("up_pp_mainTitle",!0);n.append("div").classed("up_pp_iconContainer",!0).append("div").classed("up-pp-icon-pin",!0).classed("up_pp_icon",!0),e.offsetTop=n.node().offsetHeight+n.node().offsetTop,e.padContainer=t.append("div").classed("up_pp_pad",!0).style("height",e.options.height),e.options.toPin&&e.addElement(e.options.toPin)},d=function(e){var t=this;t.options=o.extend({},i,e),t.offsetTop=void 0,t.categories=[],t.dispatcher=a.dispatch("duplication","add","remove"),t.getDispatcher=function(){return t.dispatcher},p(t)};d.prototype.addCategory=function(e){return r.createCategory(this,e)},d.prototype.addElement=function(e){var t=this,n=e.id&&o.some(t.categories,function(t){return o.some(t.data,function(t){return t.id===e.id})});if(n)return void t.dispatcher.duplication({element:e});var i=o.find(t.categories,function(t){return t.title===e.category});if(void 0===i&&(t.categories.push(t.addCategory(e.category)),t.dispatcher.add({category:e.category}),i=o.last(t.categories)),e.sections&&0!==e.sections.length){i.open||i.toggle();var p=r.createElement(i,e.id,e.sections),d=p.header.node().offsetTop;t.padContainer.node().scrollTop=d-t.offsetTop;var c=p.header.style("background-color");return p.header.transition().duration(1500).styleTween("background-color",function(){return a.interpolate(t.options.highlightColor,c)}),t.dispatcher.add({element:e}),p}},d.prototype.removeElement=function(e){var t=this,n=o.find(t.categories,function(t){return o.some(t.data,function(t){return t.id===e})});n&&r.removeElement(n,e)},d.prototype.removeCategory=function(e){var t=this,n=o.find(t.categories,function(t){return t.title===e});n&&r.removeCategory(n)},d.hello=function(e){return"hello "+e},t.exports=d},{"./CategoryFactory":1,d3:"d3",underscore:"underscore"}]},{},["biojs-vis-pinpad"]);

@@ -13,3 +13,2 @@ /*jslint node: true */

category.title = catTitle;
category.index = pinPad.categories.length;
category.open = true;

@@ -34,5 +33,3 @@ category.data = [];

.on('click', function() {
categoryContainer.remove();
category.pinPad.categories.splice(category.index, 1);
category.pinPad.dispatcher.remove({category: category.title});
category.remove();
});

@@ -42,2 +39,19 @@

category.remove = function() {
while (category.elements.length !== 0) {
category.elements[0].remove(category.data[0].id, category.title, false);
}
};
category.removeDom = function() {
var index = _.findIndex(category.pinPad.categories, function(cat) {
return cat.title === category.title;
});
if (index !== -1) {
categoryContainer.remove();
category.pinPad.categories.splice(index, 1);
category.pinPad.dispatcher.remove({category: category.title});
}
};
category.toggle = function() {

@@ -56,6 +70,6 @@ if (category.padContainer.style('display') === 'none') {

category.addElement = function(id, sections) {
var elem = {sortAttribute: sections[0].title, id: id, sections: sections};
var sortedIndex = _.sortedIndex(category.data, elem, 'sortAttribute');
elem.sortedIndex = sortedIndex;
category.data.splice(sortedIndex, 0, elem);
var datum = {sortAttribute: sections[0].title, id: id, sections: sections};
var sortedIndex = _.sortedIndex(category.data, datum, 'sortAttribute');
datum.sortedIndex = sortedIndex;
category.data.splice(sortedIndex, 0, datum);
return sortedIndex;

@@ -67,3 +81,3 @@ };

if (sortedIndex === (category.data.length-1)) {
newElem = ElementFactory.createElement(category, category.data[category.data.length-1]);
newElem = ElementFactory.createElement(category, category.data[category.data.length-1]);
category.elements.push(newElem);

@@ -89,5 +103,16 @@ } else {

},
removeCategory: function(category) {
category.remove();
},
createElement: function(category, id, sections) {
var sortedIndex = category.addElement(id, sections);
return category.displayElements(sortedIndex);
},
removeElement: function(category, elId) {
var index = _.findIndex(category.data, function(datum){
return datum.id === elId;
});
if (index !== -1) {
ElementFactory.removeElement(category.elements[index], category.title);
}
}

@@ -94,0 +119,0 @@ };

@@ -66,3 +66,3 @@ /*jslint node: true */

} else {
tr.append('td').text(key.replace('_', ' '));
tr.append('td').text(key.replace(/_/g, ' '));
addValue(tr.append('td'), info);

@@ -98,3 +98,3 @@ }

var elemContainer = element.category.padContainer.append('div');
var elemContainer = element.category.padContainer.append('div').attr('id', 'pinned_elem_id_' + elem.id);
element.first(element.category.title, elemContainer, _.first(element.content.sections));

@@ -123,8 +123,3 @@ element.tail(element.table, _.tail(element.content.sections));

.on('click', function() {
container.remove();
element.category.elements.splice(element.sortedIndex, 1);
element.category.data.splice(element.sortedIndex, 1);
element.category.pinPad.dispatcher.remove({element: {
category: catTitle, id: element.content.id, sections: element.content.sections}
});
element.remove(element.content.id, catTitle);
});

@@ -148,6 +143,23 @@

Element.prototype.remove = function(id, catTitle) {
var element = this;
var container = d3.select('#' + 'pinned_elem_id_' + id);
container.remove();
element.category.elements.splice(element.sortedIndex, 1);
element.category.data.splice(element.sortedIndex, 1);
element.category.pinPad.dispatcher.remove({element: {
category: catTitle, id: element.content.id, sections: element.content.sections}
});
if (element.category.elements.length === 0) {
element.category.removeDom();
}
};
var ElementFactory = function () {
return {
createElement: function(category, element) {
return new Element(category, element);
createElement: function(category, elem) {
return new Element(category, elem);
},
removeElement: function(element, catTitle) {
element.remove(element.content.id, catTitle);
}

@@ -154,0 +166,0 @@ };

@@ -110,2 +110,24 @@ /*jslint node: true */

PinpadViewer.prototype.removeElement = function(id) {
var pinPad = this;
var category = _.find(pinPad.categories, function(cat) {
return _.some(cat.data, function(datum) {
return datum.id === id;
});
});
if (category) {
CategoryFactory.removeElement(category, id);
}
};
PinpadViewer.prototype.removeCategory = function(catTitle) {
var pinPad = this;
var category = _.find(pinPad.categories, function(cat) {
return cat.title === catTitle;
});
if (category) {
CategoryFactory.removeCategory(category);
}
};
/**

@@ -112,0 +134,0 @@ * Method responsible to say Hello

{
"name": "biojs-vis-pinpad",
"description": "A component to pin tootlip-like information",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/ebi-uniprot/biojs-vis-pinpad",

@@ -6,0 +6,0 @@ "author": {

@@ -160,2 +160,40 @@ var site671 = {

]
};
var variant = {
"category": "Variants",
"id": "ft_206",
"sections": [{
"title": "missense 301-301",
"information": {
"source": "Large scale studies",
"description": "primary tissue(s): large intestine",
"mutation": "R > G",
"polyphen": "probably damaging, score 0.9309999942779541",
"sift": "deleterious, score 0",
"styled_evidence_1": {
"key": "Evidence",
"key_style": "background-color: #E8E8E8",
"value": "Imported",
"value_style": "background-color: #E8E8E8"
},
"styled_evidenceArray_cosmic_1": {
"key": "cosmic",
"key_style": "text-align: right; background-color: #F0F0F0",
"value": [{
"value": "COSM1413501",
"link": "http://cancer.sanger.ac.uk/cosmic/mutation/overview?id=1413501"
}],
"value_style": "background-color: #F0F0F0"
},
"styled_evidenceArray_cosmic_study_1": {
"key": "cosmic_study",
"key_style": "text-align: right; background-color: #F0F0F0",
"value": [{
"value": "COSU:376",
"link": "http://cancer.sanger.ac.uk/cosmic/study/overview?study_id=376"
}],
"value_style": "background-color: #F0F0F0"
}
}
}]
};

@@ -11,7 +11,17 @@ // if you don't specify a html file, the sniper will generate a div

var removeDiv = document.createElement('div');
yourDiv.appendChild(removeDiv);
var idText = document.createElement('textarea');
idText.rows = 1;
idText.cols = 10;
removeDiv.appendChild(idText);
var removeButton = document.createElement('button');
removeButton.innerHTML = "Remove element";
removeDiv.appendChild(removeButton);
var app = require("biojs-vis-pinpad");
var instance = new app({
el: appDiv
, width: '250px'
, height: '300px'
, width: '220px'
, height: '320px'
, highlightColor: 'green'

@@ -21,3 +31,3 @@ , text: 'biojs'

var toAdd = [site671, site580, catPTM, site342, site425];
var toAdd = [site671, site580, catPTM, site342, site425, variant];
addButton.onclick = function() {

@@ -32,2 +42,11 @@ if (toAdd.length != 0) {

removeButton.onclick = function() {
console.log('removeButton.onclick');
console.log(idText);
var text = idText.value;
if (text.length !== 0) {
instance.removeElement(text);
}
};
instance.getDispatcher().on('duplication', function(obj) {

@@ -34,0 +53,0 @@ console.log('Element already exist');

@@ -287,3 +287,3 @@ /*

assert.equal(instance.categories[0].data.length, 3, 'three elements');
assert.equal(instance.categories[1].data.length, 1, 'one elements');
assert.equal(instance.categories[1].data.length, 1, 'one element');
});

@@ -336,2 +336,42 @@ it('should add a new element', function() {

});
describe('removing element with the API method', function() {
var addElem2Cat2 = {
category: "Post translational modification",
id: 'ft_41',
sections: [
{
title: "Modified residue",
information: {
description: "Phosphoserine; by CK2"
}
}
]
};
it('should add ft_41 element', function() {
instance.addElement(addElem2Cat2);
assert.equal(instance.categories[0].data.length, 2, 'two elements');
});
it('should remove ft_4 element', function() {
instance.removeElement('ft_4');
assert.equal(instance.categories[0].elements.length, 1, 'only 1 element');
assert.equal(instance.categories[0].data.length, 1, 'only 1 element in data');
var elements = document.querySelectorAll('.up_pp_element-header');
assert.equal(elements.length, 1, 'only 1 element in DOM');
});
});
describe('removing category with the API method', function() {
it('should remove category Post translational modification', function() {
instance.removeCategory('Post translational modification');
assert.equal(instance.categories.length, 0, 'no categories');
var category = document.querySelectorAll('.up_pp_category-header');
assert.equal(category.length, 0, 'no categories in DOM');
var elements = document.querySelectorAll('.up_pp_element-header');
assert.equal(elements.length, 0, 'no elements in DOM');
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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