biojs-vis-pinpad
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -106,9 +106,4 @@ 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){ | ||
}, | ||
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); | ||
} | ||
removeElement: function(category, index) { | ||
ElementFactory.removeElement(category.elements[index]); | ||
} | ||
@@ -240,3 +235,3 @@ }; | ||
.on('click', function() { | ||
element.remove(element.content.id, catTitle); | ||
element.remove(element.content.id); | ||
}); | ||
@@ -260,13 +255,20 @@ | ||
Element.prototype.remove = function(id, catTitle) { | ||
Element.prototype.remove = function(id) { | ||
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} | ||
var index = _.findIndex(element.category.data, function(datum){ | ||
return datum.id === id; | ||
}); | ||
if (element.category.elements.length === 0) { | ||
element.category.removeDom(); | ||
if (index !== -1) { | ||
var container = d3.select('#' + 'pinned_elem_id_' + id); | ||
container.remove(); | ||
element.category.elements.splice(index, 1); | ||
element.category.data.splice(index, 1); | ||
element.category.pinPad.dispatcher.remove({element: { | ||
category: element.category.title, id: element.content.id, sections: element.content.sections} | ||
}); | ||
if (element.category.elements.length === 0) { | ||
element.category.removeDom(); | ||
} | ||
} else { | ||
element.category.pinPad.dispatcher.unknown({element: {id: id}}); | ||
} | ||
@@ -280,4 +282,4 @@ }; | ||
}, | ||
removeElement: function(element, catTitle) { | ||
element.remove(element.content.id, catTitle); | ||
removeElement: function(element) { | ||
element.remove(element.content.id); | ||
} | ||
@@ -344,3 +346,3 @@ }; | ||
pinPad.categories = []; | ||
pinPad.dispatcher = d3.dispatch("duplication", "add", "remove"); | ||
pinPad.dispatcher = d3.dispatch("add", "duplication", "remove", "unknown"); | ||
@@ -401,9 +403,13 @@ pinPad.getDispatcher = function() { | ||
var pinPad = this; | ||
var index = -1; | ||
var category = _.find(pinPad.categories, function(cat) { | ||
return _.some(cat.data, function(datum) { | ||
index = _.findIndex(cat.data, function(datum){ | ||
return datum.id === id; | ||
}); | ||
return index !== -1; | ||
}); | ||
if (category) { | ||
CategoryFactory.removeElement(category, id); | ||
if (category && (index !== -1)) { | ||
CategoryFactory.removeElement(category, index); | ||
} else { | ||
pinPad.dispatcher.unknown({element: {id: id}}); | ||
} | ||
@@ -436,2 +442,2 @@ }; | ||
},{"./CategoryFactory":1,"d3":"d3","underscore":"underscore"}]},{},["biojs-vis-pinpad"]) | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlc1xcYnJvd3NlcmlmeVxcbm9kZV9tb2R1bGVzXFxicm93c2VyLXBhY2tcXF9wcmVsdWRlLmpzIiwibGliXFxDYXRlZ29yeUZhY3RvcnkuanMiLCJsaWJcXEVsZW1lbnRGYWN0b3J5LmpzIiwibGliXFxQaW5wYWRWaWV3ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUNBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QU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clxuXHJcbnZhciBpc0xpbmsgPSBmdW5jdGlvbihpbmZvKSB7XHJcbiAgICBpZiAoKHR5cGVvZiBpbmZvID09PSAnb2JqZWN0JykgJiYgIShpbmZvIGluc3RhbmNlb2YgQXJyYXkpKSB7XHJcbiAgICAgICAgdmFyIGtleXMgPSBfLmtleXMoaW5mbyk7XHJcbiAgICAgICAgaWYgKChrZXlzLmxlbmd0aCA9PT0gMikgJiYgXy5jb250YWlucyhrZXlzLCAndmFsdWUnKSAmJiBfLmNvbnRhaW5zKGtleXMsICdsaW5rJykpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcmV0dXJuIGZhbHNlXHJcbn07XHJcblxyXG52YXIgYWRkTGluayA9IGZ1bmN0aW9uKGNvbnRhaW5lciwgaW5mb1RleHQsIGluZm9MaW5rKSB7XHJcbiAgICBpZiAoaW5mb0xpbmsgJiYgKGluZm9MaW5rICE9PSAnLScpKSB7XHJcbiAgICAgICAgY29udGFpbmVyLmFwcGVuZCgnYScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdocmVmJywgaW5mb0xpbmspXHJcbiAgICAgICAgICAgIC5hdHRyKCd0YXJnZXQnLCAnX2JsYW5rJylcclxuICAgICAgICAgICAgLnRleHQoaW5mb1RleHQpO1xyXG4gICAgfSBlbHNlIHtcclxuICAgICAgICBjb250YWluZXIudGV4dChpbmZvVGV4dCk7XHJcbiAgICB9XHJcbn07XHJcblxyXG52YXIgYWRkVmFsdWUgPSBmdW5jdGlvbihjb250YWluZXIsIGluZm8pIHtcclxuICAgIGlmICgodHlwZW9mIGluZm8gPT09ICdzdHJpbmcnKSB8fCAodHlwZW9mIGluZm8gPT09ICdudW1iZXInKSB8fCAodHlwZW9mIGluZm8gPT09ICdib29sZWFuJykpIHtcclxuICAgICAgICBjb250YWluZXIudGV4dChpbmZvKTtcclxuICAgIH0gZWxzZSBpZiAoaXNMaW5rKGluZm8pKSB7XHJ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W5lZDtcclxuICAgIGVsZW1lbnQudGFibGUgPSB1bmRlZmluZWQ7XHJcblxyXG4gICAgZWxlbWVudC50b2dnbGUgPSBmdW5jdGlvbigpIHtcclxuICAgICAgICBpZiAoZWxlbWVudC50YWJsZUNvbnRhaW5lci5zdHlsZSgnZGlzcGxheScpID09PSAnbm9uZScpIHtcclxuICAgICAgICAgICAgZWxlbWVudC50YWJsZUNvbnRhaW5lci5zdHlsZSgnZGlzcGxheScsICdibG9jaycpO1xyXG4gICAgICAgICAgICBlbGVtZW50LmhlYWRlci50aXRsZS5hdHRyKCdjbGFzcycsICd1cF9wcF9lbGVtZW50LW5hbWUgdXBfcGZ0dl9hcnJvdy1kb3duJyk7XHJcbiAgICAgICAgICAgIGVsZW1lbnQuY29udGVudC5vcGVuID0gdHJ1ZTtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICBlbGVtZW50LnRhYmxlQ29udGFpbmVyLnN0eWxlKCdkaXNwbGF5JywgJ25vbmUnKTtcclxuICAgICAgICAgICAgZWxlbWVudC5oZWFkZXIudGl0bGUuYXR0cignY2xhc3MnLCAndXBfcHBfZWxlbWVudC1uYW1lIHVwX3BmdHZfYXJyb3ctcmlnaHQnKTtcclxuICAgICAgICAgICAgZWxlbWVudC5jb250ZW50Lm9wZW4gPSBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICB9O1xyXG5cclxuICAgIHZhciBlbGVtQ29udGFpbmVyID0gZWxlbWVudC5jYXRlZ29yeS5wYWRDb250YWluZXIuYXBwZW5kKCdkaXYnKS5hdHRyKCdpZCcsICdwaW5uZWRfZWxlbV9pZF8nICsgZWxlbS5pZCk7XHJcbiAgICBlbGVtZW50LmZpcnN0KGVsZW1lbnQuY2F0ZWdvcnkudGl0bGUsIGVsZW1Db250YWluZXIsIF8uZmlyc3QoZWxlbWVudC5jb250ZW50LnNlY3Rpb25zKSk7XHJcbiAgICBlbGVtZW50LnRhaWwoZWxlbWVudC50YWJsZSwgXy50YWls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GFkZExpbmsgPSBmdW5jdGlvbihjb250YWluZXIsIGluZm9UZXh0LCBpbmZvTGluaykge1xyXG4gICAgaWYgKGluZm9MaW5rICYmIChpbmZvTGluayAhPT0gJy0nKSkge1xyXG4gICAgICAgIGNvbnRhaW5lci5hcHBlbmQoJ2EnKVxyXG4gICAgICAgICAgICAuYXR0cignaHJlZicsIGluZm9MaW5rKVxyXG4gICAgICAgICAgICAuYXR0cigndGFyZ2V0JywgJ19ibGFuaycpXHJcbiAgICAgICAgICAgIC50ZXh0KGluZm9UZXh0KTtcclxuICAgIH0gZWxzZSB7XHJcbiAgICAgICAgY29udGFpbmVyLnRleHQoaW5mb1RleHQpO1xyXG4gICAgfVxyXG59O1xyXG5cclxudmFyIGFkZFZhbHVlID0gZnVuY3Rpb24oY29udGFpbmVyLCBpbmZvKSB7XHJcbiAgICBpZiAoKHR5cGVvZiBpbmZvID09PSAnc3RyaW5nJykgfHwgKHR5cGVvZiBpbmZvID09PSAnbnVtYmVyJykgfHwgKHR5cGVvZiBpbmZvID09PSAnYm9vbGVhbicpKSB7XHJcbiAgICAgICAgY29udGFpbmVyLnRleHQoaW5mbyk7XHJcbiAgICB9IGVsc2UgaWYgKGlzTGluayhpbmZvKSkge1xyXG4gICAgICAgIGFkZExpbmsoY29udGFpbmVyLCBpbmZvLnZhbHVlLCBpbmZvLmxpbmspO1xyXG4gICAgfSBlbHNlIGlmIChpbmZvIGluc3RhbmNlb2YgQXJyYXkpIHtcclxuICAgICAgICBfLmVhY2goaW5mbywgZnVuY3Rpb24oZGF0dW0sIGluZGV4KSB7XHJcbiAgICAgICAgICAgIHZhciBzcGFuID0gY29udGFpbmVyLmFwcGVuZCgnc3BhbicpO1xyXG4gICAgICAgICAgICBhZGRWYWx1ZShzcGFuLCBkYXR1bSk7XHJcbiAgICAgICAgICAgIGlmIChpbmRleCAhPT0gKGluZm8ubGVuZ3RoLTEpKSB7XHJcbiAgICAgICAgICAgICAgICBjb250YWluZXIuYXBwZW5kKCdzc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JcbiAgICAgICAgQ2F0ZWdvcnlGYWN0b3J5LnJlbW92ZUNhdGVnb3J5KGNhdGVnb3J5KTtcclxuICAgIH1cclxufTtcclxuXHJcbi8qKlxyXG4gKiBNZXRob2QgcmVzcG9uc2libGUgdG8gc2F5IEhlbGxvXHJcbiAqIEBleGFtcGxlXHJcbiAqICAgICBiaW9qc3Zpc3BpbnBhZC5oZWxsbygnYmlvanMnKTtcclxuICogQG1ldGhvZCBoZWxsb1xyXG4gKiBAcGFyYW0ge1N0cmluZ30gbmFtZSBOYW1lIG9mIGEgcGVyc29uXHJcbiAqIEByZXR1cm4ge1N0cmluZ30gUmV0dXJucyBoZWxsbyBuYW1lXHJcbiAqL1xyXG5QaW5wYWRWaWV3ZXIuaGVsbG8gPSBmdW5jdGlvbiAobmFtZSkge1xyXG4gICAgcmV0dXJuICdoZWxsbyAnICsgbmFtZTtcclxufTtcclxuXHJcbm1vZHVsZS5leHBvcnRzID0gUGlucGFkVmlld2VyOyJdfQ== |
@@ -1,14 +0,8 @@ | ||
� �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� | ||
���1m���h}�ڔ;�/>'����,�D*ɉ�eTC>#Pt͠�/��'Pr[+��Ǵ �_�ٚ�����wv�gU���������������`���U�i��67` �p6��*JF2� ���B{()��*@VTһ�c���c�%��2Hv�g���X�.S���<��$�oy=�{�F`�5�v u"N0�4��,$?B�y�2��]��וQ��'a���U�)��^��(�������.�qg��ɼ | ||
�1g8a�$h;� | ||
���� _t�j>=>݉ɣ<B>�ǘOc��~�S"����82FQ��L 9��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�D i^��=BsHJ@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���%ܤ��)��� | ||
� �Y�o��W�I ��s��B���C�����#�1oR��d������D�N��=�%�(r8Ù��F�����v/K#����PIYz�GT"h��6��7��=�����*H�J��<7\mgډ�����4�y�jn�Z�*z�Lq\�1��PjYH�4���� ���Tf���=�j_���R\�H�6;��feV���ߟ?���O�_>�����_>Zv(�-P����5J�6?t�m�Y�f%����'�I�3Pv����߮��*��2�iG[:��ԝ]�g��c�KP�~�yQQ,���,���7����LU���{���omq��@�-��F��{��HxB�IJ�w/+��RiNҔ���w�j������F�g���Xl;Ѯe��+� | ||
Nef��y�f�ᲸX�S�+nn�;�-����aqְꃒ� �u�X\��⑤YY����o6M�)����բ� ��8[���w��b{�� ��f���F�T�d|�c[�a�O�J=IXf�7��4���Ţ�J��Jpd����I�EZ�mۆ�cX�ad|֚g�A��b���~gP��AL X4�e-�f�n�-B�]��'�ޚ?�Ǡw�7; ��wh̎��(�� ��C��^h8 ���b�T���`��?!�%}4z'�O4�u�O]�^�@UH�D�CO�����C��� G�r��ŇpHy��5�Kl�Jrbu吏]3H���� ��� | ||
�<ͅ�1�H�;[���>�����YUy4;a�8����a'q�7<7?.tD�s�r���M�2���h������2 r<�� | ||
Ch�� | ||
���G�)����Q�j��]�Yi.'���*+5��r鷼�̽M#0Κ}��:�'�R��P�� ���fg�.���ʨvڊ�08��e�)��^�>)�������rŸ���d~�1vg��@��Y�O�O|�/:R5��OW1yGȇz����|JdzP��k�03�i�u P�@ | ||
���qAίh�c�5��;�kywK�����?&��o9Qw�C@$�y�a�đ�Z��4�ʾ��V#�����9D�����<�z[N�k!�<�Xzu���7M��dA�^\�e{����<�j���X)7w5�MB��yx�h3A�''�����D�� | ||
��9������\��Y���Lsst���e���2q]|B�M��B�.��^����<� �3i�����`�ϣ�U�b&�ٚX�.�c��g��Ն�AO6����#9�l� | ||
���}_ �R�ǒ`�=��^O�G_S�$:��!�z��<�o�ZN���H������g��8^捵%�p֠���mNB�=u<0@0����=%3���d*�ѫ���4d��*���kd>TXK�1�r��6�B�T H�x<z}���e��,�O�C���쫤�[<"/�Tx;}yE����U �z��kݒ�V �&�.%d"n�������V�ò��p��W"�4��u8��_ONQ��y�ꬁuhe£����A�B���p�qc�ƍ{kcw6VƩ�B������tw,�#�;"��0I��Kb:qZc��O�2;Pw�\�� @�u�̊��<�!ɋK�K�2��3���9�s3�s�鴭��<�5����O3��W���$��u�>Slob�zB�r��P@��4�h��%��E^��r���Ck�P͕�B+곎ः�s��X��&�o}���2���{�UB:G:c�[:Э_�BNs�� iGM�����$�4 54 �>���v�(��+��ۋ��< 7��8ؤ���O���;�p������j��j�sr�9�dL�C�1ˡNXg�k?=�I�> |