diff --git a/packages/mindplot/src/components/Designer.js b/packages/mindplot/src/components/Designer.js index 1129c55a..fab10c79 100644 --- a/packages/mindplot/src/components/Designer.js +++ b/packages/mindplot/src/components/Designer.js @@ -798,7 +798,7 @@ class Designer extends Events { const targetTopic = dmodel.findTopicById(targetTopicId); $assert( targetTopic, - `targetTopic could not be found:${targetTopicId}${dmodel + `targetTopic could not be found:${targetTopicId},${dmodel .getTopics() .map((e) => e.getId())}`, ); diff --git a/packages/mindplot/src/components/persistence/XMLSerializerFactory.js b/packages/mindplot/src/components/persistence/XMLSerializerFactory.js index dad6b6b7..bb765ec6 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerFactory.js +++ b/packages/mindplot/src/components/persistence/XMLSerializerFactory.js @@ -53,7 +53,7 @@ XMLSerializerFactory.getSerializerFromDocument = function (domDocument) { * @param {String} version the version name * @return serializer */ -XMLSerializerFactory.getSerializer = function (version) { +XMLSerializerFactory.getSerializer = function getSerializer(version) { if (!$defined(version)) { version = ModelCodeName.BETA; } diff --git a/packages/mindplot/src/components/persistence/XMLSerializer_Beta.js b/packages/mindplot/src/components/persistence/XMLSerializer_Beta.js index 9cb27293..d0b686d0 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializer_Beta.js +++ b/packages/mindplot/src/components/persistence/XMLSerializer_Beta.js @@ -55,7 +55,7 @@ class XMLSerializer_Beta { const parent = topic.getParent(); if (parent == null || parent.getType() === INodeModel.CENTRAL_TOPIC_TYPE) { const pos = topic.getPosition(); - parentTopic.setAttribute('position', `${pos.x}${pos.y}`); + parentTopic.setAttribute('position', `${pos.x},${pos.y}`); } else { const order = topic.getOrder(); parentTopic.setAttribute('order', order); diff --git a/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js b/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js index 1b115467..ab2736da 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js +++ b/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js @@ -63,7 +63,7 @@ class XMLSerializer_Pela { && mindmap.findNodeById(relationship.getToNode()) !== null ) { // Isolated relationships are not persisted .... - const relationDom = this._relationshipToXML(document, relationship); + const relationDom = XMLSerializer_Pela._relationshipToXML(document, relationship); mapElem.appendChild(relationDom); } } @@ -80,7 +80,7 @@ class XMLSerializer_Pela { parentTopic.setAttribute('central', 'true'); } else { const pos = topic.getPosition(); - parentTopic.setAttribute('position', `${pos.x}${pos.y}`); + parentTopic.setAttribute('position', `${pos.x},${pos.y}`); const order = topic.getOrder(); if (typeof order === 'number' && Number.isFinite(order)) { parentTopic.setAttribute('order', order); } @@ -98,7 +98,7 @@ class XMLSerializer_Pela { if (shape === TopicShape.IMAGE) { parentTopic.setAttribute( 'image', - `${topic.getImageSize().width}${topic.getImageSize().height + `${topic.getImageSize().width},${topic.getImageSize().height }:${topic.getImageUrl()}`, ); } @@ -196,7 +196,7 @@ class XMLSerializer_Pela { } } - _relationshipToXML(document, relationship) { + static _relationshipToXML(document, relationship) { const result = document.createElement('relationship'); result.setAttribute('srcTopicId', relationship.getFromNode()); result.setAttribute('destTopicId', relationship.getToNode()); @@ -208,14 +208,14 @@ class XMLSerializer_Pela { const srcPoint = relationship.getSrcCtrlPoint(); result.setAttribute( 'srcCtrlPoint', - `${Math.round(srcPoint.x)}${Math.round(srcPoint.y)}`, + `${Math.round(srcPoint.x)},${Math.round(srcPoint.y)}`, ); } if ($defined(relationship.getDestCtrlPoint())) { const destPoint = relationship.getDestCtrlPoint(); result.setAttribute( 'destCtrlPoint', - `${Math.round(destPoint.x)}${Math.round(destPoint.y)}`, + `${Math.round(destPoint.x)},${Math.round(destPoint.y)}`, ); } } @@ -260,7 +260,7 @@ class XMLSerializer_Pela { break; } case 'relationship': { - const relationship = this._deserializeRelationship(child, mindmap); + const relationship = XMLSerializer_Pela._deserializeRelationship(child, mindmap); if (relationship != null) { mindmap.addRelationship(relationship); } @@ -392,7 +392,7 @@ class XMLSerializer_Pela { } // Has text node ?. - const textAttr = this._deserializeTextAttr(child); + const textAttr = XMLSerializer_Pela._deserializeTextAttr(child); if (textAttr) { attributes.text = textAttr; } @@ -402,7 +402,7 @@ class XMLSerializer_Pela { const feature = TopicFeature.createModel(featureType, attributes); topic.addFeature(feature); } else if (child.tagName === 'text') { - const nodeText = this._deserializeNodeText(child); + const nodeText = XMLSerializer_Pela._deserializeNodeText(child); topic.setText(nodeText); } } @@ -410,7 +410,7 @@ class XMLSerializer_Pela { return topic; } - _deserializeTextAttr(domElem) { + static _deserializeTextAttr(domElem) { let value = domElem.getAttribute('text'); if (!$defined(value)) { const children = domElem.childNodes; @@ -433,7 +433,7 @@ class XMLSerializer_Pela { return value; } - _deserializeNodeText(domElem) { + static _deserializeNodeText(domElem) { const children = domElem.childNodes; let value = null; for (let i = 0; i < children.length; i++) { @@ -445,7 +445,7 @@ class XMLSerializer_Pela { return value; } - _deserializeRelationship(domElement, mindmap) { + static _deserializeRelationship(domElement, mindmap) { const srcId = domElement.getAttribute('srcTopicId'); const destId = domElement.getAttribute('destTopicId'); const lineType = domElement.getAttribute('lineType'); @@ -485,6 +485,7 @@ class XMLSerializer_Pela { * @param in The String whose non-valid characters we want to remove. * @return The in String, stripped of non-valid characters. */ + // eslint-disable-next-line class-methods-use-this rmXmlInv(str) { if (str == null || str === undefined) return null; diff --git a/packages/mindplot/test/playground/layout/TestSuite.js b/packages/mindplot/test/playground/layout/TestSuite.js index c75bdc5f..ce157ab4 100644 --- a/packages/mindplot/test/playground/layout/TestSuite.js +++ b/packages/mindplot/test/playground/layout/TestSuite.js @@ -259,7 +259,7 @@ const TestSuite = new Class({ console.log( `\tUpdated nodes: {id:${event.getId() }, order: ${event.getOrder() - }${posStr + },${posStr }}`, ); events.push(event); diff --git a/packages/web2d/src/components/peer/svg/ElementPeer.js b/packages/web2d/src/components/peer/svg/ElementPeer.js index 2946b383..93e189c0 100644 --- a/packages/web2d/src/components/peer/svg/ElementPeer.js +++ b/packages/web2d/src/components/peer/svg/ElementPeer.js @@ -112,12 +112,12 @@ class ElementPeer { setSize(width, height) { if ($defined(width) && this._size.width !== parseInt(width, 10)) { this._size.width = parseInt(width, 10); - this._native.setAttribute('width', parseInt(width, 10)); + this._native.setAttribute('width', this._size.width); } if ($defined(height) && this._size.height !== parseInt(height, 10)) { this._size.height = parseInt(height, 10); - this._native.setAttribute('height', parseInt(height, 10)); + this._native.setAttribute('height', this._size.height); } EventUtils.broadcastChangeEvent(this, 'strokeStyle');