<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://glioblastomatreatments.wiki:80/index.php?action=history&amp;feed=atom&amp;title=Plot</id>
	<title>Plot - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://glioblastomatreatments.wiki:80/index.php?action=history&amp;feed=atom&amp;title=Plot"/>
	<link rel="alternate" type="text/html" href="http://glioblastomatreatments.wiki:80/index.php?title=Plot&amp;action=history"/>
	<updated>2026-04-12T10:50:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://glioblastomatreatments.wiki:80/index.php?title=Plot&amp;diff=29501&amp;oldid=prev</id>
		<title>Lazy: Created page with &quot;&lt;div id=&quot;categories&quot;&gt;&lt;/div&gt; &lt;div id=&quot;plot&quot;&gt;&lt;/div&gt;  &lt;script src=&quot;https://cdn.plot.ly/plotly-latest.min.js&quot;&gt;&lt;/script&gt; &lt;script&gt;     // Fetch the JSON data from the query result page     fetch(&#039;https://glioblastomatreatments.wiki/index.php?title=Special:Ask/-5B-5BHas-20Usefulness-20Rating::%2B-5D-5D/-3FHas-20treatment-20name%3DTreatment-20Name/-3FHas-20Usefulness-20Rating%3DUsefulness-20Rating/-3FHas-20Toxicity-20Level%3DToxicity-20Level/-3FCategory/mainlabel%3D-2D/limit%3D1...&quot;</title>
		<link rel="alternate" type="text/html" href="http://glioblastomatreatments.wiki:80/index.php?title=Plot&amp;diff=29501&amp;oldid=prev"/>
		<updated>2024-05-30T03:55:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div id=&amp;quot;categories&amp;quot;&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;div id=&amp;quot;plot&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;  &amp;lt;script src=&amp;quot;https://cdn.plot.ly/plotly-latest.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;script&amp;gt;     // Fetch the JSON data from the query result page     fetch(&amp;#039;https://glioblastomatreatments.wiki/index.php?title=Special:Ask/-5B-5BHas-20Usefulness-20Rating::%2B-5D-5D/-3FHas-20treatment-20name%3DTreatment-20Name/-3FHas-20Usefulness-20Rating%3DUsefulness-20Rating/-3FHas-20Toxicity-20Level%3DToxicity-20Level/-3FCategory/mainlabel%3D-2D/limit%3D1...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div id=&amp;quot;categories&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;plot&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script src=&amp;quot;https://cdn.plot.ly/plotly-latest.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    // Fetch the JSON data from the query result page&lt;br /&gt;
    fetch(&amp;#039;https://glioblastomatreatments.wiki/index.php?title=Special:Ask/-5B-5BHas-20Usefulness-20Rating::%2B-5D-5D/-3FHas-20treatment-20name%3DTreatment-20Name/-3FHas-20Usefulness-20Rating%3DUsefulness-20Rating/-3FHas-20Toxicity-20Level%3DToxicity-20Level/-3FCategory/mainlabel%3D-2D/limit%3D100/offset%3D0/format%3Djson&amp;#039;)&lt;br /&gt;
    .then(response =&amp;gt; response.json())&lt;br /&gt;
    .then(data =&amp;gt; {&lt;br /&gt;
        const treatments = [];&lt;br /&gt;
        for (const [key, value] of Object.entries(data.results)) {&lt;br /&gt;
            treatments.push({&lt;br /&gt;
                treatment: value.printouts[&amp;#039;Treatment Name&amp;#039;][0].fulltext,&lt;br /&gt;
                effectiveness: parseInt(value.printouts[&amp;#039;Usefulness Rating&amp;#039;][0].fulltext),&lt;br /&gt;
                toxicity: parseInt(value.printouts[&amp;#039;Toxicity Level&amp;#039;][0].fulltext),&lt;br /&gt;
                category: value.printouts[&amp;#039;Category&amp;#039;][0].fulltext.replace(&amp;#039;Category:&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
            });&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        const categories = [...new Set(treatments.map(t =&amp;gt; t.category))];&lt;br /&gt;
&lt;br /&gt;
        // Create checkboxes for categories&lt;br /&gt;
        const categoriesDiv = document.getElementById(&amp;#039;categories&amp;#039;);&lt;br /&gt;
        categories.forEach(category =&amp;gt; {&lt;br /&gt;
            const label = document.createElement(&amp;#039;label&amp;#039;);&lt;br /&gt;
            const checkbox = document.createElement(&amp;#039;input&amp;#039;);&lt;br /&gt;
            checkbox.type = &amp;#039;checkbox&amp;#039;;&lt;br /&gt;
            checkbox.value = category;&lt;br /&gt;
            checkbox.checked = true;&lt;br /&gt;
            checkbox.addEventListener(&amp;#039;change&amp;#039;, updatePlot);&lt;br /&gt;
            label.appendChild(checkbox);&lt;br /&gt;
            label.appendChild(document.createTextNode(category));&lt;br /&gt;
            categoriesDiv.appendChild(label);&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        // Initial plot&lt;br /&gt;
        updatePlot();&lt;br /&gt;
&lt;br /&gt;
        function updatePlot() {&lt;br /&gt;
            const selectedCategories = Array.from(document.querySelectorAll(&amp;#039;#categories input[type=&amp;quot;checkbox&amp;quot;]:checked&amp;#039;)).map(cb =&amp;gt; cb.value);&lt;br /&gt;
&lt;br /&gt;
            const filteredTreatments = treatments.filter(t =&amp;gt; selectedCategories.includes(t.category));&lt;br /&gt;
&lt;br /&gt;
            const trace = {&lt;br /&gt;
                x: filteredTreatments.map(t =&amp;gt; t.effectiveness),&lt;br /&gt;
                y: filteredTreatments.map(t =&amp;gt; t.toxicity),&lt;br /&gt;
                mode: &amp;#039;markers&amp;#039;,&lt;br /&gt;
                type: &amp;#039;scatter&amp;#039;,&lt;br /&gt;
                text: filteredTreatments.map(t =&amp;gt; t.treatment),&lt;br /&gt;
                marker: { color: filteredTreatments.map(t =&amp;gt; categories.indexOf(t.category)) }&lt;br /&gt;
            };&lt;br /&gt;
&lt;br /&gt;
            const layout = {&lt;br /&gt;
                title: &amp;#039;Glioblastoma Treatments&amp;#039;,&lt;br /&gt;
                xaxis: { title: &amp;#039;Effectiveness&amp;#039; },&lt;br /&gt;
                yaxis: { title: &amp;#039;Toxicity&amp;#039;, autorange: &amp;#039;reversed&amp;#039; }&lt;br /&gt;
            };&lt;br /&gt;
&lt;br /&gt;
            Plotly.newPlot(&amp;#039;plot&amp;#039;, [trace], layout);&lt;br /&gt;
        }&lt;br /&gt;
    })&lt;br /&gt;
    .catch(error =&amp;gt; console.error(&amp;#039;Error fetching data:&amp;#039;, error));&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lazy</name></author>
	</entry>
</feed>