update dark pool page
This commit is contained in:
parent
7727c3e989
commit
b5bed6cfea
@ -4,6 +4,7 @@
|
|||||||
import { abbreviateNumber, removeCompanyStrings } from "$lib/utils";
|
import { abbreviateNumber, removeCompanyStrings } from "$lib/utils";
|
||||||
import highcharts from "$lib/highcharts.ts";
|
import highcharts from "$lib/highcharts.ts";
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
|
import { mode } from "mode-watcher";
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
export let rawData = [];
|
export let rawData = [];
|
||||||
@ -75,8 +76,8 @@
|
|||||||
},
|
},
|
||||||
chart: {
|
chart: {
|
||||||
type: "line",
|
type: "line",
|
||||||
backgroundColor: "#09090B",
|
backgroundColor: $mode === "light" ? "#fff" : "#09090B",
|
||||||
plotBackgroundColor: "#09090B",
|
plotBackgroundColor: $mode === "light" ? "#fff" : "#09090B",
|
||||||
height: 360,
|
height: 360,
|
||||||
spacingTop: 5,
|
spacingTop: 5,
|
||||||
animation: false,
|
animation: false,
|
||||||
@ -84,7 +85,7 @@
|
|||||||
title: {
|
title: {
|
||||||
text: `<h3 class="mt-3 mb-1 text-[1rem] sm:text-lg">${removeCompanyStrings($displayCompanyName)} Historical Chart</h3>`,
|
text: `<h3 class="mt-3 mb-1 text-[1rem] sm:text-lg">${removeCompanyStrings($displayCompanyName)} Historical Chart</h3>`,
|
||||||
style: {
|
style: {
|
||||||
color: "white",
|
color: $mode === "light" ? "black" : "white",
|
||||||
},
|
},
|
||||||
useHTML: true,
|
useHTML: true,
|
||||||
},
|
},
|
||||||
@ -96,13 +97,13 @@
|
|||||||
endOnTick: false,
|
endOnTick: false,
|
||||||
categories: dates,
|
categories: dates,
|
||||||
crosshair: {
|
crosshair: {
|
||||||
color: "#fff", // Set the color of the crosshair line
|
color: $mode === "light" ? "black" : "white", // Set the color of the crosshair line
|
||||||
width: 1, // Adjust the line width as needed
|
width: 1, // Adjust the line width as needed
|
||||||
dashStyle: "Solid",
|
dashStyle: "Solid",
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
style: {
|
style: {
|
||||||
color: "#fff",
|
color: $mode === "light" ? "black" : "white",
|
||||||
},
|
},
|
||||||
distance: 20, // Increases space between label and axis
|
distance: 20, // Increases space between label and axis
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
@ -118,7 +119,7 @@
|
|||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
gridLineWidth: 1,
|
gridLineWidth: 1,
|
||||||
gridLineColor: "#111827",
|
gridLineColor: $mode === "light" ? "#d1d5dc" : "#111827",
|
||||||
labels: {
|
labels: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
@ -149,8 +150,8 @@
|
|||||||
},
|
},
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
// Format the x value to display time in hh:mm format
|
// Format the x value to display time in a custom format
|
||||||
let tooltipContent = `<span class="text-white m-auto text-black text-[1rem] font-[501]">${new Date(
|
let tooltipContent = `<span class="m-auto text-[1rem] font-[501]">${new Date(
|
||||||
this?.x,
|
this?.x,
|
||||||
).toLocaleDateString("en-US", {
|
).toLocaleDateString("en-US", {
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
@ -160,10 +161,10 @@
|
|||||||
|
|
||||||
// Loop through each point in the shared tooltip
|
// Loop through each point in the shared tooltip
|
||||||
this.points.forEach((point) => {
|
this.points.forEach((point) => {
|
||||||
tooltipContent += `<span class="text-white font-semibold text-sm">${point.series.name}:</span>
|
tooltipContent += `
|
||||||
<span class="text-white font-normal text-sm" style="color:${point.color}">${abbreviateNumber(
|
<span style="display:inline-block; width:10px; height:10px; background-color:${point.color}; border-radius:50%; margin-right:5px;"></span>
|
||||||
point.y,
|
<span class="font-semibold text-sm">${point.series.name}:</span>
|
||||||
)}</span><br>`;
|
<span class="font-normal text-sm">${abbreviateNumber(point.y)}</span><br>`;
|
||||||
});
|
});
|
||||||
|
|
||||||
return tooltipContent;
|
return tooltipContent;
|
||||||
@ -185,7 +186,7 @@
|
|||||||
name: "Total Volume",
|
name: "Total Volume",
|
||||||
data: totalVolumeList,
|
data: totalVolumeList,
|
||||||
type: "line",
|
type: "line",
|
||||||
color: "#fff",
|
color: $mode === "light" ? "#2C6288" : "white",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Short Volume",
|
name: "Short Volume",
|
||||||
@ -236,17 +237,17 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if ($stockTicker || $etfTicker) {
|
$: if ($stockTicker || $etfTicker || $mode) {
|
||||||
config = getPlotOptions() || null;
|
config = getPlotOptions() || null;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="overflow-hidden text-white h-full pb-8">
|
<section class="overflow-hidden h-full pb-8">
|
||||||
<main class="overflow-hidden">
|
<main class="overflow-hidden">
|
||||||
<div class="flex flex-row items-center">
|
<div class="flex flex-row items-center">
|
||||||
<label
|
<label
|
||||||
for="historicalDataInfo"
|
for="historicalDataInfo"
|
||||||
class="mr-1 cursor-pointer flex flex-row items-center text-white text-xl sm:text-2xl font-bold"
|
class="mr-1 cursor-pointer flex flex-row items-center text-xl sm:text-2xl font-bold"
|
||||||
>
|
>
|
||||||
Historical Chart
|
Historical Chart
|
||||||
</label>
|
</label>
|
||||||
@ -259,7 +260,7 @@
|
|||||||
|
|
||||||
{#if rawData?.length !== 0}
|
{#if rawData?.length !== 0}
|
||||||
<div class="w-full flex flex-col items-start">
|
<div class="w-full flex flex-col items-start">
|
||||||
<div class="text-white text-[1rem] mt-2 mb-2 w-full">
|
<div class=" text-[1rem] mt-2 mb-2 w-full">
|
||||||
Over the past 12 months, {$displayCompanyName} has experienced an average
|
Over the past 12 months, {$displayCompanyName} has experienced an average
|
||||||
dark pool trading volume of
|
dark pool trading volume of
|
||||||
<span class="font-semibold">{abbreviateNumber(avgVolume)}</span>
|
<span class="font-semibold">{abbreviateNumber(avgVolume)}</span>
|
||||||
@ -273,14 +274,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="chart mt-5 sm:mt-0 border border-gray-800 rounded"
|
class="chart mt-5 sm:mt-0 border border-gray-300 dark:border-gray-800 rounded"
|
||||||
use:highcharts={config}
|
use:highcharts={config}
|
||||||
></div>
|
></div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="mt-5 flex flex-col sm:flex-row items-start sm:items-center w-full justify-between sm:border-y border-gray-800 sm:pt-2 sm:pb-2"
|
class="mt-5 flex flex-col sm:flex-row items-start sm:items-center w-full justify-between sm:border-y border-gray-300 dark:border-gray-800 sm:pt-2 sm:pb-2"
|
||||||
>
|
>
|
||||||
<h3 class="text-xl sm:text-2xl text-white font-bold mb-2 sm:mb-0">
|
<h3 class="text-xl sm:text-2xl font-bold mb-2 sm:mb-0">
|
||||||
Dark Pool Table
|
Dark Pool Table
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
@ -288,7 +289,7 @@
|
|||||||
class="inline-flex justify-center w-full rounded-md sm:w-auto sm:ml-auto"
|
class="inline-flex justify-center w-full rounded-md sm:w-auto sm:ml-auto"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="bg-secondary w-full min-w-24 sm:w-fit relative flex flex-wrap items-center justify-center rounded-md p-1"
|
class="bg-gray-300 dark:bg-secondary w-full min-w-24 sm:w-fit relative flex flex-wrap items-center justify-center rounded-md p-1"
|
||||||
>
|
>
|
||||||
{#each tabs as item, i}
|
{#each tabs as item, i}
|
||||||
{#if data?.user?.tier !== "Pro" && i > 0}
|
{#if data?.user?.tier !== "Pro" && i > 0}
|
||||||
@ -303,7 +304,7 @@
|
|||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
><path
|
><path
|
||||||
fill="#A3A3A3"
|
fill="currentColor"
|
||||||
d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"
|
d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"
|
||||||
/></svg
|
/></svg
|
||||||
>
|
>
|
||||||
@ -324,7 +325,7 @@
|
|||||||
class="relative text-sm block font-semibold whitespace-nowrap {activeIdx ===
|
class="relative text-sm block font-semibold whitespace-nowrap {activeIdx ===
|
||||||
i
|
i
|
||||||
? 'text-black'
|
? 'text-black'
|
||||||
: 'text-white'}"
|
: ''}"
|
||||||
>
|
>
|
||||||
{item.title}
|
{item.title}
|
||||||
</span>
|
</span>
|
||||||
@ -337,18 +338,14 @@
|
|||||||
|
|
||||||
<div class="w-full overflow-x-auto">
|
<div class="w-full overflow-x-auto">
|
||||||
<table
|
<table
|
||||||
class="table table-sm table-compact bg-table border border-gray-800 rounded-none sm:rounded-md w-full m-auto mt-4"
|
class="table table-sm table-compact no-scrollbar rounded-none sm:rounded-md w-full bg-white dark:bg-table border border-gray-300 dark:border-gray-800 m-auto"
|
||||||
>
|
>
|
||||||
<thead class="bg-default">
|
<thead class="text-muted dark:text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-white font-semibold text-start text-sm">Date</th>
|
<th class=" font-semibold text-start text-sm">Date</th>
|
||||||
<th class="text-white font-semibold text-end text-sm"
|
<th class=" font-semibold text-end text-sm">Total Volume</th>
|
||||||
>Total Volume</th
|
<th class=" font-semibold text-end text-sm">Short Volume</th>
|
||||||
>
|
<th class=" font-semibold text-end text-sm"
|
||||||
<th class="text-white font-semibold text-end text-sm"
|
|
||||||
>Short Volume</th
|
|
||||||
>
|
|
||||||
<th class="text-white font-semibold text-end text-sm"
|
|
||||||
>% Short Volume Change</th
|
>% Short Volume Change</th
|
||||||
>
|
>
|
||||||
</tr>
|
</tr>
|
||||||
@ -357,9 +354,9 @@
|
|||||||
{#each tableList as item, index}
|
{#each tableList as item, index}
|
||||||
<!-- row -->
|
<!-- row -->
|
||||||
<tr
|
<tr
|
||||||
class="dark:sm:hover:bg-[#245073]/10 odd:bg-[#F6F7F8] dark:odd:bg-oddborder-b border-gray-800"
|
class="dark:sm:hover:bg-[#245073]/10 odd:bg-[#F6F7F8] dark:odd:bg-odd"
|
||||||
>
|
>
|
||||||
<td class="text-white text-sm sm:text-[1rem] whitespace-nowrap">
|
<td class=" text-sm sm:text-[1rem] whitespace-nowrap">
|
||||||
{new Date(item?.date)?.toLocaleDateString("en-US", {
|
{new Date(item?.date)?.toLocaleDateString("en-US", {
|
||||||
day: "2-digit", // Include day number
|
day: "2-digit", // Include day number
|
||||||
month: "short", // Display short month name
|
month: "short", // Display short month name
|
||||||
@ -368,20 +365,18 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td
|
<td
|
||||||
class="text-white text-sm sm:text-[1rem] text-right whitespace-nowrap"
|
class=" text-sm sm:text-[1rem] text-right whitespace-nowrap"
|
||||||
>
|
>
|
||||||
{abbreviateNumber(item?.totalVolume)}
|
{abbreviateNumber(item?.totalVolume)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td
|
<td
|
||||||
class="text-white text-sm sm:text-[1rem] text-right whitespace-nowrap"
|
class=" text-sm sm:text-[1rem] text-right whitespace-nowrap"
|
||||||
>
|
>
|
||||||
{abbreviateNumber(item?.shortVolume)}
|
{abbreviateNumber(item?.shortVolume)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td
|
<td class=" text-sm sm:text-[1rem] whitespace-nowrap text-end">
|
||||||
class="text-white text-sm sm:text-[1rem] whitespace-nowrap text-end"
|
|
||||||
>
|
|
||||||
{#if index === tableList?.length - 1}
|
{#if index === tableList?.length - 1}
|
||||||
n/a
|
n/a
|
||||||
{:else if item?.shortVolume > tableList[index + 1]?.shortVolume}
|
{:else if item?.shortVolume > tableList[index + 1]?.shortVolume}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
import InfoModal from "$lib/components/InfoModal.svelte";
|
import InfoModal from "$lib/components/InfoModal.svelte";
|
||||||
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
||||||
|
|
||||||
import { abbreviateNumberWithColor } from "$lib/utils";
|
import { abbreviateNumber } from "$lib/utils";
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
export let rawData = [];
|
export let rawData = [];
|
||||||
@ -120,12 +120,12 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="overflow-hidden text-white h-full pb-8">
|
<section class="overflow-hidden h-full pb-8">
|
||||||
<main class="overflow-hidden">
|
<main class="overflow-hidden">
|
||||||
<div class="flex flex-row items-center">
|
<div class="flex flex-row items-center">
|
||||||
<label
|
<label
|
||||||
for="hottestDPTrade"
|
for="hottestDPTrade"
|
||||||
class="mr-1 cursor-pointer flex flex-row items-center text-white text-xl sm:text-2xl font-bold"
|
class="mr-1 cursor-pointer flex flex-row items-center text-xl sm:text-2xl font-bold"
|
||||||
>
|
>
|
||||||
Hottest Trades
|
Hottest Trades
|
||||||
</label>
|
</label>
|
||||||
@ -138,7 +138,7 @@
|
|||||||
|
|
||||||
{#if rawData?.length !== 0}
|
{#if rawData?.length !== 0}
|
||||||
<div class="w-full flex flex-col items-start">
|
<div class="w-full flex flex-col items-start">
|
||||||
<div class="text-white text-[1rem] mt-2 mb-2 w-full">
|
<div class=" text-[1rem] mt-2 mb-2 w-full">
|
||||||
Get in realtime the latest hottest trades based on premium.
|
Get in realtime the latest hottest trades based on premium.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -147,7 +147,7 @@
|
|||||||
class="w-full m-auto rounded-none sm:rounded-md mb-4 overflow-x-auto"
|
class="w-full m-auto rounded-none sm:rounded-md mb-4 overflow-x-auto"
|
||||||
>
|
>
|
||||||
<table
|
<table
|
||||||
class="table table-sm table-compact no-scrollbar rounded-none sm:rounded-md text-white w-full bg-table border border-gray-800 m-auto"
|
class="table table-sm table-compact no-scrollbar rounded-none sm:rounded-md w-full bg-white dark:bg-table border border-gray-300 dark:border-gray-800 m-auto"
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<TableHeader {columns} {sortOrders} {sortData} />
|
<TableHeader {columns} {sortOrders} {sortData} />
|
||||||
@ -155,36 +155,30 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{#each stockList as item, index}
|
{#each stockList as item, index}
|
||||||
<tr
|
<tr
|
||||||
class="sm:hover:bg-[#245073]/10 border-b border-gray-800 odd:bg-odd {index +
|
class="dark:sm:hover:bg-[#245073]/10 odd:bg-[#F6F7F8] dark:odd:bg-odd {index +
|
||||||
1 ===
|
1 ===
|
||||||
rawData?.length && !['Pro']?.includes(data?.user?.tier)
|
rawData?.length && !['Pro']?.includes(data?.user?.tier)
|
||||||
? 'opacity-[0.1]'
|
? 'opacity-[0.1]'
|
||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
<td
|
<td class="text-start text-sm sm:text-[1rem] whitespace-nowrap">
|
||||||
class="text-start text-sm sm:text-[1rem] whitespace-nowrap text-white"
|
|
||||||
>
|
|
||||||
{item?.rank}
|
{item?.rank}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td
|
<td class="text-start text-sm sm:text-[1rem] whitespace-nowrap">
|
||||||
class="text-start text-sm sm:text-[1rem] whitespace-nowrap text-white"
|
|
||||||
>
|
|
||||||
{formatToNewYorkTime(item?.date)}
|
{formatToNewYorkTime(item?.date)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td
|
<td class="text-end text-sm sm:text-[1rem] whitespace-nowrap">
|
||||||
class="text-end text-sm sm:text-[1rem] whitespace-nowrap text-white"
|
|
||||||
>
|
|
||||||
{item?.price}
|
{item?.price}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-sm sm:text-[1rem] text-end">
|
<td class="text-sm sm:text-[1rem] text-end">
|
||||||
{@html abbreviateNumberWithColor(item?.size, false, true)}
|
{abbreviateNumber(item?.size, false, true)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-sm sm:text-[1rem] text-end">
|
<td class="text-sm sm:text-[1rem] text-end">
|
||||||
{@html abbreviateNumberWithColor(item?.volume, false, true)}
|
{abbreviateNumber(item?.volume, false, true)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-sm sm:text-[1rem] text-end">
|
<td class="text-sm sm:text-[1rem] text-end">
|
||||||
@ -195,7 +189,7 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-sm sm:text-[1rem] text-end">
|
<td class="text-sm sm:text-[1rem] text-end">
|
||||||
{@html abbreviateNumberWithColor(item?.premium, false, true)}
|
{abbreviateNumber(item?.premium, false, true)}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { displayCompanyName, stockTicker, etfTicker } from "$lib/store";
|
import { displayCompanyName, stockTicker, etfTicker } from "$lib/store";
|
||||||
import { abbreviateNumber, abbreviateNumberWithColor } from "$lib/utils";
|
import { abbreviateNumber } from "$lib/utils";
|
||||||
import highcharts from "$lib/highcharts.ts";
|
import highcharts from "$lib/highcharts.ts";
|
||||||
import RealtimeTrade from "$lib/components/DarkPool/RealtimeTrade.svelte";
|
import RealtimeTrade from "$lib/components/DarkPool/RealtimeTrade.svelte";
|
||||||
|
import { mode } from "mode-watcher";
|
||||||
|
|
||||||
let category = "Today's Trend";
|
let category = "Today's Trend";
|
||||||
|
|
||||||
@ -21,13 +22,17 @@
|
|||||||
|
|
||||||
// Create colors array with highlighted bar
|
// Create colors array with highlighted bar
|
||||||
const colors = xAxis?.map((value, index) =>
|
const colors = xAxis?.map((value, index) =>
|
||||||
index === maxValueIndex ? "#3BA272" : "#e2e8f0",
|
index === maxValueIndex
|
||||||
|
? "#3BA272"
|
||||||
|
: $mode === "light"
|
||||||
|
? "#2C6288"
|
||||||
|
: "#e2e8f0",
|
||||||
);
|
);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
chart: {
|
chart: {
|
||||||
type: "column",
|
type: "column",
|
||||||
backgroundColor: "#09090B",
|
backgroundColor: $mode === "light" ? "#fff" : "#09090B",
|
||||||
animation: false,
|
animation: false,
|
||||||
height: 360,
|
height: 360,
|
||||||
},
|
},
|
||||||
@ -36,19 +41,19 @@
|
|||||||
title: {
|
title: {
|
||||||
text: `<h3 class="mt-3 mb-1 text-[1rem] sm:text-lg">Dark Pool Price Levels</h3>`,
|
text: `<h3 class="mt-3 mb-1 text-[1rem] sm:text-lg">Dark Pool Price Levels</h3>`,
|
||||||
useHTML: true,
|
useHTML: true,
|
||||||
style: { color: "white" },
|
style: { color: $mode === "light" ? "black" : "white" },
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
endonTick: false,
|
endonTick: false,
|
||||||
categories: yAxis,
|
categories: yAxis,
|
||||||
crosshair: {
|
crosshair: {
|
||||||
color: "#fff", // Set the color of the crosshair line
|
color: $mode === "light" ? "black" : "white", // Set the color of the crosshair line
|
||||||
width: 1, // Adjust the line width as needed
|
width: 1, // Adjust the line width as needed
|
||||||
dashStyle: "Solid",
|
dashStyle: "Solid",
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
style: {
|
style: {
|
||||||
color: "#fff",
|
color: $mode === "light" ? "black" : "white",
|
||||||
},
|
},
|
||||||
distance: 10, // Increases space between label and axis
|
distance: 10, // Increases space between label and axis
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
@ -62,7 +67,7 @@
|
|||||||
},
|
},
|
||||||
opposite: true,
|
opposite: true,
|
||||||
gridLineWidth: 1,
|
gridLineWidth: 1,
|
||||||
gridLineColor: "#111827",
|
gridLineColor: $mode === "light" ? "#d1d5dc" : "#111827",
|
||||||
tickPositioner: function () {
|
tickPositioner: function () {
|
||||||
const positions = [];
|
const positions = [];
|
||||||
const info = this.getExtremes();
|
const info = this.getExtremes();
|
||||||
@ -97,12 +102,12 @@
|
|||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
// Format the x value to display time in hh:mm format
|
// Format the x value to display time in hh:mm format
|
||||||
let tooltipContent = `<span class="text-white m-auto text-black text-[1rem] font-[501]">Price Level ${this?.x}</span><br>`;
|
let tooltipContent = `<span class=" m-auto text-[1rem] font-[501]">Price Level ${this?.x}</span><br>`;
|
||||||
|
|
||||||
// Loop through each point in the shared tooltip
|
// Loop through each point in the shared tooltip
|
||||||
this.points?.forEach((point) => {
|
this.points?.forEach((point) => {
|
||||||
tooltipContent += `<span class="text-white font-semibold text-sm">${point.series.name}:</span>
|
tooltipContent += `<span class=" font-semibold text-sm">${point.series.name}:</span>
|
||||||
<span class="text-white font-normal text-sm" style="color:${point.color}">${abbreviateNumber(
|
<span class=" font-normal text-sm ">${abbreviateNumber(
|
||||||
point.y,
|
point.y,
|
||||||
)}</span><br>`;
|
)}</span><br>`;
|
||||||
});
|
});
|
||||||
@ -135,25 +140,25 @@
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if (($stockTicker || $etfTicker) && category) {
|
$: if ((($stockTicker || $etfTicker) && category) || $mode) {
|
||||||
config = getBarChart() || null;
|
config = getBarChart() || null;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="overflow-hidden text-white h-full pb-8 pt-3">
|
<section class="overflow-hidden h-full pb-8 pt-3">
|
||||||
<main class="overflow-hidden">
|
<main class="overflow-hidden">
|
||||||
{#if rawData?.length !== 0 && Object?.keys(metrics)?.length > 0}
|
{#if rawData?.length !== 0 && Object?.keys(metrics)?.length > 0}
|
||||||
<div class="w-full flex flex-col items-start">
|
<div class="w-full flex flex-col items-start">
|
||||||
<div class="text-white text-[1rem] mt-2 w-full">
|
<div class=" text-[1rem] mt-2 w-full">
|
||||||
{$displayCompanyName} has seen an average dark pool trade size of {@html abbreviateNumberWithColor(
|
{$displayCompanyName} has seen an average dark pool trade size of {abbreviateNumber(
|
||||||
metrics?.avgTradeSize,
|
metrics?.avgTradeSize,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
)} and an average premium per trade of {@html abbreviateNumberWithColor(
|
)} and an average premium per trade of {abbreviateNumber(
|
||||||
metrics?.avgPremTrade,
|
metrics?.avgPremTrade,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
)}, with a total premium of {@html abbreviateNumberWithColor(
|
)}, with a total premium of {abbreviateNumber(
|
||||||
metrics?.totalPrem,
|
metrics?.totalPrem,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
@ -161,25 +166,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" rounded-md bg-default mt-5 sm:mt-0">
|
<div class=" rounded-md mt-5 sm:mt-0">
|
||||||
<div class="flex justify-end mb-2 space-x-2 z-10 text-sm">
|
<div class="flex justify-end mb-2 space-x-2 z-10 text-sm">
|
||||||
{#each ["Today's Trend", "Price Level"] as item, index}
|
{#each ["Today's Trend", "Price Level"] as item, index}
|
||||||
{#if data?.user?.tier === "Pro" || index === 0}
|
{#if data?.user?.tier === "Pro" || index === 0}
|
||||||
<label
|
<label
|
||||||
on:click={() => (category = item)}
|
on:click={() => (category = item)}
|
||||||
class="px-3 py-1 text-sm {category === item
|
class="px-3 py-1 text-sm border border-gray-300 dark:border-gray-700 {category ===
|
||||||
? 'bg-white text-black '
|
item
|
||||||
: 'text-white bg-table text-opacity-[0.6]'} transition ease-out duration-100 sm:hover:bg-white sm:hover:text-black rounded-md cursor-pointer"
|
? 'bg-gray-300 shadow-sm dark:bg-white text-black '
|
||||||
|
: ' shadow-sm bg-gray-100 dark:bg-table text-opacity-[0.6]'} transition ease-out duration-100 rounded cursor-pointer"
|
||||||
>
|
>
|
||||||
{item}
|
{item}
|
||||||
</label>
|
</label>
|
||||||
{:else if data?.user?.tier !== "Pro"}
|
{:else if data?.user?.tier !== "Pro"}
|
||||||
<a
|
<a
|
||||||
href="/pricing"
|
href="/pricing"
|
||||||
class="px-3 py-1 text-sm flex flex-row items-center border border-gray-700 {category ===
|
class="px-3 py-1 text-sm flex flex-row items-center border border-gray-300 dark:border-gray-700 {category ===
|
||||||
item
|
item
|
||||||
? 'bg-white text-black '
|
? 'bg-gray-300 shadow-sm dark:bg-white text-black '
|
||||||
: 'text-white bg-table text-opacity-[0.6]'} transition ease-out duration-100 sm:hover:bg-white sm:hover:text-black rounded-md cursor-pointer"
|
: ' shadow-sm bg-gray-100 dark:bg-table text-opacity-[0.6]'} transition ease-out duration-100 rounded cursor-pointer"
|
||||||
>
|
>
|
||||||
{item}
|
{item}
|
||||||
<svg
|
<svg
|
||||||
@ -198,7 +204,7 @@
|
|||||||
|
|
||||||
{#if category === "Price Level"}
|
{#if category === "Price Level"}
|
||||||
<div
|
<div
|
||||||
class="border border-gray-800 rounded w-full"
|
class="border border-gray-300 dark:border-gray-800 rounded w-full"
|
||||||
use:highcharts={config}
|
use:highcharts={config}
|
||||||
></div>
|
></div>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { stockTicker, etfTicker } from "$lib/store";
|
import { stockTicker, etfTicker } from "$lib/store";
|
||||||
import highcharts from "$lib/highcharts.ts";
|
import highcharts from "$lib/highcharts.ts";
|
||||||
|
import { mode } from "mode-watcher";
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
@ -68,7 +69,7 @@
|
|||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
chart: {
|
chart: {
|
||||||
backgroundColor: "#09090B",
|
backgroundColor: $mode === "light" ? "#fff" : "#09090B",
|
||||||
animation: false,
|
animation: false,
|
||||||
height: 360,
|
height: 360,
|
||||||
},
|
},
|
||||||
@ -77,7 +78,7 @@
|
|||||||
title: {
|
title: {
|
||||||
text: `<h3 class="mt-3 mb-1 text-[1rem] sm:text-lg">Realtime Dark Pool Trades Impact</h3>`,
|
text: `<h3 class="mt-3 mb-1 text-[1rem] sm:text-lg">Realtime Dark Pool Trades Impact</h3>`,
|
||||||
useHTML: true,
|
useHTML: true,
|
||||||
style: { color: "white" },
|
style: { color: $mode === "light" ? "black" : "white" },
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
@ -85,12 +86,12 @@
|
|||||||
max: endTime,
|
max: endTime,
|
||||||
tickLength: 0,
|
tickLength: 0,
|
||||||
crosshair: {
|
crosshair: {
|
||||||
color: "#fff",
|
color: $mode === "light" ? "black" : "white",
|
||||||
width: 1,
|
width: 1,
|
||||||
dashStyle: "Solid",
|
dashStyle: "Solid",
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
style: { color: "#fff" },
|
style: { color: $mode === "light" ? "black" : "white" },
|
||||||
distance: 20,
|
distance: 20,
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
const date = new Date(this?.value);
|
const date = new Date(this?.value);
|
||||||
@ -107,14 +108,17 @@
|
|||||||
min: yMin ?? null,
|
min: yMin ?? null,
|
||||||
max: yMax ?? null,
|
max: yMax ?? null,
|
||||||
title: { text: null },
|
title: { text: null },
|
||||||
labels: { style: { color: "white" } },
|
labels: { style: { color: $mode === "light" ? "black" : "white" } },
|
||||||
gridLineWidth: 1,
|
gridLineWidth: 1,
|
||||||
gridLineColor: "#111827",
|
gridLineColor: $mode === "light" ? "#d1d5dc" : "#111827",
|
||||||
opposite: true,
|
opposite: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: { text: "Total Trades", style: { color: "#fff" } },
|
title: {
|
||||||
labels: { style: { color: "#fff" } },
|
text: "Total Trades",
|
||||||
|
style: { color: $mode === "light" ? "black" : "white" },
|
||||||
|
},
|
||||||
|
labels: { style: { color: $mode === "light" ? "black" : "white" } },
|
||||||
gridLineWidth: 0,
|
gridLineWidth: 0,
|
||||||
opposite: false,
|
opposite: false,
|
||||||
},
|
},
|
||||||
@ -125,27 +129,36 @@
|
|||||||
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
||||||
borderColor: "rgba(255, 255, 255, 0.2)",
|
borderColor: "rgba(255, 255, 255, 0.2)",
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
style: { color: "#fff", fontSize: "16px", padding: "10px" },
|
style: {
|
||||||
|
color: "#fff",
|
||||||
|
fontSize: "16px",
|
||||||
|
padding: "10px",
|
||||||
|
},
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
|
// Create a Date object from the x value and format it as time
|
||||||
const date = new Date(this?.x);
|
const date = new Date(this?.x);
|
||||||
let formattedDate = date.toLocaleTimeString("en-US", {
|
let formattedTime = date.toLocaleTimeString("en-US", {
|
||||||
hour: "2-digit",
|
hour: "2-digit",
|
||||||
minute: "2-digit",
|
minute: "2-digit",
|
||||||
});
|
});
|
||||||
|
|
||||||
let tooltipContent = `<span class="text-white m-auto text-sm">${formattedDate}</span><br>`;
|
// Build the tooltip content starting with the formatted time
|
||||||
|
let tooltipContent = `<span class="m-auto text-sm text-white">${formattedTime}</span><br>`;
|
||||||
|
|
||||||
|
// Loop through each point and add its details, excluding "Dark Pool Volume"
|
||||||
this.points?.forEach((point) => {
|
this.points?.forEach((point) => {
|
||||||
// Exclude the column series from the tooltip
|
|
||||||
if (point.series.name !== "Dark Pool Volume") {
|
if (point.series.name !== "Dark Pool Volume") {
|
||||||
tooltipContent += `<span style="color:${point.color}">${point.series.name}: <b>${point.y}</b></span><br>`;
|
tooltipContent += `
|
||||||
|
<span class="font-semibold text-sm">${point.series.name}:</span>
|
||||||
|
<span class="font-normal text-sm"><b>${point.y}</b></span><br>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return tooltipContent;
|
return tooltipContent;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
plotOptions: {
|
plotOptions: {
|
||||||
series: {
|
series: {
|
||||||
animation: false,
|
animation: false,
|
||||||
@ -174,7 +187,7 @@
|
|||||||
name: "Price",
|
name: "Price",
|
||||||
type: "line",
|
type: "line",
|
||||||
data: seriesData,
|
data: seriesData,
|
||||||
color: "#fff",
|
color: $mode === "light" ? "blue" : "white",
|
||||||
lineWidth: 1.3,
|
lineWidth: 1.3,
|
||||||
yAxis: 0, // Use primary yAxis
|
yAxis: 0, // Use primary yAxis
|
||||||
animation: false,
|
animation: false,
|
||||||
@ -194,13 +207,13 @@
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if ($stockTicker || $etfTicker) {
|
$: if ($stockTicker || $etfTicker || $mode) {
|
||||||
config = null;
|
config = null;
|
||||||
config = getPlotChart() || null;
|
config = getPlotChart() || null;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="border border-gray-800 rounded w-full"
|
class="border border-gray-300 dark:border-gray-800 rounded w-full"
|
||||||
use:highcharts={config}
|
use:highcharts={config}
|
||||||
></div>
|
></div>
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
description={`Explore exclusive dark pool trading data for ${$displayCompanyName} (${$stockTicker}). Get insights into hidden market activity, stock price movements, institutional trades, financials, and key statistics.`}
|
description={`Explore exclusive dark pool trading data for ${$displayCompanyName} (${$stockTicker}). Get insights into hidden market activity, stock price movements, institutional trades, financials, and key statistics.`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="w-full bg-default overflow-hidden text-white h-full">
|
<section class="w-full overflow-hidden h-full">
|
||||||
<div class="w-full flex h-full overflow-hidden">
|
<div class="w-full flex h-full overflow-hidden">
|
||||||
<div
|
<div
|
||||||
class="w-full relative flex justify-center items-center overflow-hidden"
|
class="w-full relative flex justify-center items-center overflow-hidden"
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<div class="flex flex-row items-center mb-4 sm:mb-0">
|
<div class="flex flex-row items-center mb-4 sm:mb-0">
|
||||||
<label
|
<label
|
||||||
for="darkPoolInfo"
|
for="darkPoolInfo"
|
||||||
class="mr-1 cursor-pointer flex flex-row items-center text-white text-xl sm:text-2xl font-bold"
|
class="mr-1 cursor-pointer flex flex-row items-center text-xl sm:text-2xl font-bold"
|
||||||
>
|
>
|
||||||
Dark Pool Data
|
Dark Pool Data
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user