import glob from '../global'
import { clearObject, cloneObject } from '../utils'

/**
 * @name remove
 * @desc Remove the mind map and reset all global settings.
*/
export function remove() {
    glob.container.select('svg').remove()
    let backup = cloneObject( glob.backup )
    clearObject( glob )
    Object.assign( glob, backup )
}

import glob from '../global'
import { clearObject, cloneObject } from '../utils'

/**
 * @name remove
 * @desc Remove the mind map and reset all global settings.
*/
export function remove() {
	if( glob.container !== undefined ) {
		glob.container.select('svg').remove()
		let backup = cloneObject( glob.backup )
		clearObject( glob )
		Object.assign( glob, backup )
	} 
}

add control after mmap removal