diff --git a/src/routes/etf/[tickerID]/+layout.svelte b/src/routes/etf/[tickerID]/+layout.svelte index 3a269eac..9165a76c 100644 --- a/src/routes/etf/[tickerID]/+layout.svelte +++ b/src/routes/etf/[tickerID]/+layout.svelte @@ -69,6 +69,7 @@ const sectionMap = { insider: "/insider", options: "/options", + "dark-pool": "/dark-pool", dividends: "/dividends", holdings: "/holdings", history: "/history", @@ -344,6 +345,7 @@ const sectionMap = { holdings: "holdings", options: "options", + "dark-pool": "dark-pool", insider: "insider", dividends: "dividends", history: "history", @@ -881,6 +883,17 @@ > Holdings + + changeSection("dark-pool")} + class="p-2 px-5 cursor-pointer {displaySection === + 'dark-pool' + ? 'text-white bg-secondary sm:hover:bg-opacity-[0.95] font-semibold' + : 'text-gray-400 sm:hover:text-white sm:hover:bg-secondary sm:hover:bg-opacity-[0.95]'}" + > + Dark Pool + changeSection("options")} diff --git a/src/routes/heatmap/+page.svelte b/src/routes/heatmap/+page.svelte index d01caeac..33345d36 100644 --- a/src/routes/heatmap/+page.svelte +++ b/src/routes/heatmap/+page.svelte @@ -12,40 +12,27 @@ let selectedFormat: "png" | "jpeg" | "svg" = "png"; let selectedTimePeriod = "1D"; let iframeUrl: string; - let loading = true; async function getHeatMap() { - loading = true; - try { - const cachedData = getCache(selectedTimePeriod, "getHeatmap"); - if (cachedData) { - rawData = cachedData; - } else { - const postData = { params: selectedTimePeriod }; - const response = await fetch("/api/heatmap", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(postData), - }); + const cachedData = getCache(selectedTimePeriod, "getHeatmap"); + if (cachedData) { + rawData = cachedData; + } else { + const postData = { params: selectedTimePeriod }; + const response = await fetch("/api/heatmap", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(postData), + }); - rawData = await response.json(); - setCache(selectedTimePeriod, rawData, "getHeatmap"); - } - - const htmlContent = rawData; - - const blob = new Blob([htmlContent], { type: "text/html" }); - if (iframeUrl) { - URL.revokeObjectURL(iframeUrl); - } - iframeUrl = URL.createObjectURL(blob); - } catch (error) { - console.error("Error loading heatmap:", error); - } finally { - loading = false; + rawData = await response.json(); + setCache(selectedTimePeriod, rawData, "getHeatmap"); } + + const blob = new Blob([rawData], { type: "text/html" }); + iframeUrl = URL.createObjectURL(blob); } async function downloadPlot(item) { @@ -105,6 +92,10 @@ } + + + +
- {#if loading} -
-
-
- {/if} - {#if rawData}