Last active
March 21, 2024 04:14
-
-
Save btakita/7be6e4dc61764775cbd4751c6c8f5196 to your computer and use it in GitHub Desktop.
https://issemantic.net/ visualization helper scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use these utility functions in the developer console. | |
* url__update & snippet__update will load the document & start the visualizer. | |
* These functions will make the visualizer UI taller & scroll to the top of the visualizer. | |
* | |
* ```js | |
* url__update('https://example.com') | |
?* snippet__update('Your HTML') | |
* ``` | |
*/ | |
/** @see {https://issemantic.net/rdf-visualizer} */ | |
globalThis.url__update = url=>{ | |
$('[href="#websearch"]').trigger('click') | |
document.querySelector('[name=input][value=mixed]').checked = true | |
const page_val = document.querySelector('#page-val') | |
page_val.value = url | |
document.querySelector('#page-btn').dispatchEvent(new MouseEvent('click')) | |
setTimeout(()=>{ | |
sd_svg__full_height() | |
}, 1000) | |
setTimeout(()=>{ | |
force__stop() | |
}, 5_000) | |
} | |
globalThis.snippet__update = snippet=>{ | |
$('[href="#snippet"]').trigger('click') | |
document.querySelector('[name=input][value=mixed]').checked = true | |
const page_val = document.querySelector('#snippet-data') | |
page_val.value = snippet | |
document.querySelector('#snippet-btn').dispatchEvent(new MouseEvent('click')) | |
setTimeout(()=>{ | |
sd_svg__full_height() | |
}, 1000) | |
setTimeout(()=>{ | |
force__stop() | |
}, 5_000) | |
} | |
globalThis.force__stop = ()=>{ | |
force.stop() | |
} | |
globalThis.sd_svg__full_height = ()=>{ | |
const sd_svg = document.querySelector('#svg-cont') | |
const sd_svg_parent = sd_svg.parentElement | |
sd_svg_parent.style.height = '100dvh' | |
const sd_svg_style = sd_svg.style | |
sd_svg_style.height = '100dvh' | |
sd_svg_style.maxHeight = '100dvh' | |
document.querySelector('#sd-svg').style.height = '100dvh' | |
setTimeout(()=>{ | |
window.scrollTo(0, window.scrollY + sd_svg_parent.getBoundingClientRect().top) | |
}, 1000) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(()=>{globalThis.url__update = url=>{$('[href="#websearch"]').trigger('click');document.querySelector('[name=input][value=mixed]').checked = true;const page_val = document.querySelector('#page-val');page_val.value = url;document.querySelector('#page-btn').dispatchEvent(new MouseEvent('click'));setTimeout(()=>sd_svg__full_height(), 1000);setTimeout(()=>force__stop(), 5_000);};globalThis.snippet__update = snippet=>{$('[href="#snippet"]').trigger('click');document.querySelector('[name=input][value=mixed]').checked = true;const page_val = document.querySelector('#snippet-data');page_val.value = snippet;document.querySelector('#snippet-btn').dispatchEvent(new MouseEvent('click'));setTimeout(()=>sd_svg__full_height(), 1000);setTimeout(()=>force__stop(), 5_000);};globalThis.force__stop = ()=>force.stop();globalThis.sd_svg__full_height = ()=>{const sd_svg = document.querySelector('#svg-cont');const sd_svg_parent = sd_svg.parentElement;sd_svg_parent.style.height = '100dvh';const sd_svg_style = sd_svg.style;sd_svg_style.height = '100dvh';sd_svg_style.maxHeight = '100dvh';document.querySelector('#sd-svg').style.height = '100dvh';setTimeout(()=>window.scrollTo(0, window.scrollY + sd_svg_parent.getBoundingClientRect().top), 1000)}})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment