Fix NPE on load.

This commit is contained in:
Paulo Gustavo Veiga 2022-11-30 18:35:32 -08:00
parent 74a50dd639
commit 4dc64111c0
12 changed files with 78 additions and 67 deletions

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<map name="1420830" version="tango"><topic central="true" text="sss" id="1"><topic position="108,-20" order="0" id="2"/><topic position="-107,0" order="3" id="5"/><topic position="-107,41" order="5" id="6"/><topic position="-107,-41" order="1" id="4" bgColor="rgb(224,229,239)"/><topic position="108,21" order="2" id="3" bgColor="rgb(224,229,239)"><topic position="236,25" order="0" id="7" bgColor="rgb(224,229,239)"/></topic></topic><relationship srcTopicId="3" destTopicId="4" lineType="3" destCtrlPoint="NaN,NaN" endArrow="false" startArrow="true"/><relationship srcTopicId="2" destTopicId="3" lineType="3" srcCtrlPoint="-145,229" destCtrlPoint="-36,188" endArrow="false" startArrow="true"/></map>

View File

@ -46,6 +46,18 @@ class LocalStorageManager extends PersistenceManager {
}
}
private buildHeader() {
const csrfToken = this.getCSRFToken();
const result = {
'Content-Type': 'text/plain',
Accept: 'application/xml',
};
if (csrfToken) {
result['X-CSRF-Token'] = csrfToken;
}
return result;
}
loadMapDom(mapId: string): Promise<Document> {
let result: Promise<Document>;
let localStorate: string | null = null;
@ -55,20 +67,10 @@ class LocalStorageManager extends PersistenceManager {
if (localStorate == null || this.forceLoad) {
const url = this.documentUrl.replace('{id}', mapId);
const csrfToken = this.getCSRFToken();
result = fetch(url, {
method: 'get',
headers:
csrfToken != null
? {
'Content-Type': 'text/plain',
Accept: 'application/xml',
'X-CSRF-Token': csrfToken,
}
: {
'Content-Type': 'text/plain',
Accept: 'application/xml',
},
headers: this.buildHeader(),
})
.then((response: Response) => {
if (!response.ok) {

View File

@ -59,21 +59,21 @@ class RESTPersistenceManager extends PersistenceManager {
}, 10000);
const persistence = this;
const crfs = this.getCSRFToken();
const headers = {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json',
};
if (crfs) {
headers['X-CSRF-Token'] = crfs;
}
fetch(`${this.documentUrl.replace('{id}', mapId)}?${query}`, {
method: 'PUT',
// Blob helps to resuce the memory on large payload.
body: new Blob([JSON.stringify(data)], { type: 'text/plain' }),
headers: crfs
? {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json',
'X-CSRF-Token': crfs,
}
: {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json',
},
headers,
})
.then(async (response: Response) => {
if (response.ok) {
@ -132,35 +132,33 @@ class RESTPersistenceManager extends PersistenceManager {
}
discardChanges(mapId: string): void {
const csrfToken = this.getCSRFToken();
const crfs = this.getCSRFToken();
const headers = {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json',
};
if (crfs) {
headers['X-CSRF-Token'] = crfs;
}
fetch(this.revertUrl.replace('{id}', mapId), {
method: 'POST',
headers: csrfToken
? {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json',
'X-CSRF-Token': csrfToken,
}
: {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json',
},
headers,
});
}
unlockMap(mapId: string): void {
const csrfToken = this.getCSRFToken();
const crfs = this.getCSRFToken();
const headers = {
'Content-Type': 'text/plain; charset=utf-8',
};
if (crfs) {
headers['X-CSRF-Token'] = crfs;
}
fetch(this.lockUrl.replace('{id}', mapId), {
method: 'PUT',
headers: csrfToken
? {
'Content-Type': 'text/plain',
'X-CSRF-Token': csrfToken,
}
: {
'Content-Type': 'text/plain',
},
headers,
body: 'false',
});
}
@ -181,19 +179,18 @@ class RESTPersistenceManager extends PersistenceManager {
loadMapDom(mapId: string): Promise<Document> {
const url = `${this.documentUrl.replace('{id}', mapId)}/xml`;
const csrfToken = this.getCSRFToken();
const crfs = this.getCSRFToken();
const headers = {
'Content-Type': 'text/plain; charset=utf-8',
Accept: 'application/xml',
};
if (crfs) {
headers['X-CSRF-Token'] = crfs;
}
return fetch(url, {
method: 'get',
headers: csrfToken
? {
'Content-Type': 'text/plain',
Accept: 'application/xml',
'X-CSRF-Token': csrfToken,
}
: {
'Content-Type': 'text/plain',
Accept: 'application/xml',
},
headers,
})
.then((response: Response) => {
if (!response.ok) {

View File

@ -1,4 +1,5 @@
import xmlFormatter from 'xml-formatter';
import { off } from 'process';
import Importer from './Importer';
import Mindmap from '../model/Mindmap';
import RelationshipModel from '../model/RelationshipModel';
@ -19,7 +20,6 @@ import NoteModel from '../model/NoteModel';
import FeatureModelFactory from '../model/FeatureModelFactory';
import FeatureModel from '../model/FeatureModel';
import XMLSerializerFactory from '../persistence/XMLSerializerFactory';
import { off } from 'process';
export default class FreemindImporter extends Importer {
private mindmap: Mindmap;

View File

@ -475,7 +475,7 @@ class XMLSerializerTango implements XMLMindmapSerializer {
return value !== null ? value : '';
}
static _deserializeRelationship(domElement: Element, mindmap: Mindmap): RelationshipModel {
static _deserializeRelationship(domElement: Element, mindmap: Mindmap): RelationshipModel | null {
const srcId = Number.parseInt(domElement.getAttribute('srcTopicId')!, 10);
const destId = Number.parseInt(domElement.getAttribute('destTopicId')!, 10);
const lineType = Number.parseInt(domElement.getAttribute('lineType')!, 10);
@ -494,11 +494,14 @@ class XMLSerializerTango implements XMLMindmapSerializer {
const model = mindmap.createRelationship(srcId, destId);
model.setLineType(lineType);
if ($defined(srcCtrlPoint) && srcCtrlPoint !== '') {
model.setSrcCtrlPoint(Point.fromString(srcCtrlPoint));
const spoint = Point.fromString(srcCtrlPoint);
if (spoint) {
model.setSrcCtrlPoint(spoint);
}
if ($defined(destCtrlPoint) && destCtrlPoint !== '') {
model.setDestCtrlPoint(Point.fromString(destCtrlPoint));
const dpoint = Point.fromString(destCtrlPoint);
if (dpoint) {
model.setDestCtrlPoint(dpoint);
}
model.setEndArrow(false);
model.setStartArrow(true);

View File

@ -1 +1 @@
<map name="cdata-support" version="tango"><topic central="true" text="Observation" shape="rectangle" id="1"><note><![CDATA[Always ask ]]></note></topic><topic position="-4,-107" text="Data Analysis" id="29"><note><![CDATA[You always check your data to see if it is correct and then you check it and organize the data that you have to make sure that it is right ]]></note></topic><topic position="-143,-31" text="Organizing Data" id="30"><note><![CDATA[Organize your data when you are doing an experiment ]]></note></topic><topic position="181,-42" text="Questions" id="31"><note><![CDATA[Always ask your self a question when analysis the data it is a good idea to do.]]></note></topic><topic position="-6,46" text="Hypothesis" id="32"><note><![CDATA[You make your hypothesis when you are making your observation.]]></note></topic><topic position="-305,-50" text="Experiment" id="33"><note><![CDATA[Always analysis your data and keep it in order when you are doing an experiment.]]></note></topic><topic position="211,-151" text="Variable" id="34"><note><![CDATA[A major factor that can change the outcome in an experiment.]]></note></topic><topic position="327,-64" text="Independent Variable" id="35"><note><![CDATA[When you change it you the see affect or the aftermath of what happened ]]></note></topic><topic position="-304,14" text="Control Group" id="37"><note><![CDATA[A test That can be compared ]]></note></topic><topic position="323,98" text="Dependent Variable" id="36"><note><![CDATA[Changes the outcome of the other variables]]></note></topic><topic position="-28,141" text="Constant " id="40"><note><![CDATA[Doesnt Change at all maybe once and a while but never that often]]></note></topic><relationship srcTopicId="1" destTopicId="29" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="29" destTopicId="30" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="1" destTopicId="31" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="1" destTopicId="32" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="30" destTopicId="33" lineType="3" srcCtrlPoint="-53,0" destCtrlPoint="-20,0" endArrow="false" startArrow="true"/><relationship srcTopicId="33" destTopicId="29" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="29" destTopicId="31" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="33" destTopicId="35" lineType="3" srcCtrlPoint="191,-113" destCtrlPoint="-354,-98" endArrow="false" startArrow="true"/><relationship srcTopicId="33" destTopicId="37" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="33" destTopicId="34" lineType="3" srcCtrlPoint="-14,-117" destCtrlPoint="-218,-20" endArrow="false" startArrow="true"/><relationship srcTopicId="35" destTopicId="36" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="34" destTopicId="36" lineType="3" srcCtrlPoint="66,43" destCtrlPoint="199,-215" endArrow="false" startArrow="true"/><relationship srcTopicId="33" destTopicId="40" lineType="3" endArrow="false" startArrow="true"/></map>
<map name="cdata-support" version="tango"><topic central="true" text="Observation" shape="rectangle" id="1"><note><![CDATA[Always ask ]]></note></topic><topic position="-4,-107" text="Data Analysis" id="29"><note><![CDATA[You always check your data to see if it is correct and then you check it and organize the data that you have to make sure that it is right ]]></note></topic><topic position="-143,-31" text="Organizing Data" id="30"><note><![CDATA[Organize your data when you are doing an experiment ]]></note></topic><topic position="181,-42" text="Questions" id="31"><note><![CDATA[Always ask your self a question when analysis the data it is a good idea to do.]]></note></topic><topic position="-6,46" text="Hypothesis" id="32"><note><![CDATA[You make your hypothesis when you are making your observation.]]></note></topic><topic position="-305,-50" text="Experiment" id="33"><note><![CDATA[Always analysis your data and keep it in order when you are doing an experiment.]]></note></topic><topic position="211,-151" text="Variable" id="34"><note><![CDATA[A major factor that can change the outcome in an experiment.]]></note></topic><topic position="327,-64" text="Independent Variable" id="35"><note><![CDATA[When you change it you the see affect or the aftermath of what happened ]]></note></topic><topic position="-304,14" text="Control Group" id="37"><note><![CDATA[A test That can be compared ]]></note></topic><topic position="323,98" text="Dependent Variable" id="36"><note><![CDATA[Changes the outcome of the other variables]]></note></topic><topic position="-28,141" text="Constant " id="40"><note><![CDATA[Doesnt Change at all maybe once and a while but never that often]]></note></topic><relationship srcTopicId="30" destTopicId="33" lineType="3" srcCtrlPoint="-53,0" destCtrlPoint="-20,0" endArrow="false" startArrow="true"/><relationship srcTopicId="33" destTopicId="35" lineType="3" srcCtrlPoint="191,-113" destCtrlPoint="-354,-98" endArrow="false" startArrow="true"/><relationship srcTopicId="33" destTopicId="34" lineType="3" srcCtrlPoint="-14,-117" destCtrlPoint="-218,-20" endArrow="false" startArrow="true"/><relationship srcTopicId="34" destTopicId="36" lineType="3" srcCtrlPoint="66,43" destCtrlPoint="199,-215" endArrow="false" startArrow="true"/></map>

View File

@ -48,4 +48,4 @@ Attached below a sample of such screening questions]]></note></topic><topic posi
Understand values and priorities.
Decrease the learning curve.]]></note></topic><topic position="1047,61" order="1" text="Related Strategic Priorities" id="87"><note><![CDATA[1]]></note></topic><topic position="1050,85" order="2" text="KPI: Employee Performance" id="61"><eicon id="📊"/></topic><topic position="1011,112" order="3" text="Methodology" id="80"><topic position="1131,111" order="0" text="Target" id="102"/></topic></topic><topic position="824,186" order="3" text="Goal: Reduce Turnover" id="52"><eicon id="🏈"/><note><![CDATA[To reduce turnover of Top Talent.]]></note><topic position="994,145" order="0" text="So That" id="62"><eicon id="🌈"/><note><![CDATA[ Provide support through feedback.
Help the employee feel valued.
Again, decrease the learning curve.]]></note></topic><topic position="1021,169" order="1" text="Related Strategic Priorities" id="88"/><topic position="1014,193" order="2" text="KPI: Retention Rate" id="63"><eicon id="📊"/></topic><topic position="992,221" order="3" text="Methodology" shrink="true" id="98"><topic position="1112,219" order="0" text="Target" id="101"/></topic></topic><topic position="814,253" order="4" text="Risk &amp; Compliance" id="246"><eicon id="🏈"/><note><![CDATA[To eliminate or minimize risk and to comply with all legislated requirements. ]]></note></topic></topic></topic><relationship srcTopicId="154" destTopicId="6" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="4" destTopicId="156" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="16" destTopicId="162" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="31" destTopicId="91" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="91" destTopicId="105" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="10" destTopicId="163" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="204" destTopicId="9" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="204" destTopicId="33" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="206" destTopicId="208" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="18" destTopicId="215" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="91" destTopicId="105" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="91" destTopicId="105" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="247" destTopicId="248" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="156" destTopicId="166" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="166" destTopicId="167" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="167" destTopicId="2" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="270" destTopicId="130" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="275" destTopicId="298" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="123" destTopicId="220" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="6" destTopicId="29" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="29" destTopicId="31" lineType="3" endArrow="false" startArrow="true"/></map>
Again, decrease the learning curve.]]></note></topic><topic position="1021,169" order="1" text="Related Strategic Priorities" id="88"/><topic position="1014,193" order="2" text="KPI: Retention Rate" id="63"><eicon id="📊"/></topic><topic position="992,221" order="3" text="Methodology" shrink="true" id="98"><topic position="1112,219" order="0" text="Target" id="101"/></topic></topic><topic position="814,253" order="4" text="Risk &amp; Compliance" id="246"><eicon id="🏈"/><note><![CDATA[To eliminate or minimize risk and to comply with all legislated requirements. ]]></note></topic></topic></topic></map>

View File

@ -15,4 +15,4 @@ calculo navegar en internet, base de datos, etc.]]></text><topic position="-855,
]]></text></topic><topic position="465,236" order="4" shape="rounded rectangle" id="42" fontStyle=";8;#000000;;;" bgColor="#ead1dc" brColor="#4c1130"><text><![CDATA[Microprocesador
]]></text></topic><topic position="450,265" order="5" shape="rounded rectangle" id="43" fontStyle=";8;#000000;;;" bgColor="#ead1dc" brColor="#4c1130"><text><![CDATA[Disco Duro
]]></text></topic></topic><topic position="80,-215" shape="rounded rectangle" id="118" fontStyle=";10;#feffff;;;" bgColor="#cc0000" brColor="#660000"><text><![CDATA[Máquina electrónica que sirve para: escribir, dibujar, pintar,
escuchar música, ver videos, calcular, comunicarnos con otras personas, etc-]]></text></topic><relationship srcTopicId="35" destTopicId="21" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="118" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="118" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/></map>
escuchar música, ver videos, calcular, comunicarnos con otras personas, etc-]]></text></topic></map>

View File

@ -1 +1 @@
<map name="npe" version="tango"><topic central="true" text="NIF (NORMAS DE INFORMACIÓN FINANCIERA)" shape="rounded rectangle" id="1" fontStyle=";10;#741b47;bold;;" bgColor="#d5a6bd" brColor="#e69138"><eicon id="✏️"/></topic><topic position="6,-284" text="NIF D" shape="rectangle" id="3" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><note><![CDATA[Beneficios a los empleados,impuestos a la utilidad, arrendamientos y capitalización de resultado integral .]]></note><eicon id="😎"/><topic position="211,-280" order="0" text=" Normas aplicables a problemas de determinación de resultados " id="19"/></topic><topic position="46,221" text=" CIRCULANTES" shape="rounded rectangle" id="7" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><note><![CDATA[Tratamiento contable de los gastos de registro, colocación, unidades de inversión, aplicación supletoria etc.]]></note><eicon id="☎️"/><topic position="236,225" order="0" text="Adquisición temporal de acciones propias" id="22"/></topic><topic position="-143,148" text=" NIF A" shape="rectangle" id="6" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><link url="http://www.youtube.com/watch?v=7YN-sOlkQp0" urlType="url"/><eicon id="⌛"/><topic position="-254,152" order="0" text=" Marco conceptual" id="20"/></topic><topic position="-150,-129" text=" NIF C" shape="rectangle" id="4" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><link url="https://sites.google.com/site/contabilidadimcpnif/estructura-de-las-nif" urlType="url"/><eicon id="🐵"/><topic position="-366,-125" order="0" text="Normas aplicables a conceptos específicos de los estados financieros " shape="line" id="13"/></topic><topic position="183,-153" text="NIF E" shape="rectangle" id="2" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><note><![CDATA[Agricultura y donativos recibidos u otorgados con propósitos no lucrativos.]]></note><icon id="soft_penguin"/><topic position="402,-149" order="0" text=" Normas aplicables alas actividades especializadas de distintos sectores" id="18"/></topic><topic position="326,127" text=" NIF B" shape="rectangle" id="5" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><link url="http://www.contaduria.uady.mx/files/cuerpo-acad/caef/aief/resumen_NIF_marco_conceptual.pdf" urlType="url"/><eicon id="🏠"/><topic position="521,131" order="0" text=" Normas aplicables a los estados financieros en su conjunto" id="21"/></topic><relationship srcTopicId="3" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="4" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="1" destTopicId="4" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="7" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="6" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="5" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="2" destTopicId="1" lineType="3" endArrow="false" startArrow="true"/><relationship srcTopicId="1" destTopicId="2" lineType="3" endArrow="false" startArrow="true"/></map>
<map name="npe" version="tango"><topic central="true" text="NIF (NORMAS DE INFORMACIÓN FINANCIERA)" shape="rounded rectangle" id="1" fontStyle=";10;#741b47;bold;;" bgColor="#d5a6bd" brColor="#e69138"><eicon id="✏️"/></topic><topic position="6,-284" text="NIF D" shape="rectangle" id="3" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><note><![CDATA[Beneficios a los empleados,impuestos a la utilidad, arrendamientos y capitalización de resultado integral .]]></note><eicon id="😎"/><topic position="211,-280" order="0" text=" Normas aplicables a problemas de determinación de resultados " id="19"/></topic><topic position="46,221" text=" CIRCULANTES" shape="rounded rectangle" id="7" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><note><![CDATA[Tratamiento contable de los gastos de registro, colocación, unidades de inversión, aplicación supletoria etc.]]></note><eicon id="☎️"/><topic position="236,225" order="0" text="Adquisición temporal de acciones propias" id="22"/></topic><topic position="-143,148" text=" NIF A" shape="rectangle" id="6" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><link url="http://www.youtube.com/watch?v=7YN-sOlkQp0" urlType="url"/><eicon id="⌛"/><topic position="-254,152" order="0" text=" Marco conceptual" id="20"/></topic><topic position="-150,-129" text=" NIF C" shape="rectangle" id="4" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><link url="https://sites.google.com/site/contabilidadimcpnif/estructura-de-las-nif" urlType="url"/><eicon id="🐵"/><topic position="-366,-125" order="0" text="Normas aplicables a conceptos específicos de los estados financieros " shape="line" id="13"/></topic><topic position="183,-153" text="NIF E" shape="rectangle" id="2" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><note><![CDATA[Agricultura y donativos recibidos u otorgados con propósitos no lucrativos.]]></note><icon id="soft_penguin"/><topic position="402,-149" order="0" text=" Normas aplicables alas actividades especializadas de distintos sectores" id="18"/></topic><topic position="326,127" text=" NIF B" shape="rectangle" id="5" fontStyle="Arial;10;;bold;;" bgColor="#509dc0"><link url="http://www.contaduria.uady.mx/files/cuerpo-acad/caef/aief/resumen_NIF_marco_conceptual.pdf" urlType="url"/><eicon id="🏠"/><topic position="521,131" order="0" text=" Normas aplicables a los estados financieros en su conjunto" id="21"/></topic></map>

View File

@ -37,8 +37,6 @@
<node ID="ID_30" POSITION="right" TEXT="In 2010, 2,500 referrals forwarded to OneLegacy"/>
</node>
<node ID="ID_31" POSITION="right" STYLE="bubble" BACKGROUND_COLOR="#00ffd5" TEXT="Doheny Eye and Tissue Transplant Bank" LINK="http://www.dohenyeyebank.org/"/>
<arrowlink DESTINATION="ID_32" STARTARROW="Default"/>
<arrowlink DESTINATION="ID_36" STARTARROW="Default"/>
</node>
<node ID="ID_32" POSITION="right" STYLE="bubble" BACKGROUND_COLOR="#00ffd5" TEXT="OneLegacy">
<node ID="ID_33" POSITION="right" TEXT="In 2010, 11,828 referrals"/>

File diff suppressed because one or more lines are too long

View File

@ -42,7 +42,16 @@ class Point {
Point.fromString = function pointFromString(point) {
const values = point.split(',');
return new Point(Number.parseInt(values[0], 10), Number.parseInt(values[1], 10));
let result = null;
if (values.lenght > 1) {
const x = Number.parseInt(values[0], 10);
const y = Number.parseInt(values[1], 10);
if (!Number.isNaN(x) && !Number.isNaN(y)) {
result = new Point(x, y);
}
}
return result;
};
export default Point;