Rename FNX to Nova

This commit is contained in:
2026-01-26 22:23:36 +01:00
parent 70e8353a50
commit 70a22d4a06
22 changed files with 67 additions and 43 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { onMount } from "svelte";
import { formatDataVolume, formatNumber } from "./Formatting";
import { formatDataVolume, formatDuration, formatNumber } from "./Formatting";
import { color_by_name } from "./Util";
import {
Chart,
@@ -33,12 +33,14 @@ let {
legend = true,
tooltips = true,
ticks = true,
animations = true,
height = "300px"
}: {
data_type?: string;
legend?: boolean;
tooltips?: boolean;
ticks?: boolean;
animations?: boolean;
height?: string;
} = $props();
@@ -85,6 +87,9 @@ onMount(() => {
},
tooltip: {
enabled: tooltips,
itemSort: (a, b): number => {
return <number>b.raw - <number>a.raw
},
},
},
layout: {
@@ -102,6 +107,8 @@ onMount(() => {
callback: function (value: number, index: number, values: Tick[]) {
if (data_type == "bytes") {
return formatDataVolume(value, 3);
} else if (data_type === "duration") {
return formatDuration(value, 2);
}
return formatNumber(value, 3);
},
@@ -129,6 +136,11 @@ onMount(() => {
}
}
);
if (!animations) {
chart_object.options.animation = false
chart_object.options.transitions.active.animation.duration = 0
}
})
</script>