Skip to content

Commit d518a6d

Browse files
include Plotly.js localization
1 parent ec2ca6f commit d518a6d

File tree

2 files changed

+232
-0
lines changed

2 files changed

+232
-0
lines changed

viz-lib/src/visualizations/chart/plotly/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as Plotly from "plotly.js";
22

3+
import "./locales"
34
import prepareData from "./prepareData";
45
import prepareLayout from "./prepareLayout";
56
import updateData from "./updateData";
@@ -10,6 +11,7 @@ import { prepareCustomChartData, createCustomChartRenderer } from "./customChart
1011
// @ts-expect-error ts-migrate(2339) FIXME: Property 'setPlotConfig' does not exist on type 't... Remove this comment to see the full error message
1112
Plotly.setPlotConfig({
1213
modeBarButtonsToRemove: ["sendDataToCloud"],
14+
locale: window.navigator.language,
1315
});
1416

1517
export {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
import * as Plotly from "plotly.js";
2+
3+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
4+
import localeAf from "plotly.js/lib/locales/af";
5+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
6+
import localeAm from "plotly.js/lib/locales/am";
7+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
8+
import localeAr_dz from "plotly.js/lib/locales/ar-dz";
9+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
10+
import localeAr_eg from "plotly.js/lib/locales/ar-eg";
11+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
12+
import localeAr from "plotly.js/lib/locales/ar";
13+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
14+
import localeAz from "plotly.js/lib/locales/az";
15+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
16+
import localeBg from "plotly.js/lib/locales/bg";
17+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
18+
import localeBs from "plotly.js/lib/locales/bs";
19+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
20+
import localeCa from "plotly.js/lib/locales/ca";
21+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
22+
import localeCs from "plotly.js/lib/locales/cs";
23+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
24+
import localeCy from "plotly.js/lib/locales/cy";
25+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
26+
import localeDa from "plotly.js/lib/locales/da";
27+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
28+
import localeDe_ch from "plotly.js/lib/locales/de-ch";
29+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
30+
import localeDe from "plotly.js/lib/locales/de";
31+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
32+
import localeEl from "plotly.js/lib/locales/el";
33+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
34+
import localeEo from "plotly.js/lib/locales/eo";
35+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
36+
import localeEs_ar from "plotly.js/lib/locales/es-ar";
37+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
38+
import localeEs_pe from "plotly.js/lib/locales/es-pe";
39+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
40+
import localeEs from "plotly.js/lib/locales/es";
41+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
42+
import localeEt from "plotly.js/lib/locales/et";
43+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
44+
import localeEu from "plotly.js/lib/locales/eu";
45+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
46+
import localeFa from "plotly.js/lib/locales/fa";
47+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
48+
import localeFi from "plotly.js/lib/locales/fi";
49+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
50+
import localeFo from "plotly.js/lib/locales/fo";
51+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
52+
import localeFr_ch from "plotly.js/lib/locales/fr-ch";
53+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
54+
import localeFr from "plotly.js/lib/locales/fr";
55+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
56+
import localeGl from "plotly.js/lib/locales/gl";
57+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
58+
import localeGu from "plotly.js/lib/locales/gu";
59+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
60+
import localeHe from "plotly.js/lib/locales/he";
61+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
62+
import localeHi_in from "plotly.js/lib/locales/hi-in";
63+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
64+
import localeHr from "plotly.js/lib/locales/hr";
65+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
66+
import localeHu from "plotly.js/lib/locales/hu";
67+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
68+
import localeHy from "plotly.js/lib/locales/hy";
69+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
70+
import localeId from "plotly.js/lib/locales/id";
71+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
72+
import localeIs from "plotly.js/lib/locales/is";
73+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
74+
import localeIt from "plotly.js/lib/locales/it";
75+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
76+
import localeJa from "plotly.js/lib/locales/ja";
77+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
78+
import localeKa from "plotly.js/lib/locales/ka";
79+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
80+
import localeKm from "plotly.js/lib/locales/km";
81+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
82+
import localeKo from "plotly.js/lib/locales/ko";
83+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
84+
import localeLt from "plotly.js/lib/locales/lt";
85+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
86+
import localeLv from "plotly.js/lib/locales/lv";
87+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
88+
import localeMe_me from "plotly.js/lib/locales/me-me";
89+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
90+
import localeMe from "plotly.js/lib/locales/me";
91+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
92+
import localeMk from "plotly.js/lib/locales/mk";
93+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
94+
import localeMl from "plotly.js/lib/locales/ml";
95+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
96+
import localeMs from "plotly.js/lib/locales/ms";
97+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
98+
import localeMt from "plotly.js/lib/locales/mt";
99+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
100+
import localeNl_be from "plotly.js/lib/locales/nl-be";
101+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
102+
import localeNl from "plotly.js/lib/locales/nl";
103+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
104+
import localeNo from "plotly.js/lib/locales/no";
105+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
106+
import localePa from "plotly.js/lib/locales/pa";
107+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
108+
import localePl from "plotly.js/lib/locales/pl";
109+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
110+
import localePt_br from "plotly.js/lib/locales/pt-br";
111+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
112+
import localePt_pt from "plotly.js/lib/locales/pt-pt";
113+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
114+
import localeRm from "plotly.js/lib/locales/rm";
115+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
116+
import localeRo from "plotly.js/lib/locales/ro";
117+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
118+
import localeRu from "plotly.js/lib/locales/ru";
119+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
120+
import localeSk from "plotly.js/lib/locales/sk";
121+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
122+
import localeSl from "plotly.js/lib/locales/sl";
123+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
124+
import localeSq from "plotly.js/lib/locales/sq";
125+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
126+
import localeSr_sr from "plotly.js/lib/locales/sr-sr";
127+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
128+
import localeSr from "plotly.js/lib/locales/sr";
129+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
130+
import localeSv from "plotly.js/lib/locales/sv";
131+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
132+
import localeSw from "plotly.js/lib/locales/sw";
133+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
134+
import localeTa from "plotly.js/lib/locales/ta";
135+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
136+
import localeTh from "plotly.js/lib/locales/th";
137+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
138+
import localeTr from "plotly.js/lib/locales/tr";
139+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
140+
import localeTt from "plotly.js/lib/locales/tt";
141+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
142+
import localeUk from "plotly.js/lib/locales/uk";
143+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
144+
import localeUr from "plotly.js/lib/locales/ur";
145+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
146+
import localeVi from "plotly.js/lib/locales/vi";
147+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
148+
import localeZh_cn from "plotly.js/lib/locales/zh-cn";
149+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
150+
import localeZh_hk from "plotly.js/lib/locales/zh-hk";
151+
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module
152+
import localeZh_tw from "plotly.js/lib/locales/zh-tw";
153+
154+
(Plotly as any).register([
155+
localeAf,
156+
localeAm,
157+
localeAr_dz,
158+
localeAr_eg,
159+
localeAr,
160+
localeAz,
161+
localeBg,
162+
localeBs,
163+
localeCa,
164+
localeCs,
165+
localeCy,
166+
localeDa,
167+
localeDe_ch,
168+
localeDe,
169+
localeEl,
170+
localeEo,
171+
localeEs_ar,
172+
localeEs_pe,
173+
localeEs,
174+
localeEt,
175+
localeEu,
176+
localeFa,
177+
localeFi,
178+
localeFo,
179+
localeFr_ch,
180+
localeFr,
181+
localeGl,
182+
localeGu,
183+
localeHe,
184+
localeHi_in,
185+
localeHr,
186+
localeHu,
187+
localeHy,
188+
localeId,
189+
localeIs,
190+
localeIt,
191+
localeJa,
192+
localeKa,
193+
localeKm,
194+
localeKo,
195+
localeLt,
196+
localeLv,
197+
localeMe_me,
198+
localeMe,
199+
localeMk,
200+
localeMl,
201+
localeMs,
202+
localeMt,
203+
localeNl_be,
204+
localeNl,
205+
localeNo,
206+
localePa,
207+
localePl,
208+
localePt_br,
209+
localePt_pt,
210+
localeRm,
211+
localeRo,
212+
localeRu,
213+
localeSk,
214+
localeSl,
215+
localeSq,
216+
localeSr_sr,
217+
localeSr,
218+
localeSv,
219+
localeSw,
220+
localeTa,
221+
localeTh,
222+
localeTr,
223+
localeTt,
224+
localeUk,
225+
localeUr,
226+
localeVi,
227+
localeZh_cn,
228+
localeZh_hk,
229+
localeZh_tw,
230+
]);

0 commit comments

Comments
 (0)