sveltekit-ui 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -169,7 +169,7 @@ export function create_chart_manager(config) {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
function time_tic_size(seconds) {
|
|
172
|
-
const
|
|
172
|
+
const tic_options = [
|
|
173
173
|
300, //5m
|
|
174
174
|
600, //10m
|
|
175
175
|
900, //15m
|
|
@@ -194,9 +194,9 @@ export function create_chart_manager(config) {
|
|
|
194
194
|
15768000, //6m
|
|
195
195
|
31536000, //1y
|
|
196
196
|
]
|
|
197
|
-
for (let i = 0; i <
|
|
198
|
-
if (
|
|
199
|
-
return
|
|
197
|
+
for (let i = 0; i < tic_options.length - 1; i++) {
|
|
198
|
+
if (tic_options[i] < seconds && tic_options[i + 1] > seconds) {
|
|
199
|
+
return tic_options[i + 1]
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
return "-"
|
|
@@ -321,25 +321,25 @@ export function create_chart_manager(config) {
|
|
|
321
321
|
const day = dateObject.getDate()
|
|
322
322
|
const hour = dateObject.getHours()
|
|
323
323
|
const minute = dateObject.getMinutes()
|
|
324
|
-
const
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
// if(
|
|
328
|
-
let
|
|
329
|
-
// if(
|
|
330
|
-
let
|
|
331
|
-
if (
|
|
332
|
-
|
|
324
|
+
const year_st = JSON.stringify(year)
|
|
325
|
+
const month_st = months[month]
|
|
326
|
+
let day_st = JSON.stringify(day)
|
|
327
|
+
// if(day_st.length < 2){ day_st = '0' + day_st }
|
|
328
|
+
let hour_st = JSON.stringify(hour)
|
|
329
|
+
// if(hour_st.length < 2){ hour_st = '0' + hour_st }
|
|
330
|
+
let minute_st = JSON.stringify(minute)
|
|
331
|
+
if (minute_st.length < 2) {
|
|
332
|
+
minute_st = "0" + minute_st
|
|
333
333
|
}
|
|
334
|
-
const
|
|
334
|
+
const hour_minute_st = hour_st + ":" + minute_st
|
|
335
335
|
if (minute > 0 || hour > 0) {
|
|
336
|
-
return
|
|
336
|
+
return hour_minute_st
|
|
337
337
|
} else if (day > 1) {
|
|
338
|
-
return
|
|
338
|
+
return day_st
|
|
339
339
|
} else if (month > 0) {
|
|
340
|
-
return
|
|
340
|
+
return month_st
|
|
341
341
|
}
|
|
342
|
-
return
|
|
342
|
+
return year_st
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
function prep_x_axis(
|
|
@@ -459,7 +459,7 @@ export function create_chart_manager(config) {
|
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
function next_big_num_under_target(target) {
|
|
462
|
-
const
|
|
462
|
+
const num_bases = [
|
|
463
463
|
100000000000000, 10000000000000, 1000000000000, 100000000000, 10000000000, 1000000000, 100000000, 50000000,
|
|
464
464
|
20000000, 10000000, 5000000, 2000000, 1000000, 750000, 500000, 400000, 250000, 200000, 150000, 100000, 75000,
|
|
465
465
|
50000, 40000, 25000, 20000, 15000, 10000, 7500, 5000, 4000, 3000, 2500, 2000, 1500, 1250, 1000, 750, 500, 400,
|
|
@@ -468,7 +468,7 @@ export function create_chart_manager(config) {
|
|
|
468
468
|
0.0001, 0.00008, 0.00005, 0.00004, 0.00003, 0.00002, 0.00001, 0.000008, 0.000005, 0.000004, 0.000003, 0.000002,
|
|
469
469
|
0.000001, 0.0000008, 0.0000005, 0.0000004, 0.0000003, 0.0000002, 0.0000001,
|
|
470
470
|
]
|
|
471
|
-
for (let num of
|
|
471
|
+
for (let num of num_bases) {
|
|
472
472
|
if (num < target) {
|
|
473
473
|
return num
|
|
474
474
|
}
|
|
@@ -477,7 +477,7 @@ export function create_chart_manager(config) {
|
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
function tic_size(num) {
|
|
480
|
-
const
|
|
480
|
+
const tic_options = [
|
|
481
481
|
0.0000001, 0.0000002, 0.0000003, 0.0000004, 0.0000005, 0.0000008, 0.000001, 0.000002, 0.000003, 0.000004,
|
|
482
482
|
0.000005, 0.000008, 0.00001, 0.00002, 0.00003, 0.00004, 0.00005, 0.00008, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005,
|
|
483
483
|
0.0008, 0.001, 0.002, 0.003, 0.004, 0.005, 0.008, 0.01, 0.02, 0.03, 0.04, 0.05, 0.08, 0.1, 0.2, 0.3, 0.4, 0.5,
|
|
@@ -486,9 +486,9 @@ export function create_chart_manager(config) {
|
|
|
486
486
|
250000, 400000, 500000, 750000, 1000000, 2000000, 5000000, 10000000, 20000000, 50000000, 100000000, 1000000000,
|
|
487
487
|
10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000,
|
|
488
488
|
]
|
|
489
|
-
for (let i = 0; i <
|
|
490
|
-
if (
|
|
491
|
-
return
|
|
489
|
+
for (let i = 0; i < tic_options.length - 1; i++) {
|
|
490
|
+
if (tic_options[i] < num && tic_options[i + 1] > num) {
|
|
491
|
+
return tic_options[i + 1]
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
return "-"
|
|
@@ -587,67 +587,68 @@ export function create_chart_manager(config) {
|
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
function short_lab(num) {
|
|
590
|
-
var
|
|
590
|
+
var if_neg = 1
|
|
591
591
|
if ((typeof num === typeof null) | (typeof num === typeof undefined)) {
|
|
592
592
|
return "-"
|
|
593
593
|
}
|
|
594
594
|
if (num < 0) {
|
|
595
|
-
|
|
595
|
+
if_neg = -1
|
|
596
596
|
}
|
|
597
597
|
var amount
|
|
598
598
|
amount = Math.abs(num)
|
|
599
599
|
if (amount === 0) {
|
|
600
600
|
return 0
|
|
601
601
|
} else if (amount >= 0 && amount < 0.0001) {
|
|
602
|
-
return Math.round((
|
|
602
|
+
return Math.round((if_neg * amount).toFixed(8) * 10000000 + Number.EPSILON) / 10000000
|
|
603
603
|
} else if (amount >= 0.0001 && amount < 0.001) {
|
|
604
|
-
return Math.round((
|
|
604
|
+
return Math.round((if_neg * amount).toFixed(7) * 1000000 + Number.EPSILON) / 1000000
|
|
605
605
|
} else if (amount >= 0.001 && amount < 0.01) {
|
|
606
|
-
return Math.round((
|
|
606
|
+
return Math.round((if_neg * amount).toFixed(6) * 100000 + Number.EPSILON) / 100000
|
|
607
607
|
} else if (amount >= 0.01 && amount < 0.1) {
|
|
608
|
-
return Math.round((
|
|
608
|
+
return Math.round((if_neg * amount).toFixed(5) * 10000 + Number.EPSILON) / 10000
|
|
609
609
|
} else if (amount >= 0.1 && amount < 10) {
|
|
610
|
-
return Math.round((
|
|
610
|
+
return Math.round((if_neg * amount).toFixed(4) * 1000 + Number.EPSILON) / 1000
|
|
611
611
|
} else if (amount >= 10 && amount < 1000) {
|
|
612
|
-
return (
|
|
612
|
+
return (if_neg * amount).toFixed(2)
|
|
613
613
|
} else if (amount >= 1000 && amount < 1000000) {
|
|
614
|
-
return (
|
|
614
|
+
return (if_neg * amount).toFixed().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
|
615
615
|
} else if (amount >= 1000000 && amount < 10000000) {
|
|
616
|
-
return (
|
|
616
|
+
return (if_neg * (amount / 1000000)).toFixed(2) + " M"
|
|
617
617
|
} else if (amount >= 10000000 && amount < 100000000) {
|
|
618
|
-
return (
|
|
618
|
+
return (if_neg * (amount / 1000000)).toFixed(1) + " M"
|
|
619
619
|
} else if (amount >= 100000000 && amount < 1000000000) {
|
|
620
|
-
return (
|
|
620
|
+
return (if_neg * (amount / 1000000)).toFixed() + " M"
|
|
621
621
|
} else if (amount >= 1000000000 && amount < 10000000000) {
|
|
622
|
-
return (
|
|
622
|
+
return (if_neg * (amount / 1000000000)).toFixed(2) + " B"
|
|
623
623
|
} else if (amount >= 10000000000 && amount < 100000000000) {
|
|
624
|
-
return (
|
|
624
|
+
return (if_neg * (amount / 1000000000)).toFixed(1) + " B"
|
|
625
625
|
} else if (amount >= 100000000000 && amount < 1000000000000) {
|
|
626
|
-
return (
|
|
626
|
+
return (if_neg * (amount / 1000000000)).toFixed() + " B"
|
|
627
627
|
} else if (amount >= 1000000000000 && amount < 10000000000000) {
|
|
628
|
-
return (
|
|
628
|
+
return (if_neg * (amount / 1000000000000)).toFixed(2) + " T"
|
|
629
629
|
} else if (amount >= 10000000000000 && amount < 100000000000000) {
|
|
630
|
-
return (
|
|
630
|
+
return (if_neg * (amount / 1000000000000)).toFixed(1) + " T"
|
|
631
631
|
} else if (amount >= 100000000000000 && amount < 1000000000000000) {
|
|
632
|
-
return (
|
|
632
|
+
return (if_neg * (amount / 1000000000000)).toFixed() + " T"
|
|
633
633
|
} else if (amount >= 1000000000000000 && amount < 10000000000000000n) {
|
|
634
|
-
return (
|
|
634
|
+
return (if_neg * (amount / 1000000000000000)).toFixed(2) + " Q"
|
|
635
635
|
} else if (amount >= 10000000000000000n && amount < 100000000000000000n) {
|
|
636
|
-
return (
|
|
636
|
+
return (if_neg * (amount / 1000000000000000)).toFixed(1) + " Q"
|
|
637
637
|
} else if (amount >= 100000000000000000n && amount < 1000000000000000000n) {
|
|
638
|
-
return (
|
|
638
|
+
return (if_neg * (amount / 1000000000000000)).toFixed() + " Q"
|
|
639
639
|
} else if (amount >= 1000000000000000000n && amount < 10000000000000000000n) {
|
|
640
|
-
return (
|
|
640
|
+
return (if_neg * (amount / 1000000000000000000n)).toFixed(2) + " QN"
|
|
641
641
|
} else if (amount >= 10000000000000000000n && amount < 100000000000000000000n) {
|
|
642
|
-
return (
|
|
642
|
+
return (if_neg * (amount / 1000000000000000000n)).toFixed(1) + " QN"
|
|
643
643
|
} else if (amount >= 100000000000000000000n && amount < 1000000000000000000000n) {
|
|
644
|
-
return (
|
|
644
|
+
return (if_neg * (amount / 1000000000000000000n)).toFixed() + " QN"
|
|
645
645
|
} else {
|
|
646
646
|
return "Big"
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
|
|
650
650
|
function handle_scroll_frame(e) {
|
|
651
|
+
e.preventDefault()
|
|
651
652
|
const res = scroll_frame(
|
|
652
653
|
e,
|
|
653
654
|
chart_prepped.shown_start_x,
|
|
@@ -1047,6 +1048,10 @@ export function create_chart_manager(config) {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
}
|
|
1049
1050
|
|
|
1051
|
+
function set_datasets(input) {
|
|
1052
|
+
datasets = input
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1050
1055
|
function init(config) {
|
|
1051
1056
|
console.log("init_chart", config)
|
|
1052
1057
|
datasets = config?.datasets
|
|
@@ -1080,5 +1085,6 @@ export function create_chart_manager(config) {
|
|
|
1080
1085
|
handle_chart_hover_leave,
|
|
1081
1086
|
set_grid_width,
|
|
1082
1087
|
gen_color,
|
|
1088
|
+
set_datasets,
|
|
1083
1089
|
}
|
|
1084
1090
|
}
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,10 @@ export { default as Checkbox } from "./Components/Checkbox/index.svelte"
|
|
|
32
32
|
export { create_checkbox_manager } from "./Components/Checkbox/index.svelte.js"
|
|
33
33
|
export { default as AuthCodeInput } from "./Components/AuthCodeInput/index.svelte"
|
|
34
34
|
export { create_auth_code_input_manager } from "./Components/AuthCodeInput/index.svelte.js"
|
|
35
|
+
export { default as Chart } from "./Components/Chart/index.svelte"
|
|
36
|
+
export { create_chart_manager } from "./Components/Chart/index.svelte.js"
|
|
37
|
+
export { default as ChartInput } from "./Components/ChartInput/index.svelte"
|
|
38
|
+
export { create_chart_input_manager } from "./Components/ChartInput/index.svelte.js"
|
|
35
39
|
export { default as Code } from "./Components/Code/index.svelte"
|
|
36
40
|
export { create_code_manager } from "./Components/Code/index.svelte.js"
|
|
37
41
|
export { default as ColorInput } from "./Components/ColorInput/index.svelte"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sveltekit-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A SvelteKit UI component library for building modern web applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"context-filter-polyfill": "^0.3.23",
|
|
21
21
|
"qr-code-styling": "^1.9.2",
|
|
22
|
-
"svelte": "^5.35.
|
|
22
|
+
"svelte": "^5.35.3"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@sveltejs/kit": "^2.22.2"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
|
32
32
|
"@vercel/analytics": "^1.5.0",
|
|
33
33
|
"typescript": "^5.8.3",
|
|
34
|
-
"vite": "^
|
|
34
|
+
"vite": "^7.0.2"
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://www.sveltekit-ui.com",
|
|
37
37
|
"keywords": [
|
|
@@ -169,7 +169,7 @@ export function create_chart_manager(config) {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
function time_tic_size(seconds) {
|
|
172
|
-
const
|
|
172
|
+
const tic_options = [
|
|
173
173
|
300, //5m
|
|
174
174
|
600, //10m
|
|
175
175
|
900, //15m
|
|
@@ -194,9 +194,9 @@ export function create_chart_manager(config) {
|
|
|
194
194
|
15768000, //6m
|
|
195
195
|
31536000, //1y
|
|
196
196
|
]
|
|
197
|
-
for (let i = 0; i <
|
|
198
|
-
if (
|
|
199
|
-
return
|
|
197
|
+
for (let i = 0; i < tic_options.length - 1; i++) {
|
|
198
|
+
if (tic_options[i] < seconds && tic_options[i + 1] > seconds) {
|
|
199
|
+
return tic_options[i + 1]
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
return "-"
|
|
@@ -321,25 +321,25 @@ export function create_chart_manager(config) {
|
|
|
321
321
|
const day = dateObject.getDate()
|
|
322
322
|
const hour = dateObject.getHours()
|
|
323
323
|
const minute = dateObject.getMinutes()
|
|
324
|
-
const
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
// if(
|
|
328
|
-
let
|
|
329
|
-
// if(
|
|
330
|
-
let
|
|
331
|
-
if (
|
|
332
|
-
|
|
324
|
+
const year_st = JSON.stringify(year)
|
|
325
|
+
const month_st = months[month]
|
|
326
|
+
let day_st = JSON.stringify(day)
|
|
327
|
+
// if(day_st.length < 2){ day_st = '0' + day_st }
|
|
328
|
+
let hour_st = JSON.stringify(hour)
|
|
329
|
+
// if(hour_st.length < 2){ hour_st = '0' + hour_st }
|
|
330
|
+
let minute_st = JSON.stringify(minute)
|
|
331
|
+
if (minute_st.length < 2) {
|
|
332
|
+
minute_st = "0" + minute_st
|
|
333
333
|
}
|
|
334
|
-
const
|
|
334
|
+
const hour_minute_st = hour_st + ":" + minute_st
|
|
335
335
|
if (minute > 0 || hour > 0) {
|
|
336
|
-
return
|
|
336
|
+
return hour_minute_st
|
|
337
337
|
} else if (day > 1) {
|
|
338
|
-
return
|
|
338
|
+
return day_st
|
|
339
339
|
} else if (month > 0) {
|
|
340
|
-
return
|
|
340
|
+
return month_st
|
|
341
341
|
}
|
|
342
|
-
return
|
|
342
|
+
return year_st
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
function prep_x_axis(
|
|
@@ -459,7 +459,7 @@ export function create_chart_manager(config) {
|
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
function next_big_num_under_target(target) {
|
|
462
|
-
const
|
|
462
|
+
const num_bases = [
|
|
463
463
|
100000000000000, 10000000000000, 1000000000000, 100000000000, 10000000000, 1000000000, 100000000, 50000000,
|
|
464
464
|
20000000, 10000000, 5000000, 2000000, 1000000, 750000, 500000, 400000, 250000, 200000, 150000, 100000, 75000,
|
|
465
465
|
50000, 40000, 25000, 20000, 15000, 10000, 7500, 5000, 4000, 3000, 2500, 2000, 1500, 1250, 1000, 750, 500, 400,
|
|
@@ -468,7 +468,7 @@ export function create_chart_manager(config) {
|
|
|
468
468
|
0.0001, 0.00008, 0.00005, 0.00004, 0.00003, 0.00002, 0.00001, 0.000008, 0.000005, 0.000004, 0.000003, 0.000002,
|
|
469
469
|
0.000001, 0.0000008, 0.0000005, 0.0000004, 0.0000003, 0.0000002, 0.0000001,
|
|
470
470
|
]
|
|
471
|
-
for (let num of
|
|
471
|
+
for (let num of num_bases) {
|
|
472
472
|
if (num < target) {
|
|
473
473
|
return num
|
|
474
474
|
}
|
|
@@ -477,7 +477,7 @@ export function create_chart_manager(config) {
|
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
function tic_size(num) {
|
|
480
|
-
const
|
|
480
|
+
const tic_options = [
|
|
481
481
|
0.0000001, 0.0000002, 0.0000003, 0.0000004, 0.0000005, 0.0000008, 0.000001, 0.000002, 0.000003, 0.000004,
|
|
482
482
|
0.000005, 0.000008, 0.00001, 0.00002, 0.00003, 0.00004, 0.00005, 0.00008, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005,
|
|
483
483
|
0.0008, 0.001, 0.002, 0.003, 0.004, 0.005, 0.008, 0.01, 0.02, 0.03, 0.04, 0.05, 0.08, 0.1, 0.2, 0.3, 0.4, 0.5,
|
|
@@ -486,9 +486,9 @@ export function create_chart_manager(config) {
|
|
|
486
486
|
250000, 400000, 500000, 750000, 1000000, 2000000, 5000000, 10000000, 20000000, 50000000, 100000000, 1000000000,
|
|
487
487
|
10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000,
|
|
488
488
|
]
|
|
489
|
-
for (let i = 0; i <
|
|
490
|
-
if (
|
|
491
|
-
return
|
|
489
|
+
for (let i = 0; i < tic_options.length - 1; i++) {
|
|
490
|
+
if (tic_options[i] < num && tic_options[i + 1] > num) {
|
|
491
|
+
return tic_options[i + 1]
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
return "-"
|
|
@@ -587,67 +587,68 @@ export function create_chart_manager(config) {
|
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
function short_lab(num) {
|
|
590
|
-
var
|
|
590
|
+
var if_neg = 1
|
|
591
591
|
if ((typeof num === typeof null) | (typeof num === typeof undefined)) {
|
|
592
592
|
return "-"
|
|
593
593
|
}
|
|
594
594
|
if (num < 0) {
|
|
595
|
-
|
|
595
|
+
if_neg = -1
|
|
596
596
|
}
|
|
597
597
|
var amount
|
|
598
598
|
amount = Math.abs(num)
|
|
599
599
|
if (amount === 0) {
|
|
600
600
|
return 0
|
|
601
601
|
} else if (amount >= 0 && amount < 0.0001) {
|
|
602
|
-
return Math.round((
|
|
602
|
+
return Math.round((if_neg * amount).toFixed(8) * 10000000 + Number.EPSILON) / 10000000
|
|
603
603
|
} else if (amount >= 0.0001 && amount < 0.001) {
|
|
604
|
-
return Math.round((
|
|
604
|
+
return Math.round((if_neg * amount).toFixed(7) * 1000000 + Number.EPSILON) / 1000000
|
|
605
605
|
} else if (amount >= 0.001 && amount < 0.01) {
|
|
606
|
-
return Math.round((
|
|
606
|
+
return Math.round((if_neg * amount).toFixed(6) * 100000 + Number.EPSILON) / 100000
|
|
607
607
|
} else if (amount >= 0.01 && amount < 0.1) {
|
|
608
|
-
return Math.round((
|
|
608
|
+
return Math.round((if_neg * amount).toFixed(5) * 10000 + Number.EPSILON) / 10000
|
|
609
609
|
} else if (amount >= 0.1 && amount < 10) {
|
|
610
|
-
return Math.round((
|
|
610
|
+
return Math.round((if_neg * amount).toFixed(4) * 1000 + Number.EPSILON) / 1000
|
|
611
611
|
} else if (amount >= 10 && amount < 1000) {
|
|
612
|
-
return (
|
|
612
|
+
return (if_neg * amount).toFixed(2)
|
|
613
613
|
} else if (amount >= 1000 && amount < 1000000) {
|
|
614
|
-
return (
|
|
614
|
+
return (if_neg * amount).toFixed().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
|
615
615
|
} else if (amount >= 1000000 && amount < 10000000) {
|
|
616
|
-
return (
|
|
616
|
+
return (if_neg * (amount / 1000000)).toFixed(2) + " M"
|
|
617
617
|
} else if (amount >= 10000000 && amount < 100000000) {
|
|
618
|
-
return (
|
|
618
|
+
return (if_neg * (amount / 1000000)).toFixed(1) + " M"
|
|
619
619
|
} else if (amount >= 100000000 && amount < 1000000000) {
|
|
620
|
-
return (
|
|
620
|
+
return (if_neg * (amount / 1000000)).toFixed() + " M"
|
|
621
621
|
} else if (amount >= 1000000000 && amount < 10000000000) {
|
|
622
|
-
return (
|
|
622
|
+
return (if_neg * (amount / 1000000000)).toFixed(2) + " B"
|
|
623
623
|
} else if (amount >= 10000000000 && amount < 100000000000) {
|
|
624
|
-
return (
|
|
624
|
+
return (if_neg * (amount / 1000000000)).toFixed(1) + " B"
|
|
625
625
|
} else if (amount >= 100000000000 && amount < 1000000000000) {
|
|
626
|
-
return (
|
|
626
|
+
return (if_neg * (amount / 1000000000)).toFixed() + " B"
|
|
627
627
|
} else if (amount >= 1000000000000 && amount < 10000000000000) {
|
|
628
|
-
return (
|
|
628
|
+
return (if_neg * (amount / 1000000000000)).toFixed(2) + " T"
|
|
629
629
|
} else if (amount >= 10000000000000 && amount < 100000000000000) {
|
|
630
|
-
return (
|
|
630
|
+
return (if_neg * (amount / 1000000000000)).toFixed(1) + " T"
|
|
631
631
|
} else if (amount >= 100000000000000 && amount < 1000000000000000) {
|
|
632
|
-
return (
|
|
632
|
+
return (if_neg * (amount / 1000000000000)).toFixed() + " T"
|
|
633
633
|
} else if (amount >= 1000000000000000 && amount < 10000000000000000n) {
|
|
634
|
-
return (
|
|
634
|
+
return (if_neg * (amount / 1000000000000000)).toFixed(2) + " Q"
|
|
635
635
|
} else if (amount >= 10000000000000000n && amount < 100000000000000000n) {
|
|
636
|
-
return (
|
|
636
|
+
return (if_neg * (amount / 1000000000000000)).toFixed(1) + " Q"
|
|
637
637
|
} else if (amount >= 100000000000000000n && amount < 1000000000000000000n) {
|
|
638
|
-
return (
|
|
638
|
+
return (if_neg * (amount / 1000000000000000)).toFixed() + " Q"
|
|
639
639
|
} else if (amount >= 1000000000000000000n && amount < 10000000000000000000n) {
|
|
640
|
-
return (
|
|
640
|
+
return (if_neg * (amount / 1000000000000000000n)).toFixed(2) + " QN"
|
|
641
641
|
} else if (amount >= 10000000000000000000n && amount < 100000000000000000000n) {
|
|
642
|
-
return (
|
|
642
|
+
return (if_neg * (amount / 1000000000000000000n)).toFixed(1) + " QN"
|
|
643
643
|
} else if (amount >= 100000000000000000000n && amount < 1000000000000000000000n) {
|
|
644
|
-
return (
|
|
644
|
+
return (if_neg * (amount / 1000000000000000000n)).toFixed() + " QN"
|
|
645
645
|
} else {
|
|
646
646
|
return "Big"
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
|
|
650
650
|
function handle_scroll_frame(e) {
|
|
651
|
+
e.preventDefault()
|
|
651
652
|
const res = scroll_frame(
|
|
652
653
|
e,
|
|
653
654
|
chart_prepped.shown_start_x,
|
|
@@ -1047,6 +1048,10 @@ export function create_chart_manager(config) {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
}
|
|
1049
1050
|
|
|
1051
|
+
function set_datasets(input) {
|
|
1052
|
+
datasets = input
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1050
1055
|
function init(config) {
|
|
1051
1056
|
console.log("init_chart", config)
|
|
1052
1057
|
datasets = config?.datasets
|
|
@@ -1080,5 +1085,6 @@ export function create_chart_manager(config) {
|
|
|
1080
1085
|
handle_chart_hover_leave,
|
|
1081
1086
|
set_grid_width,
|
|
1082
1087
|
gen_color,
|
|
1088
|
+
set_datasets,
|
|
1083
1089
|
}
|
|
1084
1090
|
}
|
package/src/lib/index.js
CHANGED
|
@@ -32,6 +32,10 @@ export { default as Checkbox } from "./Components/Checkbox/index.svelte"
|
|
|
32
32
|
export { create_checkbox_manager } from "./Components/Checkbox/index.svelte.js"
|
|
33
33
|
export { default as AuthCodeInput } from "./Components/AuthCodeInput/index.svelte"
|
|
34
34
|
export { create_auth_code_input_manager } from "./Components/AuthCodeInput/index.svelte.js"
|
|
35
|
+
export { default as Chart } from "./Components/Chart/index.svelte"
|
|
36
|
+
export { create_chart_manager } from "./Components/Chart/index.svelte.js"
|
|
37
|
+
export { default as ChartInput } from "./Components/ChartInput/index.svelte"
|
|
38
|
+
export { create_chart_input_manager } from "./Components/ChartInput/index.svelte.js"
|
|
35
39
|
export { default as Code } from "./Components/Code/index.svelte"
|
|
36
40
|
export { create_code_manager } from "./Components/Code/index.svelte.js"
|
|
37
41
|
export { default as ColorInput } from "./Components/ColorInput/index.svelte"
|