Skip to content

Commit 34b7fa3

Browse files
committed
Config - Add annotator user option
1 parent ed8a0b4 commit 34b7fa3

File tree

1 file changed

+75
-36
lines changed

1 file changed

+75
-36
lines changed

src/useConfig.js

Lines changed: 75 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ export function useConfig() {
116116
fullscreen = false,
117117
sort = false,
118118
stack = false,
119-
animation = false
119+
animation = false,
120+
annotator = false
120121
}) => {
121122

122123
const buttonTitles = {
@@ -131,7 +132,8 @@ export function useConfig() {
131132
fullscreen: 'Toggle fullscreen',
132133
sort: "Toggle sort",
133134
stack: "Toggle stack mode",
134-
animation: "Toggle animation"
135+
animation: "Toggle animation",
136+
annotator: "Toggle annotator"
135137
}
136138

137139
if (!tooltip) delete buttonTitles.tooltip
@@ -144,6 +146,7 @@ export function useConfig() {
144146
if (!sort) delete buttonTitles.sort
145147
if (!stack) delete buttonTitles.stack
146148
if (!animation) delete buttonTitles.animation
149+
if (!annotator) delete buttonTitles.annotator
147150

148151
return {
149152
show: true,
@@ -158,7 +161,8 @@ export function useConfig() {
158161
fullscreen,
159162
sort,
160163
stack,
161-
animation
164+
animation,
165+
annotator
162166
},
163167
buttonTitles
164168
}
@@ -237,6 +241,7 @@ export function useConfig() {
237241
table: true,
238242
labels: true,
239243
fullscreen: true,
244+
annotator: true
240245
// IDEA : add a distributed toggle ?
241246
}),
242247
style: {
@@ -486,7 +491,8 @@ export function useConfig() {
486491
table: true,
487492
labels: true,
488493
fullscreen: true,
489-
stack: true
494+
stack: true,
495+
annotator: true
490496
})
491497
},
492498
bar: {
@@ -581,7 +587,8 @@ export function useConfig() {
581587
img: true,
582588
table: true,
583589
labels: true,
584-
fullscreen: true
590+
fullscreen: true,
591+
annotator: true,
585592
}),
586593
translations: {
587594
total: 'Total',
@@ -715,7 +722,8 @@ export function useConfig() {
715722
csv: true,
716723
img: true,
717724
table: true,
718-
fullscreen: true
725+
fullscreen: true,
726+
annotator: true
719727
}),
720728
style: {
721729
fontFamily: 'inherit',
@@ -849,7 +857,8 @@ export function useConfig() {
849857
csv: true,
850858
img: true,
851859
table: true,
852-
fullscreen: true
860+
fullscreen: true,
861+
annotator: true
853862
}),
854863
table: {
855864
...TABLE,
@@ -939,7 +948,8 @@ export function useConfig() {
939948
csv: true,
940949
img: true,
941950
table: true,
942-
fullscreen: true
951+
fullscreen: true,
952+
annotator: true
943953
}),
944954
translations: {
945955
target: 'Target',
@@ -1075,7 +1085,8 @@ export function useConfig() {
10751085
img: true,
10761086
table: true,
10771087
labels: true,
1078-
fullscreen: true
1088+
fullscreen: true,
1089+
annotator: true
10791090
}),
10801091
translations: {
10811092
category: 'Category',
@@ -1142,7 +1153,8 @@ export function useConfig() {
11421153
userOptions: USER_OPTIONS({
11431154
pdf: true,
11441155
img: true,
1145-
fullscreen: true
1156+
fullscreen: true,
1157+
annotator: true
11461158
}),
11471159
translations: {
11481160
base: 'Base'
@@ -1194,7 +1206,8 @@ export function useConfig() {
11941206
userOptions: USER_OPTIONS({
11951207
pdf: true,
11961208
img: true,
1197-
fullscreen: true
1209+
fullscreen: true,
1210+
annotator: true
11981211
})
11991212
}
12001213

@@ -1242,7 +1255,8 @@ export function useConfig() {
12421255
userOptions: USER_OPTIONS({
12431256
pdf: true,
12441257
img: true,
1245-
fullscreen: true
1258+
fullscreen: true,
1259+
annotator: true
12461260
})
12471261
}
12481262

@@ -1408,7 +1422,8 @@ export function useConfig() {
14081422
csv: true,
14091423
img: true,
14101424
table: true,
1411-
fullscreen: true
1425+
fullscreen: true,
1426+
annotator: true
14121427
}),
14131428
translations: {
14141429
total: 'Total',
@@ -1479,7 +1494,8 @@ export function useConfig() {
14791494
csv: true,
14801495
img: true,
14811496
table: true,
1482-
fullscreen: true
1497+
fullscreen: true,
1498+
annotator: true
14831499
}),
14841500
table: {
14851501
...TABLE,
@@ -1590,7 +1606,8 @@ export function useConfig() {
15901606
img: true,
15911607
table: true,
15921608
sort: true,
1593-
fullscreen: true
1609+
fullscreen: true,
1610+
annotator: true
15941611
}),
15951612
table: {
15961613
...TABLE,
@@ -1685,7 +1702,8 @@ export function useConfig() {
16851702
csv: true,
16861703
img: true,
16871704
table: true,
1688-
fullscreen: true
1705+
fullscreen: true,
1706+
annotator: true
16891707
}),
16901708
table: {
16911709
...TABLE,
@@ -1836,6 +1854,7 @@ export function useConfig() {
18361854
img: true,
18371855
table: true,
18381856
fullscreen: true,
1857+
annotator: true
18391858
}),
18401859
table: {
18411860
...TABLE,
@@ -1945,7 +1964,8 @@ export function useConfig() {
19451964
csv: true,
19461965
img: true,
19471966
table: true,
1948-
fullscreen: true
1967+
fullscreen: true,
1968+
annotator: true
19491969
}),
19501970
table: {
19511971
...TABLE,
@@ -2353,15 +2373,17 @@ export function useConfig() {
23532373
tooltip: true,
23542374
pdf: true,
23552375
img: true,
2356-
fullscreen: true
2376+
fullscreen: true,
2377+
annotator: true
23572378
},
23582379
userOptionsButtonTitles: {
23592380
open: 'Open options',
23602381
close: 'Close options',
23612382
tooltip: 'Toggle tooltip',
23622383
pdf: 'Download PDF',
23632384
img: 'Download PNG',
2364-
fullscreen: 'Toggle fullscreen'
2385+
fullscreen: 'Toggle fullscreen',
2386+
annotator: 'Toggle annotator'
23652387
},
23662388
title: '',
23672389
titleBold: true,
@@ -2494,7 +2516,8 @@ export function useConfig() {
24942516
csv: true,
24952517
img: true,
24962518
table: true,
2497-
fullscreen: true
2519+
fullscreen: true,
2520+
annotator: true
24982521
}),
24992522
table: {
25002523
...TABLE,
@@ -2540,7 +2563,8 @@ export function useConfig() {
25402563
userOptions: USER_OPTIONS({
25412564
pdf: true,
25422565
img: true,
2543-
fullscreen: true
2566+
fullscreen: true,
2567+
annotator: true
25442568
})
25452569
}
25462570

@@ -2588,7 +2612,8 @@ export function useConfig() {
25882612
userOptions: USER_OPTIONS({
25892613
pdf: true,
25902614
img: true,
2591-
fullscreen: true
2615+
fullscreen: true,
2616+
annotator: true
25922617
})
25932618
}
25942619

@@ -2643,7 +2668,8 @@ export function useConfig() {
26432668
csv: true,
26442669
img: true,
26452670
table: true,
2646-
fullscreen: true
2671+
fullscreen: true,
2672+
annotator: true
26472673
}),
26482674
table: {
26492675
...TABLE,
@@ -2736,7 +2762,8 @@ export function useConfig() {
27362762
csv: true,
27372763
img: true,
27382764
table: true,
2739-
fullscreen: true
2765+
fullscreen: true,
2766+
annotator: true
27402767
}),
27412768
table: {
27422769
...TABLE,
@@ -2813,7 +2840,8 @@ export function useConfig() {
28132840
csv: true,
28142841
img: true,
28152842
table: true,
2816-
fullscreen: true
2843+
fullscreen: true,
2844+
annotator: true
28172845
}),
28182846
table: {
28192847
...TABLE,
@@ -2860,7 +2888,8 @@ export function useConfig() {
28602888
img: true,
28612889
table: true,
28622890
labels: true,
2863-
fullscreen: true
2891+
fullscreen: true,
2892+
annotator: true
28642893
}),
28652894
table: {
28662895
...TABLE,
@@ -2887,7 +2916,8 @@ export function useConfig() {
28872916
img: true,
28882917
table: true,
28892918
labels: true,
2890-
fullscreen: true
2919+
fullscreen: true,
2920+
annotator: true
28912921
}),
28922922
style: {
28932923
fontFamily: 'inherit',
@@ -3017,7 +3047,8 @@ export function useConfig() {
30173047
csv: true,
30183048
img: true,
30193049
table: true,
3020-
fullscreen: true
3050+
fullscreen: true,
3051+
annotator: true
30213052
}),
30223053
table: {
30233054
...TABLE,
@@ -3047,7 +3078,8 @@ export function useConfig() {
30473078
img: true,
30483079
table: true,
30493080
labels: true,
3050-
fullscreen: true
3081+
fullscreen: true,
3082+
annotator: true
30513083
}),
30523084
style: {
30533085
fontFamily: 'inherit',
@@ -3151,7 +3183,8 @@ export function useConfig() {
31513183
csv: true,
31523184
img: true,
31533185
table: true,
3154-
fullscreen: true
3186+
fullscreen: true,
3187+
annotator: true
31553188
}),
31563189
style: {
31573190
fontFamily: 'inherit',
@@ -3316,7 +3349,8 @@ export function useConfig() {
33163349
csv: true,
33173350
img: true,
33183351
table: true,
3319-
fullscreen: true
3352+
fullscreen: true,
3353+
annotator: true
33203354
}),
33213355
table: {
33223356
...TABLE,
@@ -3452,7 +3486,8 @@ export function useConfig() {
34523486
csv: true,
34533487
img: true,
34543488
table: true,
3455-
fullscreen: true
3489+
fullscreen: true,
3490+
annotator: true
34563491
}),
34573492
style: {
34583493
fontFamily: 'inherit',
@@ -3511,7 +3546,8 @@ export function useConfig() {
35113546
table: true,
35123547
labels: true,
35133548
fullscreen: true,
3514-
stack: true
3549+
stack: true,
3550+
annotator: true
35153551
}),
35163552
style: {
35173553
fontFamily: 'Arial', // A defined font must be provided as 'inherit' fails with canvas
@@ -3626,7 +3662,8 @@ export function useConfig() {
36263662
csv: true,
36273663
img: true,
36283664
table: true,
3629-
fullscreen: true
3665+
fullscreen: true,
3666+
annotator: true
36303667
}),
36313668
style: {
36323669
fontFamily: 'inherit',
@@ -3685,7 +3722,8 @@ export function useConfig() {
36853722
img: true,
36863723
table: true,
36873724
labels: true,
3688-
fullscreen: true
3725+
fullscreen: true,
3726+
annotator: true
36893727
}),
36903728
style: {
36913729
fontFamily: 'inherit',
@@ -4686,7 +4724,8 @@ export function useConfig() {
46864724
table: false,
46874725
labels: false,
46884726
fullscreen: true,
4689-
stack: false
4727+
stack: false,
4728+
annotator: true
46904729
}),
46914730
style: {
46924731
fontFamily: 'inherit',

0 commit comments

Comments
 (0)