diff --git a/webassets/iframe_visavis.html b/webassets/iframe_visavis.html index f389826..d7e5b33 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);