You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionconvertToRawNodeDatum(json: Record<string,string|number|boolean>): RawNodeDatum[]{if(json===null||typeofjson!=='object'){thrownewError('Input must be a non-null object');}constrawNodeData: RawNodeDatum[]=[];for(constkeyinjson){constvalue=json[key];constrawNodeDatum: RawNodeDatum={name: key};if(Array.isArray(value)){rawNodeDatum.children=value.map(convertToRawNodeDatum).flat();}elseif(typeofvalue==='object'){rawNodeDatum.children=convertToRawNodeDatum(value);}else{rawNodeDatum.attributes={value: value};}rawNodeData.push(rawNodeDatum);}returnrawNodeData;}'''
The text was updated successfully, but these errors were encountered:
paulano1
changed the title
A converter helper function if anyone is trying to convert a regular nested json to the data format specified by the library
A helper function if anyone is trying to convert a regular nested json to the data format specified by the library
Dec 26, 2022
The text was updated successfully, but these errors were encountered: