diff --git a/src/routes/etf/[tickerID]/options/+page.svelte b/src/routes/etf/[tickerID]/options/+page.svelte index 38e86320..ee4d5960 100644 --- a/src/routes/etf/[tickerID]/options/+page.svelte +++ b/src/routes/etf/[tickerID]/options/+page.svelte @@ -39,7 +39,7 @@ let activeIdx = 0; body: JSON.stringify(postData), }); - output = await response?.json(); + output = await response.json(); setCache(transactionId, output, "getDailyTransactions"); } @@ -59,7 +59,6 @@ let activeIdx = 0; let rawData = data?.getOptionsHistoricalData; let optionList = rawData?.slice(0,30); let optionChainList = data?.getOptionsChainData?.at(0)?.chain || []; - let totalVolume //= data?.getOptionsPlotData?.totalVolume; @@ -82,21 +81,6 @@ let activeIdx = 0; let displayTimePeriod = 'threeMonths' -function normalizer(value) { - if (Math?.abs(value) >= 1e18) { - return { unit: 'Q', denominator: 1e18 }; - } else if (Math?.abs(value) >= 1e12) { - return { unit: 'T', denominator: 1e12 }; - } else if (Math?.abs(value) >= 1e9) { - return { unit: 'B', denominator: 1e9 }; - } else if (Math?.abs(value) >= 1e6) { - return { unit: 'M', denominator: 1e6 }; - } else if (Math?.abs(value) >= 1e5) { - return { unit: 'K', denominator: 1e5 }; - } else { - return { unit: '', denominator: 1 }; - } -} function formatDate(dateStr) { // Parse the input date string (YYYY-mm-dd) @@ -180,15 +164,26 @@ function plotData(callData, putData) { } ], yAxis: [ - { - type: 'value', - splitLine: { - show: false, - }, - axisLabel: { - show: false // Hide the y-axis label - } - } + { + type: 'value', + splitLine: { + show: false, // Disable x-axis grid lines + }, + + axisLabel: { + show: false // Hide y-axis labels + } + }, + { + type: 'value', + splitLine: { + show: false, // Disable x-axis grid lines + }, + position: 'right', + axisLabel: { + show: false // Hide y-axis labels + }, + }, ], series: [ { @@ -233,8 +228,6 @@ function getEXPlot(state) { }); - const {unit, denominator } = normalizer(Math.max(...valueList) ?? 0) - const option = { silent: true, @@ -267,41 +260,25 @@ function getEXPlot(state) { } }, yAxis: [ - { + { type: 'value', splitLine: { show: false, // Disable x-axis grid lines }, - position: 'left', - axisLabel: { - color: '#fff', - formatter: function (value, index) { - if (index % 2 === 0) { - return value?.toFixed(2); // Format the sentiment value - } else { - return ''; // Hide this tick - } - } + + axisLabel: { + show: false // Hide y-axis labels } }, { - position: 'right', type: 'value', splitLine: { show: false, // Disable x-axis grid lines }, + position: 'right', axisLabel: { - color: '#fff', // Change label color to white - formatter: function (value, index) { - // Display every second tick - if (index % 2 === 0) { - value = Math.max(value, 0); - return (value / denominator)?.toFixed(1) + unit; // Format value in millions - } else { - return ''; // Hide this tick - } - } - }, + show: false // Hide y-axis labels + }, }, ], series: [ @@ -316,7 +293,7 @@ function getEXPlot(state) { showSymbol: false }, { - name: 'GEX', + name: state?.toUpperCase(), data: valueList, type: 'bar', yAxisIndex: 1, @@ -553,7 +530,7 @@ $: {
-
+

Unsual Options Activity diff --git a/src/routes/stocks/[tickerID]/insider/+page.svelte b/src/routes/stocks/[tickerID]/insider/+page.svelte index 555e8404..b30858a9 100644 --- a/src/routes/stocks/[tickerID]/insider/+page.svelte +++ b/src/routes/stocks/[tickerID]/insider/+page.svelte @@ -106,11 +106,11 @@ const transactionStyles = { -
-
-
-
-
+
+
+
+
+

Insider Trading

@@ -125,36 +125,6 @@ const transactionStyles = { No trading history available for {$displayCompanyName}. Likely no insider trading has happened yet. {/if}
- - {#if insiderTradingList?.length !== 0} - - {/if}
@@ -162,55 +132,7 @@ const transactionStyles = { {#if insiderTradingList?.length !== 0} - + {#if Object?.keys(statistics)?.length !== 0 } diff --git a/src/routes/stocks/[tickerID]/options/+page.svelte b/src/routes/stocks/[tickerID]/options/+page.svelte index 6492f17b..ae26f15e 100644 --- a/src/routes/stocks/[tickerID]/options/+page.svelte +++ b/src/routes/stocks/[tickerID]/options/+page.svelte @@ -81,21 +81,6 @@ let activeIdx = 0; let displayTimePeriod = 'threeMonths' -function normalizer(value) { - if (Math?.abs(value) >= 1e18) { - return { unit: 'Q', denominator: 1e18 }; - } else if (Math?.abs(value) >= 1e12) { - return { unit: 'T', denominator: 1e12 }; - } else if (Math?.abs(value) >= 1e9) { - return { unit: 'B', denominator: 1e9 }; - } else if (Math?.abs(value) >= 1e6) { - return { unit: 'M', denominator: 1e6 }; - } else if (Math?.abs(value) >= 1e5) { - return { unit: 'K', denominator: 1e5 }; - } else { - return { unit: '', denominator: 1 }; - } -} function formatDate(dateStr) { // Parse the input date string (YYYY-mm-dd) @@ -179,15 +164,26 @@ function plotData(callData, putData) { } ], yAxis: [ - { - type: 'value', - splitLine: { - show: false, - }, - axisLabel: { - show: false // Hide the y-axis label - } - } + { + type: 'value', + splitLine: { + show: false, // Disable x-axis grid lines + }, + + axisLabel: { + show: false // Hide y-axis labels + } + }, + { + type: 'value', + splitLine: { + show: false, // Disable x-axis grid lines + }, + position: 'right', + axisLabel: { + show: false // Hide y-axis labels + }, + }, ], series: [ { @@ -232,8 +228,6 @@ function getEXPlot(state) { }); - const {unit, denominator } = normalizer(Math.max(...valueList) ?? 0) - const option = { silent: true, @@ -266,41 +260,25 @@ function getEXPlot(state) { } }, yAxis: [ - { + { type: 'value', splitLine: { show: false, // Disable x-axis grid lines }, - position: 'left', - axisLabel: { - color: '#fff', - formatter: function (value, index) { - if (index % 2 === 0) { - return value?.toFixed(2); // Format the sentiment value - } else { - return ''; // Hide this tick - } - } + + axisLabel: { + show: false // Hide y-axis labels } }, { - position: 'right', type: 'value', splitLine: { show: false, // Disable x-axis grid lines }, + position: 'right', axisLabel: { - color: '#fff', // Change label color to white - formatter: function (value, index) { - // Display every second tick - if (index % 2 === 0) { - value = Math.max(value, 0); - return (value / denominator)?.toFixed(1) + unit; // Format value in millions - } else { - return ''; // Hide this tick - } - } - }, + show: false // Hide y-axis labels + }, }, ], series: [ @@ -315,7 +293,7 @@ function getEXPlot(state) { showSymbol: false }, { - name: 'GEX', + name: state?.toUpperCase(), data: valueList, type: 'bar', yAxisIndex: 1, @@ -552,7 +530,7 @@ $: {
-
+

Unsual Options Activity