function updateScale(tree) {
	let textUpdate = d3.select('.scalingOption')
	if (currentState === 'vertical' && scaled === false) {
		tree.layout(tntTree.layout.vertical().width(window.innerWidth * scaleFactor)
			.scale(true))
		tree.update()
		scaled = true
		textUpdate.text('Turn Off Scaling')
	}
	else if (currentState === 'radial' && scaled === false) {
		tree.layout(tntTree.layout.radial().width(Math.min(window.innerWidth * scaleFactor, window.innerHeight * scaleFactor))
			.scale(true))
		tree.update()
		scaled = true
		textUpdate.text('Turn Off Scaling')
	}
	else if (currentState === 'vertical' && scaled === true) {
		tree.layout(tntTree.layout.vertical().width(window.innerWidth * scaleFactor)
			.scale(false))
		tree.update()
		scaled = false
		textUpdate.text('Turn On Scaling')
	}
	else {
		tree.layout(tntTree.layout.radial().width(Math.min(window.innerWidth * scaleFactor, window.innerHeight * scaleFactor))
			.scale(false))
		tree.update()
		scaled = false
		textUpdate.text('Turn On Scaling')
	}
}
/**
 * Toggles on/off the scaling of the tree and changes the text in the controlBar to
 * correspond with this change. Also updates all related local variables.
 *
 * @param {any} tree The tree to be modified.
 */
Toggles on/off the scaling of the tree and changes the text in the controlBar to
correspond with this change. Also updates all related local variables.

@param {any} tree The tree to be modified.
Toggles on / off the scaling of the tree and changes the text in the controlBar to correspond with this change . Also updates all related local variables . @param { any } tree The tree to be modified .
function updateScale(tree) {
	let textUpdate = d3.select('.scalingOption')
	if (currentState === 'vertical' && scaled === false) {
		tree.layout(tntTree.layout.vertical().width(window.innerWidth * scaleFactor)
			.scale(true))
		tree.update()
		scaled = true
		textUpdate.text('Turn Off Scaling')
	}
	else if (currentState === 'radial' && scaled === false) {
		tree.layout(tntTree.layout.radial().width(Math.min(window.innerWidth * scaleFactor, window.innerHeight * scaleFactor))
			.scale(true))
		tree.update()
		scaled = true
		textUpdate.text('Turn Off Scaling')
	}
	else if (currentState === 'vertical' && scaled === true) {
		tree.layout(tntTree.layout.vertical().width(window.innerWidth * scaleFactor)
			.scale(false))
		tree.update()
		scaled = false
		textUpdate.text('Turn On Scaling')
	}
	else {
		tree.layout(tntTree.layout.radial().width(Math.min(window.innerWidth * scaleFactor, window.innerHeight * scaleFactor))
			.scale(false))
		tree.update()
		scaled = false
		textUpdate.text('Turn On Scaling')
	}
}
function updateScale ( tree ) { let textUpdate = d3 . select ( '.scalingOption' ) if ( currentState === 'vertical' && scaled === false ) { tree . layout ( tntTree . layout . vertical ( ) . width ( window . innerWidth * scaleFactor ) . scale ( true ) ) tree . update ( ) scaled = true textUpdate . text ( 'Turn Off Scaling' ) } else if ( currentState === 'radial' && scaled === false ) { tree . layout ( tntTree . layout . radial ( ) . width ( Math . min ( window . innerWidth * scaleFactor , window . innerHeight * scaleFactor ) ) . scale ( true ) ) tree . update ( ) scaled = true textUpdate . text ( 'Turn Off Scaling' ) } else if ( currentState === 'vertical' && scaled === true ) { tree . layout ( tntTree . layout . vertical ( ) . width ( window . innerWidth * scaleFactor ) . scale ( false ) ) tree . update ( ) scaled = false textUpdate . text ( 'Turn On Scaling' ) } else { tree . layout ( tntTree . layout . radial ( ) . width ( Math . min ( window . innerWidth * scaleFactor , window . innerHeight * scaleFactor ) ) . scale ( false ) ) tree . update ( ) scaled = false textUpdate . text ( 'Turn On Scaling' ) } }
Toggles on/off the scaling of the tree and changes the text in the controlBar to
 correspond with this change.
Toggles on / off the scaling of the tree and changes the text in the controlBar to correspond with this change .