Skip to content

Commit

Permalink
demo: restore tests of enableLevelOfDetail (#146)
Browse files Browse the repository at this point in the history
* demo: restore tests of enableLevelOfDetail     
* demo: Allow to disable/enable levelofdetail for demo tests; currently the dynamic css interferes with the other nads in the page, so allow to reload the page with or without it so that we can still test it

Signed-off-by: HARPER Jon <[email protected]>
  • Loading branch information
jonenst authored Jan 15, 2025
1 parent a85f70d commit 83abdf6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions demo/src/diagram-viewers/add-diagrams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ export const addNadToDemo = () => {
.setAttribute('style', 'border:2px; border-style:solid;');
});

const enableLevelOfDetail: boolean =
new URLSearchParams(window.location.search).get('enableLevelOfDetail') === 'true';

fetch(NadSvgPartialNetworkExample)
.then((response) => response.text())
.then((svgContent) => {
Expand All @@ -268,15 +271,21 @@ export const addNadToDemo = () => {
handleTextNodeMove,
handleNodeSelect,
true,
false,
enableLevelOfDetail,
null,
handleToggleNadHover
);

document
.getElementById('svg-container-nad-partial-network')
const svgContainerNadPartialNetwork = document.getElementById('svg-container-nad-partial-network');

svgContainerNadPartialNetwork
?.getElementsByTagName('svg')[0]
.setAttribute('style', 'border:2px; border-style:solid;');

svgContainerNadPartialNetwork.insertAdjacentHTML(
'afterbegin',
`<p>enableLevelOfDetail=${enableLevelOfDetail}, <a href=".?enableLevelOfDetail=${!enableLevelOfDetail}">reload toggle enableLevelOfDetail</a></p>`
);
});
};

Expand Down

0 comments on commit 83abdf6

Please sign in to comment.