UNPKG

18.5 kBJavaScriptView Raw
1function styleInject(css, ref) {
2 if ( ref === void 0 ) ref = {};
3 var insertAt = ref.insertAt;
4
5 if (!css || typeof document === 'undefined') { return; }
6
7 var head = document.head || document.getElementsByTagName('head')[0];
8 var style = document.createElement('style');
9 style.type = 'text/css';
10
11 if (insertAt === 'top') {
12 if (head.firstChild) {
13 head.insertBefore(style, head.firstChild);
14 } else {
15 head.appendChild(style);
16 }
17 } else {
18 head.appendChild(style);
19 }
20
21 if (style.styleSheet) {
22 style.styleSheet.cssText = css;
23 } else {
24 style.appendChild(document.createTextNode(css));
25 }
26}
27
28var css = "@import url('https://fonts.googleapis.com/css2?family=Lato&display=swap');";
29styleInject(css);
30
31/**
32 * Froala theme
33 */
34var themeObject = {
35 name: 'froala',
36 theme: {
37 base: {
38 chart: {
39 // canvas
40 showBorder: 0,
41 showCanvasBorder: 0,
42 canvasBgAlpha: 0,
43 bgColor: "#FFFFFF",
44 // text
45 baseFont: "Lato",
46 baseFontSize: 14,
47 baseFontColor: "#8892a0",
48 outCnvBaseFont: "Lato",
49 outCnvBaseFontSize: 14,
50 outCnvbaseFontColor: "#8892a0",
51 captionFontSize: 20,
52 captionFontBold: 0,
53 captionFontColor: "#444444",
54 subCaptionFontSize: 18,
55 subCaptionFontBold: 0,
56 subCaptionFontColor: "#444444",
57 xAxisNameFontSize: 16,
58 yAxisNameFontSize: 16,
59 xAxisNameFontColor: "#444444",
60 yAxisNameFontColor: "#444444",
61 valueFontSize: 14,
62 // data plot
63 showValues: 0,
64 showPlotBorder: 0,
65 usePlotGradientColor: 0,
66 showAlternateHGridColor: 0,
67 showAlternateVGridColor: 0,
68 paletteColors:
69 "#007bff, #ffc107, #dc3545, #28a745, #6c757d, #6f42c1, #fd7e14, #17a2b8",
70 plothighlighteffect: "fadeout",
71 // grid lines
72 divLineColor: "#000000",
73 divLineAlpha: 10,
74 // tooltip and crossline
75 tooltipBgColor: "#222222",
76 tooltipColor: "#ffffff",
77 tooltipPadding: 6,
78 tooltipBorderThickness: 0,
79 crossLineAnimation: 1,
80 crossLineAlpha: 10,
81 crossLineColor: "#000000",
82 // shadow
83 showShadow: 0,
84 // legend
85 legendBorderAlpha: 0,
86 LegendShadow: 0,
87 legendItemFontSize: 14,
88 drawCustomLegendIcon: 1,
89 // hover effect
90 showHoverEffect: 1,
91 plotHoverEffect: 1,
92 plotFillHoverAlpha: "90",
93 barHoverAlpha: "90",
94 anchorHoverEffect: "1",
95 anchorHoverRadius: "4",
96 anchorBorderHoverThickness: "1.5",
97 anchorBgHoverColor: "#FFFFFF",
98 // padding and margins
99 yAxisNamePadding: 10,
100 sYAxisNamePadding: 10,
101 xAxisNamePadding: 10,
102 captionPadding: 10,
103 canvasPadding: 10,
104 // scroll
105 flatScrollBars: "1",
106 scrollShowButtons: "0",
107 scrollheight: "10",
108 scrollColor: "#e3e3e3",
109 }
110 },
111 // pie
112 pie: {
113 chart: {
114 smartLineColor: "#000000",
115 smartLineAlpha: 10,
116 use3DLighting: "0",
117 showPercentValues: "1",
118 showValues: "1",
119 showPercentInTooltip: "0",
120 showLegend: 1,
121 legendIconSides: "1",
122 }
123 },
124 // doughnut
125 doughnut: {
126 chart: {
127 use3DLighting: "0",
128 showPercentValues: "1",
129 showValues: "1",
130 showPercentInTooltip: "0",
131 showLegend: 1,
132 legendIconSides: "1",
133 }
134 },
135 // column
136 column: {
137 chart: {
138 drawCrossLine: 1,
139 legendPosition: "top-right"
140 }
141 },
142 // bar
143 bar: {
144 chart: {
145 drawCrossLine: 1,
146 legendPosition: "top-right"
147 }
148 },
149 // area
150 area: {
151 chart: {
152 drawCrossLine: "1",
153 showLegend: "1",
154 legendIconSides: "1",
155 drawCrossLine: 1,
156 legendPosition: "top-right"
157 }
158 },
159 // line
160 line: {
161 chart: {
162 lineThickness: 2,
163 drawCrossLine: "1",
164 showLegend: "1",
165 legendIconSides: "1",
166 drawCrossLine: 1,
167 legendPosition: "top-right"
168 }
169 },
170 // stackedcolumn
171 stackedcolumn: {
172 chart: {
173 drawCrossLine: 1,
174 legendPosition: "top-right"
175 }
176 },
177 // stackedbar
178 stackedbar: {
179 chart: {
180 drawCrossLine: 1,
181 legendPosition: "top-right"
182 }
183 },
184 // stackedarea
185 stackedarea: {
186 chart: {
187 drawCrossLine: "1",
188 showLegend: "1",
189 legendIconSides: "1",
190 drawCrossLine: 1,
191 legendPosition: "top-right"
192 }
193 },
194 // combination
195 combination: {
196 chart: {
197 drawCrossLine: "1",
198 legendIconSides: "1",
199 legendPosition: "top-right"
200 }
201 },
202 // scatter
203 scatter: {
204 chart: {
205 drawCustomLegendIcon: 0,
206 legendPosition: "top-right",
207 anchorRadius: 4,
208 anchorHoverRadius: 6
209 },
210 },
211 // bubble
212 bubble: {
213 chart: {
214 use3DLighting: "0",
215 legendIconSides: "2",
216 plotFillAlpha: "80",
217 legendPosition: "top-right"
218 },
219 },
220 // angulargauge
221 angulargauge: {
222 chart: {
223 setAdaptiveMin: "1",
224 adjustTM: "1",
225 tickvaluedistance: "10",
226 placeTicksInside: "0",
227 autoAlignTickValues: "1",
228 showGaugeBorder: "0",
229 minortmnumber: "0",
230 majorTMHeight: "8",
231 gaugeFillMix: "{light-0}",
232 pivotbgcolor: "#000000",
233 pivotfillmix: "0",
234 showpivotborder: "1",
235 pivotBorderColor: "#FFFFFF",
236 showValue: "0",
237 valueBelowPivot: "1"
238 },
239 dials: {
240 dial: [
241 {
242 bgColor: "#000000",
243 borderThickness: "0"
244 }
245 ]
246 }
247 },
248 // funnel
249 funnel: {
250 chart: {
251 is2D: "1",
252 streamlinedData: "1",
253 useSameSlantAngle: "1",
254 alignCaptionWithCanvas: "1",
255 smartLineColor: "#000000",
256 smartLineAlpha: 10,
257 legendPosition: "right"
258 }
259 },
260 // pyramid
261 pyramid: {
262 chart: {
263 use3dlighting: "0",
264 is2D: "1",
265 streamlinedData: "1",
266 useSameSlantAngle: "1",
267 alignCaptionWithCanvas: "1",
268 smartLineColor: "#000000",
269 smartLineAlpha: 10,
270 legendPosition: "right"
271 }
272 },
273 // heatmap
274 heatmap: {
275 chart: {
276 showPlotBorder: "1",
277 plotBorderAlpha: "100",
278 plotBorderThickness: "0.5",
279 plotBorderColor: "#000000",
280 plotBorderAlpha: 10,
281 valueFontColor: "#FFFFFF",
282 tlFontColor: "#FDFDFD",
283 tlFont: "Lato",
284 tlFontSize: "12",
285 trFontColor: "#FDFDFD",
286 trFont: "Lato",
287 trFontSize: "12",
288 blFontColor: "#FDFDFD",
289 blFont: "Lato",
290 blFontSize: "12",
291 brFontColor: "#FDFDFD",
292 brFont: "Lato",
293 brFontSize: "12",
294 captionPadding: "20",
295 legendScaleLineThickness: "0",
296 legendaxisborderalpha: "0"
297 }
298 },
299 // sankey
300 sankey: {
301 chart: {
302 nodeLabelFontColor: "#8892a0",
303 nodeLabelFontSize: 14,
304 nodeLabelPosition: "inside",
305 nodeHoverAlpha: 65,
306 legendPosition: "bottom",
307 linkColor: "source",
308 linkHoverAlpha: 65,
309 linkAlpha: 40,
310 enableDrag: 0,
311 showLegend: 0,
312 legendPosition: "right"
313 }
314 },
315 // chord
316 chord: {
317 chart: {
318 legendPosition: "right",
319 nodeThickness: 10,
320 nodeLabelColor: "#8892a0",
321 nodeLabelFontSize: 14,
322 nodeLabelPosition: "outside",
323 nodeHoverAlpha: 100,
324 nodeLinkPadding: 5,
325 nodeBorderThickness: 0.5,
326 nodeAlpha: 100,
327 linkAlpha: 40,
328 linkBorderAlpha: 40,
329 linkHoverAlpha: 65
330 }
331 },
332 // radar
333 radar: {
334 chart: {
335 showLegend: "1",
336 legendIconSides: "2",
337 plotFillAlpha: "65",
338 drawAnchors: "0"
339 }
340 },
341 // timeseries
342 timeseries: {
343 caption: {
344 style: {
345 text: {
346 "font-size": 20,
347 "font-family": "Lato",
348 fill: "#444444"
349 }
350 }
351 },
352 subcaption: {
353 style: {
354 text: {
355 "font-size": 18,
356 "font-family": "Lato",
357 fill: "#444444"
358 }
359 }
360 },
361 crossline: {
362 style: {
363 line: {
364 stroke: "#000000",
365 "stroke-width": 1,
366 opacity: 0.1
367 }
368 }
369 },
370 chart: {
371 paletteColors:
372 "#007bff, #ffc107, #dc3545, #28a745, #6c757d, #6f42c1, #fd7e14, #17a2b8",
373 baseFont: "Lato",
374 multiCanvasTooltip: 1,
375 style: {
376 text: { "font-family": "Lato", "font-size": 14 },
377 canvas: { stroke: "##000000", "stroke-width": 1, opacity: 0.1 },
378 },
379 },
380 tooltip: {
381 style: {
382 container: {
383 "background-color": "#222222",
384 border: "none",
385 padding: "6px",
386 },
387 text: { "font-size": "14px", color: "#FFFFFF" },
388 header: {
389 color: "#FFFFFF",
390 "font-family": "Lato",
391 padding: "0px"
392 },
393 body: { padding: "0px" },
394 },
395 },
396 navigator: {
397 scrollbar: {
398 style: {
399 button: { fill: "#E3E3E3" },
400 track: {
401 fill: "#FFFFFF",
402 stroke: "#000000",
403 "stroke-width": 1,
404 opacity: 0.1,
405 },
406 scroller: { fill: "#E3E3E3" },
407 },
408 },
409 window: { style: { handle: { fill: "#E3E3E3" } } },
410 },
411 legend: {
412 style: {
413 text: {
414 fill: "#8892a0",
415 "font-size": 14,
416 "font-family": "Lato"
417 }
418 }
419 },
420 xaxis: {
421 style: {
422 title: {
423 "font-size": 16,
424 "font-family": "Lato",
425 fill: "#444444"
426 },
427 "grid-line": {
428 stroke: "#000000",
429 "stroke-width": 0.55,
430 opacity: 0.1
431 },
432 "tick-mark-major": {
433 stroke: "#000000",
434 "stroke-width": 0.5,
435 opacity: 0.1
436 },
437 "tick-mark-minor": {
438 stroke: "#000000",
439 "stroke-width": 0.25,
440 opacity: 0.1
441 },
442 "label-major": { color: "#8892a0" },
443 "label-minor": { color: "#8892a0" },
444 "label-context": {
445 color: "#8892a0",
446 "font-family": "Lato",
447 },
448 },
449 },
450 plotconfig: {
451 column: {
452 style: {
453 "plot:hover": { opacity: 0.4 },
454 "plot:highlight": { opacity: 0.65 },
455 },
456 },
457 line: {
458 style: { plot: { "stroke-width": 2 }, anchor: { "stroke-width": 0 } },
459 },
460 area: { style: { anchor: { "stroke-width": 0 } } },
461 candlestick: {
462 style: {
463 bear: { stroke: "#dc3545", fill: "#dc3545" },
464 bull: { stroke: "#28a745", fill: "#28a745" },
465 "bear:hover": { opacity: 0.4 },
466 "bear:highlight": { opacity: 0.65 },
467 "bull:hover": { opacity: 0.4 },
468 "bull:highlight": { opacity: 0.65 },
469 },
470 },
471 ohlc: {
472 style: {
473 bear: { stroke: "#dc3545", fill: "#dc3545" },
474 bull: { stroke: "#28a745", fill: "#28a745" },
475 "bear:hover": { opacity: 0.4 },
476 "bear:highlight": { opacity: 0.65 },
477 "bull:hover": { opacity: 0.4 },
478 "bull:highlight": { opacity: 0.65 },
479 },
480 },
481 },
482 yaxis: [
483 {
484 style: {
485 title: {
486 "font-size": 16,
487 "font-family": "Lato",
488 fill: "#444444",
489 },
490 "tick-mark": {
491 stroke: "#000000",
492 "stroke-width": 0.5,
493 opacity: 0.1,
494 },
495 "grid-line": {
496 stroke: "#000000",
497 "stroke-width": 0.5,
498 opacity: 0.1,
499 },
500 label: { color: "#8892a0" },
501 },
502 },
503 ],
504 extensions: {
505 customRangeSelector: {
506 style: {
507 "title-text": { "font-family": "Lato", fill: "#007bff" },
508 "title-icon": { "font-family": "Lato", fill: "#007bff" },
509 label: {
510 color: "#8892a0",
511 "font-family": "Lato",
512 "font-size": "12px",
513 },
514 input: {
515 "font-family": "Lato",
516 "font-size": "12px",
517 },
518 "button-apply": {
519 color: "#FFFFFF",
520 "background-color": "#007bff",
521 border: "none",
522 },
523 "button-apply:hover": { "font-family": "Lato" },
524 "button-cancel": {
525 color: "#8892a0",
526 "background-color": "#FFFFFF",
527 border: "none",
528 },
529 "button-cancel:hover": {
530 color: "#007bff",
531 "font-family": "Lato",
532 },
533 "cal-navprev": {
534 "font-family": "Lato",
535 "font-weight": 400,
536 },
537 "cal-navnext": {
538 "font-family": "Lato",
539 "font-weight": 400,
540 },
541 "cal-header": {
542 "background-color": "#007bff",
543 "font-family": "Lato",
544 },
545 "cal-selecteddate": {
546 color: "#FEFEFE",
547 "background-color": "#007bff",
548 "font-family": "Lato",
549 "font-size": "12px",
550 border: "none",
551 },
552 "cal-date": {
553 color: "#5F5F5F",
554 "font-family": "Lato",
555 "font-size": "12px",
556 border: "none",
557 },
558 "cal-disableddate": {
559 color: "#CACACA",
560 "font-family": "Lato",
561 "font-size": "12px",
562 border: "none",
563 },
564 "cal-date:hover": {
565 "background-color": "#007bff",
566 color: "#FEFEFE",
567 "font-family": "Lato",
568 border: "none",
569 },
570 "cal-weekend": { "background-color": "rgba(0, 123, 255, 0.2)" },
571 },
572 },
573 standardRangeSelector: {
574 style: {
575 "button-text": { fill: "#999999" },
576 "button-text:hover": {
577 fill: "#007bff",
578 "font-family": "Lato",
579 },
580 "button-text:active": {
581 fill: "#007bff",
582 "font-family": "Lato",
583 },
584 separator: { stroke: "#000000", opacity: 0.1 },
585 },
586 },
587 }
588 }
589 }
590};
591
592var index = {
593 extension: themeObject,
594 name: "froalaTheme",
595 type: "theme"
596};
597
598export default index;