delay point updates and fix randomizer
This commit is contained in:
parent
21d02b7d31
commit
1df852500d
2 changed files with 22 additions and 16 deletions
components/userpage
|
@ -18,7 +18,20 @@ interface RankChartProps {
|
|||
Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Tooltip);
|
||||
|
||||
function RankChart(props: RankChartProps) {
|
||||
let delayed: boolean;
|
||||
const options: ChartOptions<"line"> = {
|
||||
animation: {
|
||||
onComplete: () => {
|
||||
delayed = true;
|
||||
},
|
||||
delay: (context) => {
|
||||
let delay = 0;
|
||||
if (context.type === "data" && context.mode === "default" && !delayed) {
|
||||
delay = context.dataIndex * 9;
|
||||
}
|
||||
return delay;
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: "index",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue