Liquidity Heatmap
通过可选择强度带的网格检查时间与价格维度的流动性。
适用场景
- 当界面需要以下行为时使用 Liquidity Heatmap:通过可选择强度带的网格检查时间与价格维度的流动性。
安装
选择安装方式,用法示例将同步更新导入路径。
$ bunx --bun shadcn-vue@2.8.2 add https://orvui.efu.me/r/liquidity-heatmap.json https://orvui.efu.me/r/button.json
首次使用时,将安装的 src/components/orvui/styles.css 导入项目样式入口。
示例
预览
Where liquidity rests
SOL / USD · Simulated depth
| 14:00 | 14:02 | 14:04 | 14:06 | 14:08 | 14:10 | 14:12 | 14:14 | 14:16 | 14:18 | 14:20 | 14:22 | 14:24 | 14:26 | 14:28 | 14:30 | 14:32 | 14:34 | 14:36 | 14:38 | 14:40 | 14:42 | 14:44 | 14:46 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 265 | 414 | 422 | 281 | 125 | 102 | 233 | 395 | 433 | 312 | 147 | 93 | 203 | 371 | 439 | 342 | 172 | 90 | 174 | 344 | 439 | 369 | 200 | 93 |
| 322 | 436 | 387 | 223 | 98 | 132 | 291 | 426 | 408 | 254 | 111 | 113 | 260 | 411 | 424 | 286 | 128 | 100 | 228 | 391 | 435 | 318 | 151 | 93 |
| 383 | 445 | 343 | 171 | 91 | 177 | 347 | 440 | 367 | 198 | 92 | 151 | 317 | 435 | 392 | 230 | 103 | 134 | 297 | 445 | 450 | 326 | 216 | 257 |
| 842 | 758 | 535 | 310 | 234 | 328 | 466 | 493 | 365 | 194 | 138 | 249 | 426 | 510 | 438 | 303 | 274 | 440 | 731 | 993 | 1129 | 1189 | 1310 | 1571 |
| 1935 | 1991 | 1851 | 1675 | 1601 | 1627 | 1629 | 1493 | 1245 | 1031 | 987 | 1110 | 1261 | 1293 | 1189 | 1078 | 1109 | 1304 | 1534 | 1631 | 1539 | 1366 | 1275 | 1337 |
| 869 | 970 | 1035 | 1200 | 1510 | 1854 | 2053 | 2013 | 1805 | 1604 | 1526 | 1532 | 1479 | 1267 | 945 | 675 | 581 | 640 | 699 | 624 | 424 | 237 | 204 | 327 |
| 434 | 307 | 166 | 164 | 327 | 531 | 612 | 522 | 365 | 296 | 376 | 509 | 545 | 419 | 223 | 119 | 186 | 349 | 444 | 377 | 207 | 95 | 145 | 310 |
| 391 | 228 | 100 | 129 | 286 | 425 | 413 | 262 | 116 | 113 | 256 | 409 | 427 | 292 | 132 | 98 | 223 | 387 | 436 | 323 | 155 | 91 | 192 | 362 |
| 345 | 174 | 90 | 171 | 342 | 439 | 372 | 203 | 93 | 146 | 312 | 433 | 395 | 234 | 102 | 125 | 280 | 421 | 414 | 265 | 116 | 108 | 249 | 405 |
| 290 | 131 | 99 | 225 | 389 | 435 | 320 | 153 | 92 | 195 | 364 | 440 | 349 | 179 | 90 | 167 | 337 | 438 | 376 | 208 | 94 | 142 | 307 | 431 |
| 258 | 129 | 154 | 307 | 443 | 428 | 273 | 122 | 113 | 253 | 407 | 428 | 295 | 134 | 98 | 220 | 385 | 436 | 325 | 157 | 91 | 190 | 360 | 440 |
| 629 | 573 | 661 | 812 | 869 | 741 | 501 | 316 | 302 | 415 | 499 | 438 | 261 | 118 | 132 | 283 | 424 | 418 | 271 | 120 | 109 | 248 | 405 | 432 |
| 1583 | 1673 | 1897 | 2123 | 2179 | 2012 | 1725 | 1488 | 1377 | 1322 | 1185 | 909 | 588 | 384 | 379 | 496 | 566 | 486 | 308 | 188 | 235 | 405 | 544 | 533 |
| 982 | 1094 | 1358 | 1623 | 1749 | 1730 | 1694 | 1763 | 1930 | 2054 | 1988 | 1722 | 1401 | 1203 | 1184 | 1242 | 1224 | 1078 | 904 | 858 | 1002 | 1242 | 1415 | 1441 |
| 191 | 280 | 468 | 596 | 569 | 448 | 394 | 513 | 757 | 967 | 1015 | 927 | 849 | 909 | 1099 | 1281 | 1331 | 1257 | 1200 | 1302 | 1569 | 1859 | 2011 | 1982 |
| 100 | 222 | 388 | 440 | 331 | 165 | 102 | 205 | 383 | 473 | 400 | 247 | 173 | 268 | 464 | 601 | 581 | 458 | 392 | 491 | 708 | 884 | 886 | 736 |
| 123 | 278 | 420 | 416 | 268 | 118 | 107 | 246 | 403 | 430 | 301 | 139 | 98 | 217 | 385 | 443 | 339 | 173 | 106 | 205 | 379 | 467 | 387 | 216 |
| 165 | 334 | 438 | 378 | 211 | 95 | 140 | 304 | 431 | 400 | 242 | 105 | 120 | 272 | 417 | 418 | 274 | 121 | 105 | 241 | 400 | 431 | 306 | 142 |
Resting liquidity · SOL02.4K+
Brighter bands hold more liquidity · White line tracks price
packages/vue/src/charts/liquidity-heatmap/demo.vue
<script setup lang="ts">
import { computed, ref } from "vue";
import { RefreshCw } from "lucide-vue-next";
import { Button } from "@/components/orvui/motion/button";
import { LiquidityHeatmap, type LiquiditySnapshot } from "@/components/orvui/charts/liquidity-heatmap";
const phase = ref(0);
const snapshots = computed<LiquiditySnapshot[]>(() =>
Array.from({ length: 24 }, (_, minute) => ({
id: `minute-${minute}`,
label: `14:${String(minute * 2).padStart(2, "0")}`,
price:
245.5 +
Math.sin(minute * 0.27 + phase.value * 0.4) * 1.2 +
minute * 0.035,
levels: Array.from({ length: 18 }, (_, row) => {
const upper = Math.exp(
-((row - 4 - Math.sin(minute * 0.18 + phase.value) * 0.7) ** 2) / 0.8,
);
const lower = Math.exp(
-((row - 13 + Math.cos(minute * 0.15 + phase.value) * 0.8) ** 2) / 1.2,
);
const noise =
(Math.sin(row * 12.9 + minute * 7.3 + phase.value * 2.1) + 1) / 2;
return {
price: 250 - row * 0.5,
size: Math.round(
90 +
noise * 350 +
(upper + lower) *
(1500 + Math.sin(minute * 0.3 + phase.value) * 450),
),
};
}),
})),
);
const formatPrice = (price: number) => `$${price.toFixed(2)}`;
</script>
<template>
<div class="w-full space-y-6">
<div class="flex flex-wrap items-center justify-between gap-4">
<div>
<h3 class="text-sm font-medium">Where liquidity rests</h3>
<p class="mt-1 text-xs text-muted-foreground">
SOL / USD · Simulated depth
</p>
</div>
<Button variant="ghost" size="sm" class="gap-2" @click="phase++"
><RefreshCw aria-hidden="true" class="size-3.5" />Resimulate</Button
>
</div>
<LiquidityHeatmap
:snapshots="snapshots"
:max-size="2400"
unit="SOL"
:format-price="formatPrice"
/>
<p class="text-center text-[11px] text-muted-foreground">
Brighter bands hold more liquidity · White line tracks price
</p>
</div>
</template>
packages/vue/src/charts/liquidity-heatmap/src/LiquidityHeatmap.vue
状态与事件
此示例组合没有声明成对的受控属性与 update 事件。使用已列出的属性、原生事件和插槽组合内容;不要为它添加未公开的 v-model。
API 参考
snapshotsreadonly LiquiditySnapshot[]—maxSize?number—unit?string"units"label?string"Liquidity heatmap"formatPrice?(value: number) => stringformatNumberformatSize?(value: number) => stringformatCompactclassName?string—插槽
default() => VNodeChild#default无障碍
为交互控件提供明确的无障碍名称。保留文档中的键盘路径、可见焦点与减少动态效果状态;自定义插槽应继续保留所替代部件的语义。
常见问题
- 如何配置 Liquidity Heatmap?
- 通过 snapshots、maxSize、unit、label、formatPrice、formatSize、className 配置 Liquidity Heatmap;API 表列出其类型与默认值。
- 如何连接到应用状态?
- 通过default 插槽提供内容,应用副作用由调用方管理。
- 可以在服务端渲染吗?
- 可以在 Vue SSR 应用中正常渲染。服务端与客户端的初始 props 应保持一致;浏览器测量与交互资源在挂载后启动。
更新于
来源与许可 ↗MIT · 0.1.1