From 2185beb636afb675db61033be675728ee05c360b Mon Sep 17 00:00:00 2001 From: stan-donarise Date: Mon, 24 Feb 2025 18:11:21 +0300 Subject: [PATCH 1/2] click handlers --- webassets/iframe_visavis.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/webassets/iframe_visavis.html b/webassets/iframe_visavis.html index f389826..96a03b0 100644 --- a/webassets/iframe_visavis.html +++ b/webassets/iframe_visavis.html @@ -104,6 +104,33 @@ document.getElementById('main').innerHTML = ''; window.plot = document.getElementsByTagName('mpds-visavis-plot')[0].view; window.plot.notify = (msg) => window.parent.wmgui.notify(msg); + window.plot.matrix_click = ({cmt}) => { + const uri = window.location.protocol + "//" + window.location.host + window.location.pathname + '#search/binary%20' + cmt; + window.open(uri); + } + window.plot.bar_click = ({facet, value}) => { + window.location.hash = window.parent.wmgui.aug_search_cmd(facet, value); + } + window.plot.pie_click = ({facet, value}) => { + window.location.hash = window.parent.wmgui.aug_search_cmd(facet, value); + } + window.plot.graph_click = ({facet, label}) => { + let value = label; + if (facet == 'codens') { + value = label.split("'")[0]; // FIXME years lost + } else if (facet == 'formulae') { + value = window.parent.wmgui.termify_formulae(label.split(",")[0]); + } + window.location.hash = window.parent.wmgui.aug_search_cmd(facet, value); + } + window.plot.discovery_click = ({label}) => { + const uri = window.location.protocol + "//" + window.location.host + window.location.pathname + window.parent.wmgui.aug_search_cmd("elements", label); + window.open(uri); + } + window.plot.cube_click = ({label}) => { + const uri = window.location.protocol + "//" + window.location.host + window.location.pathname + '#search/' + label; + window.open(uri); + } if (!keep_state){ window.plot.json_request(url); From 28acbf99b9a081a8dced755a0fd9064cab4ee7ef Mon Sep 17 00:00:00 2001 From: stan-donarise Date: Mon, 24 Feb 2025 18:12:48 +0300 Subject: [PATCH 2/2] Update iframe_visavis.html --- webassets/iframe_visavis.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webassets/iframe_visavis.html b/webassets/iframe_visavis.html index 96a03b0..d7e5b33 100644 --- a/webassets/iframe_visavis.html +++ b/webassets/iframe_visavis.html @@ -104,7 +104,7 @@ document.getElementById('main').innerHTML = ''; window.plot = document.getElementsByTagName('mpds-visavis-plot')[0].view; window.plot.notify = (msg) => window.parent.wmgui.notify(msg); - window.plot.matrix_click = ({cmt}) => { + window.plot.matrix_click = ({cmt}) => { const uri = window.location.protocol + "//" + window.location.host + window.location.pathname + '#search/binary%20' + cmt; window.open(uri); } @@ -117,9 +117,9 @@ window.plot.graph_click = ({facet, label}) => { let value = label; if (facet == 'codens') { - value = label.split("'")[0]; // FIXME years lost + value = label.split("'")[0]; // FIXME years lost } else if (facet == 'formulae') { - value = window.parent.wmgui.termify_formulae(label.split(",")[0]); + value = window.parent.wmgui.termify_formulae(label.split(",")[0]); } window.location.hash = window.parent.wmgui.aug_search_cmd(facet, value); }