@vectara/vectara-ui 19.0.0 → 19.1.0

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.
Files changed (54) hide show
  1. package/lib/components/chart/BarChart.d.ts +20 -0
  2. package/lib/components/chart/BarChart.js +28 -0
  3. package/lib/components/chart/ComposedChart.d.ts +21 -0
  4. package/lib/components/chart/ComposedChart.js +29 -0
  5. package/lib/components/chart/LineChart.d.ts +22 -0
  6. package/lib/components/chart/LineChart.js +42 -0
  7. package/lib/components/chart/PieChart.d.ts +15 -0
  8. package/lib/components/chart/PieChart.js +36 -0
  9. package/lib/components/chart/ScatterChart.d.ts +18 -0
  10. package/lib/components/chart/ScatterChart.js +34 -0
  11. package/lib/components/chart/Sparkline.d.ts +13 -0
  12. package/lib/components/chart/Sparkline.js +23 -0
  13. package/lib/components/chart/TreeMap.d.ts +13 -0
  14. package/lib/components/chart/TreeMap.js +51 -0
  15. package/lib/components/chart/_index.scss +19 -0
  16. package/lib/components/chart/chartTheme.d.ts +21 -0
  17. package/lib/components/chart/chartTheme.js +13 -0
  18. package/lib/components/chart/palette.d.ts +5 -0
  19. package/lib/components/chart/palette.js +29 -0
  20. package/lib/components/context/Theme.d.ts +8 -0
  21. package/lib/components/context/Theme.js +40 -3
  22. package/lib/components/index.d.ts +10 -2
  23. package/lib/components/index.js +9 -1
  24. package/lib/styles/index.css +22 -0
  25. package/package.json +4 -3
  26. package/src/docs/Docs.tsx +10 -0
  27. package/src/docs/pages/barChart/Basic.tsx +21 -0
  28. package/src/docs/pages/barChart/Horizontal.tsx +20 -0
  29. package/src/docs/pages/barChart/Stacked.tsx +23 -0
  30. package/src/docs/pages/barChart/index.tsx +29 -0
  31. package/src/docs/pages/colorPalette/ChartColors.tsx +68 -0
  32. package/src/docs/pages/colorPalette/index.tsx +7 -0
  33. package/src/docs/pages/composedChart/Basic.tsx +25 -0
  34. package/src/docs/pages/composedChart/index.tsx +15 -0
  35. package/src/docs/pages/lineChart/Area.tsx +25 -0
  36. package/src/docs/pages/lineChart/Basic.tsx +23 -0
  37. package/src/docs/pages/lineChart/Curved.tsx +25 -0
  38. package/src/docs/pages/lineChart/StackedArea.tsx +27 -0
  39. package/src/docs/pages/lineChart/index.tsx +36 -0
  40. package/src/docs/pages/pieChart/Basic.tsx +13 -0
  41. package/src/docs/pages/pieChart/Donut.tsx +12 -0
  42. package/src/docs/pages/pieChart/ManyValues.tsx +51 -0
  43. package/src/docs/pages/pieChart/Unlabeled.tsx +15 -0
  44. package/src/docs/pages/pieChart/index.tsx +36 -0
  45. package/src/docs/pages/scatterChart/Basic.tsx +31 -0
  46. package/src/docs/pages/scatterChart/Dense.tsx +144 -0
  47. package/src/docs/pages/scatterChart/index.tsx +22 -0
  48. package/src/docs/pages/sparkline/Basic.tsx +7 -0
  49. package/src/docs/pages/sparkline/Inline.tsx +21 -0
  50. package/src/docs/pages/sparkline/index.tsx +22 -0
  51. package/src/docs/pages/treeMap/Basic.tsx +14 -0
  52. package/src/docs/pages/treeMap/Nested.tsx +88 -0
  53. package/src/docs/pages/treeMap/index.tsx +22 -0
  54. package/src/docs/pages.tsx +11 -0
@@ -0,0 +1,144 @@
1
+ import { VuiScatterChart } from "../../../lib";
2
+
3
+ // Three overlapping clouds of 160 points each — nearly 500 points total — to show a dense scatter.
4
+ const modelA = [
5
+ { x: 89, y: 0.719 }, { x: 196, y: 0.726 }, { x: 145, y: 0.782 }, { x: 198, y: 0.872 },
6
+ { x: 152, y: 0.796 }, { x: 130, y: 0.882 }, { x: 162, y: 0.761 }, { x: 101, y: 0.772 },
7
+ { x: 157, y: 0.805 }, { x: 92, y: 0.853 }, { x: 143, y: 0.854 }, { x: 168, y: 0.849 },
8
+ { x: 166, y: 0.719 }, { x: 102, y: 0.835 }, { x: 98, y: 0.867 }, { x: 147, y: 0.756 },
9
+ { x: 81, y: 0.711 }, { x: 168, y: 0.729 }, { x: 149, y: 0.777 }, { x: 138, y: 0.869 },
10
+ { x: 95, y: 0.859 }, { x: 133, y: 0.734 }, { x: 176, y: 0.75 }, { x: 182, y: 0.835 },
11
+ { x: 128, y: 0.871 }, { x: 152, y: 0.855 }, { x: 96, y: 0.801 }, { x: 182, y: 0.884 },
12
+ { x: 186, y: 0.714 }, { x: 94, y: 0.737 }, { x: 109, y: 0.809 }, { x: 100, y: 0.801 },
13
+ { x: 82, y: 0.861 }, { x: 114, y: 0.735 }, { x: 170, y: 0.815 }, { x: 95, y: 0.864 },
14
+ { x: 129, y: 0.765 }, { x: 95, y: 0.758 }, { x: 154, y: 0.858 }, { x: 82, y: 0.771 },
15
+ { x: 197, y: 0.884 }, { x: 143, y: 0.73 }, { x: 198, y: 0.727 }, { x: 88, y: 0.763 },
16
+ { x: 98, y: 0.714 }, { x: 96, y: 0.833 }, { x: 114, y: 0.848 }, { x: 161, y: 0.733 },
17
+ { x: 194, y: 0.777 }, { x: 134, y: 0.774 }, { x: 121, y: 0.748 }, { x: 136, y: 0.748 },
18
+ { x: 137, y: 0.807 }, { x: 82, y: 0.762 }, { x: 191, y: 0.826 }, { x: 192, y: 0.888 },
19
+ { x: 114, y: 0.845 }, { x: 124, y: 0.859 }, { x: 140, y: 0.873 }, { x: 139, y: 0.796 },
20
+ { x: 156, y: 0.711 }, { x: 97, y: 0.837 }, { x: 91, y: 0.835 }, { x: 112, y: 0.767 },
21
+ { x: 171, y: 0.887 }, { x: 126, y: 0.863 }, { x: 89, y: 0.795 }, { x: 109, y: 0.877 },
22
+ { x: 180, y: 0.839 }, { x: 104, y: 0.876 }, { x: 168, y: 0.752 }, { x: 126, y: 0.82 },
23
+ { x: 176, y: 0.727 }, { x: 189, y: 0.873 }, { x: 181, y: 0.796 }, { x: 112, y: 0.772 },
24
+ { x: 190, y: 0.83 }, { x: 174, y: 0.883 }, { x: 89, y: 0.804 }, { x: 198, y: 0.862 },
25
+ { x: 86, y: 0.887 }, { x: 149, y: 0.802 }, { x: 198, y: 0.857 }, { x: 98, y: 0.767 },
26
+ { x: 185, y: 0.76 }, { x: 179, y: 0.795 }, { x: 174, y: 0.716 }, { x: 127, y: 0.784 },
27
+ { x: 170, y: 0.834 }, { x: 192, y: 0.881 }, { x: 143, y: 0.783 }, { x: 115, y: 0.786 },
28
+ { x: 98, y: 0.834 }, { x: 195, y: 0.786 }, { x: 196, y: 0.824 }, { x: 112, y: 0.774 },
29
+ { x: 197, y: 0.882 }, { x: 130, y: 0.83 }, { x: 160, y: 0.814 }, { x: 149, y: 0.774 },
30
+ { x: 196, y: 0.854 }, { x: 119, y: 0.745 }, { x: 176, y: 0.757 }, { x: 161, y: 0.884 },
31
+ { x: 195, y: 0.788 }, { x: 107, y: 0.803 }, { x: 96, y: 0.856 }, { x: 129, y: 0.806 },
32
+ { x: 114, y: 0.797 }, { x: 98, y: 0.753 }, { x: 187, y: 0.885 }, { x: 142, y: 0.715 },
33
+ { x: 160, y: 0.753 }, { x: 128, y: 0.806 }, { x: 157, y: 0.823 }, { x: 135, y: 0.725 },
34
+ { x: 85, y: 0.845 }, { x: 85, y: 0.776 }, { x: 113, y: 0.788 }, { x: 180, y: 0.736 },
35
+ { x: 115, y: 0.753 }, { x: 100, y: 0.843 }, { x: 149, y: 0.748 }, { x: 110, y: 0.746 },
36
+ { x: 168, y: 0.854 }, { x: 133, y: 0.758 }, { x: 100, y: 0.825 }, { x: 124, y: 0.844 },
37
+ { x: 89, y: 0.805 }, { x: 146, y: 0.752 }, { x: 81, y: 0.845 }, { x: 102, y: 0.742 },
38
+ { x: 170, y: 0.727 }, { x: 86, y: 0.863 }, { x: 119, y: 0.816 }, { x: 145, y: 0.871 },
39
+ { x: 83, y: 0.874 }, { x: 182, y: 0.747 }, { x: 92, y: 0.718 }, { x: 176, y: 0.732 },
40
+ { x: 99, y: 0.819 }, { x: 194, y: 0.88 }, { x: 186, y: 0.739 }, { x: 87, y: 0.88 },
41
+ { x: 86, y: 0.828 }, { x: 101, y: 0.866 }, { x: 117, y: 0.867 }, { x: 114, y: 0.718 },
42
+ { x: 100, y: 0.78 }, { x: 197, y: 0.718 }, { x: 172, y: 0.824 }, { x: 154, y: 0.739 },
43
+ { x: 152, y: 0.729 }, { x: 165, y: 0.773 }, { x: 95, y: 0.715 }, { x: 167, y: 0.857 },
44
+ { x: 181, y: 0.769 }, { x: 190, y: 0.74 }, { x: 103, y: 0.789 }, { x: 143, y: 0.72 }
45
+ ];
46
+
47
+ const modelB = [
48
+ { x: 206, y: 0.78 }, { x: 173, y: 0.822 }, { x: 183, y: 0.796 }, { x: 210, y: 0.923 },
49
+ { x: 296, y: 0.792 }, { x: 254, y: 0.831 }, { x: 292, y: 0.893 }, { x: 277, y: 0.836 },
50
+ { x: 242, y: 0.831 }, { x: 227, y: 0.839 }, { x: 189, y: 0.873 }, { x: 187, y: 0.912 },
51
+ { x: 177, y: 0.807 }, { x: 218, y: 0.892 }, { x: 171, y: 0.871 }, { x: 203, y: 0.811 },
52
+ { x: 263, y: 0.856 }, { x: 198, y: 0.847 }, { x: 178, y: 0.882 }, { x: 242, y: 0.869 },
53
+ { x: 211, y: 0.77 }, { x: 195, y: 0.802 }, { x: 177, y: 0.895 }, { x: 182, y: 0.911 },
54
+ { x: 270, y: 0.919 }, { x: 191, y: 0.771 }, { x: 209, y: 0.84 }, { x: 217, y: 0.84 },
55
+ { x: 218, y: 0.898 }, { x: 241, y: 0.921 }, { x: 273, y: 0.891 }, { x: 299, y: 0.854 },
56
+ { x: 175, y: 0.925 }, { x: 259, y: 0.808 }, { x: 212, y: 0.787 }, { x: 274, y: 0.83 },
57
+ { x: 290, y: 0.877 }, { x: 280, y: 0.85 }, { x: 229, y: 0.88 }, { x: 261, y: 0.896 },
58
+ { x: 263, y: 0.783 }, { x: 249, y: 0.794 }, { x: 174, y: 0.818 }, { x: 252, y: 0.853 },
59
+ { x: 194, y: 0.86 }, { x: 198, y: 0.813 }, { x: 289, y: 0.864 }, { x: 240, y: 0.871 },
60
+ { x: 204, y: 0.867 }, { x: 286, y: 0.78 }, { x: 290, y: 0.817 }, { x: 295, y: 0.906 },
61
+ { x: 166, y: 0.923 }, { x: 224, y: 0.885 }, { x: 181, y: 0.894 }, { x: 266, y: 0.845 },
62
+ { x: 168, y: 0.849 }, { x: 289, y: 0.876 }, { x: 182, y: 0.877 }, { x: 216, y: 0.918 },
63
+ { x: 215, y: 0.801 }, { x: 194, y: 0.771 }, { x: 181, y: 0.879 }, { x: 187, y: 0.816 },
64
+ { x: 292, y: 0.863 }, { x: 280, y: 0.804 }, { x: 195, y: 0.915 }, { x: 192, y: 0.886 },
65
+ { x: 191, y: 0.778 }, { x: 171, y: 0.923 }, { x: 242, y: 0.785 }, { x: 290, y: 0.832 },
66
+ { x: 219, y: 0.862 }, { x: 172, y: 0.826 }, { x: 208, y: 0.84 }, { x: 298, y: 0.83 },
67
+ { x: 204, y: 0.904 }, { x: 218, y: 0.78 }, { x: 291, y: 0.878 }, { x: 167, y: 0.806 },
68
+ { x: 197, y: 0.904 }, { x: 175, y: 0.849 }, { x: 177, y: 0.846 }, { x: 201, y: 0.91 },
69
+ { x: 252, y: 0.85 }, { x: 213, y: 0.831 }, { x: 178, y: 0.852 }, { x: 188, y: 0.784 },
70
+ { x: 299, y: 0.873 }, { x: 227, y: 0.872 }, { x: 252, y: 0.84 }, { x: 204, y: 0.886 },
71
+ { x: 228, y: 0.814 }, { x: 254, y: 0.901 }, { x: 181, y: 0.817 }, { x: 295, y: 0.911 },
72
+ { x: 293, y: 0.837 }, { x: 181, y: 0.852 }, { x: 192, y: 0.87 }, { x: 292, y: 0.817 },
73
+ { x: 205, y: 0.782 }, { x: 205, y: 0.835 }, { x: 171, y: 0.809 }, { x: 282, y: 0.804 },
74
+ { x: 295, y: 0.844 }, { x: 163, y: 0.773 }, { x: 292, y: 0.849 }, { x: 181, y: 0.779 },
75
+ { x: 166, y: 0.775 }, { x: 217, y: 0.776 }, { x: 210, y: 0.813 }, { x: 205, y: 0.772 },
76
+ { x: 194, y: 0.794 }, { x: 198, y: 0.826 }, { x: 211, y: 0.817 }, { x: 215, y: 0.846 },
77
+ { x: 180, y: 0.821 }, { x: 217, y: 0.857 }, { x: 209, y: 0.789 }, { x: 247, y: 0.89 },
78
+ { x: 280, y: 0.86 }, { x: 228, y: 0.813 }, { x: 197, y: 0.814 }, { x: 205, y: 0.914 },
79
+ { x: 187, y: 0.871 }, { x: 291, y: 0.793 }, { x: 234, y: 0.844 }, { x: 262, y: 0.893 },
80
+ { x: 255, y: 0.818 }, { x: 196, y: 0.776 }, { x: 212, y: 0.794 }, { x: 184, y: 0.895 },
81
+ { x: 216, y: 0.834 }, { x: 172, y: 0.837 }, { x: 177, y: 0.79 }, { x: 294, y: 0.862 },
82
+ { x: 215, y: 0.812 }, { x: 287, y: 0.816 }, { x: 205, y: 0.832 }, { x: 196, y: 0.905 },
83
+ { x: 189, y: 0.832 }, { x: 229, y: 0.773 }, { x: 279, y: 0.834 }, { x: 179, y: 0.822 },
84
+ { x: 280, y: 0.852 }, { x: 265, y: 0.891 }, { x: 226, y: 0.912 }, { x: 184, y: 0.782 },
85
+ { x: 278, y: 0.776 }, { x: 232, y: 0.869 }, { x: 182, y: 0.898 }, { x: 191, y: 0.866 },
86
+ { x: 244, y: 0.9 }, { x: 195, y: 0.776 }, { x: 213, y: 0.84 }, { x: 300, y: 0.881 },
87
+ { x: 221, y: 0.862 }, { x: 287, y: 0.889 }, { x: 265, y: 0.91 }, { x: 217, y: 0.799 }
88
+ ];
89
+
90
+ const modelC = [
91
+ { x: 351, y: 0.917 }, { x: 373, y: 0.856 }, { x: 359, y: 0.921 }, { x: 326, y: 0.868 },
92
+ { x: 270, y: 0.945 }, { x: 339, y: 0.952 }, { x: 389, y: 0.951 }, { x: 296, y: 0.84 },
93
+ { x: 329, y: 0.951 }, { x: 300, y: 0.897 }, { x: 387, y: 0.903 }, { x: 352, y: 0.935 },
94
+ { x: 361, y: 0.968 }, { x: 313, y: 0.923 }, { x: 279, y: 0.936 }, { x: 264, y: 0.861 },
95
+ { x: 346, y: 0.944 }, { x: 305, y: 0.858 }, { x: 269, y: 0.929 }, { x: 303, y: 0.885 },
96
+ { x: 269, y: 0.848 }, { x: 383, y: 0.919 }, { x: 331, y: 0.901 }, { x: 321, y: 0.934 },
97
+ { x: 276, y: 0.918 }, { x: 331, y: 0.919 }, { x: 369, y: 0.875 }, { x: 337, y: 0.966 },
98
+ { x: 337, y: 0.839 }, { x: 343, y: 0.843 }, { x: 332, y: 0.958 }, { x: 240, y: 0.9 },
99
+ { x: 342, y: 0.956 }, { x: 312, y: 0.884 }, { x: 398, y: 0.967 }, { x: 267, y: 0.882 },
100
+ { x: 312, y: 0.915 }, { x: 335, y: 0.937 }, { x: 291, y: 0.849 }, { x: 368, y: 0.84 },
101
+ { x: 326, y: 0.873 }, { x: 336, y: 0.876 }, { x: 369, y: 0.965 }, { x: 393, y: 0.919 },
102
+ { x: 260, y: 0.958 }, { x: 310, y: 0.834 }, { x: 378, y: 0.864 }, { x: 353, y: 0.851 },
103
+ { x: 266, y: 0.911 }, { x: 400, y: 0.892 }, { x: 336, y: 0.969 }, { x: 279, y: 0.861 },
104
+ { x: 279, y: 0.878 }, { x: 246, y: 0.93 }, { x: 394, y: 0.862 }, { x: 283, y: 0.831 },
105
+ { x: 393, y: 0.922 }, { x: 258, y: 0.878 }, { x: 305, y: 0.877 }, { x: 334, y: 0.913 },
106
+ { x: 264, y: 0.832 }, { x: 350, y: 0.898 }, { x: 258, y: 0.905 }, { x: 252, y: 0.878 },
107
+ { x: 362, y: 0.952 }, { x: 301, y: 0.896 }, { x: 250, y: 0.845 }, { x: 352, y: 0.947 },
108
+ { x: 260, y: 0.913 }, { x: 350, y: 0.917 }, { x: 330, y: 0.969 }, { x: 332, y: 0.895 },
109
+ { x: 336, y: 0.95 }, { x: 250, y: 0.958 }, { x: 385, y: 0.843 }, { x: 324, y: 0.94 },
110
+ { x: 262, y: 0.948 }, { x: 318, y: 0.857 }, { x: 345, y: 0.941 }, { x: 308, y: 0.925 },
111
+ { x: 359, y: 0.899 }, { x: 280, y: 0.851 }, { x: 347, y: 0.849 }, { x: 305, y: 0.966 },
112
+ { x: 257, y: 0.864 }, { x: 396, y: 0.855 }, { x: 306, y: 0.893 }, { x: 268, y: 0.934 },
113
+ { x: 326, y: 0.929 }, { x: 288, y: 0.867 }, { x: 391, y: 0.951 }, { x: 325, y: 0.857 },
114
+ { x: 372, y: 0.901 }, { x: 280, y: 0.85 }, { x: 308, y: 0.86 }, { x: 311, y: 0.956 },
115
+ { x: 283, y: 0.878 }, { x: 336, y: 0.859 }, { x: 320, y: 0.924 }, { x: 266, y: 0.871 },
116
+ { x: 364, y: 0.959 }, { x: 336, y: 0.909 }, { x: 373, y: 0.894 }, { x: 335, y: 0.927 },
117
+ { x: 282, y: 0.862 }, { x: 319, y: 0.923 }, { x: 356, y: 0.839 }, { x: 347, y: 0.907 },
118
+ { x: 376, y: 0.914 }, { x: 246, y: 0.864 }, { x: 383, y: 0.905 }, { x: 310, y: 0.838 },
119
+ { x: 316, y: 0.94 }, { x: 244, y: 0.877 }, { x: 248, y: 0.925 }, { x: 371, y: 0.877 },
120
+ { x: 373, y: 0.89 }, { x: 340, y: 0.831 }, { x: 260, y: 0.831 }, { x: 342, y: 0.898 },
121
+ { x: 284, y: 0.848 }, { x: 364, y: 0.926 }, { x: 301, y: 0.885 }, { x: 389, y: 0.873 },
122
+ { x: 259, y: 0.839 }, { x: 271, y: 0.836 }, { x: 326, y: 0.841 }, { x: 363, y: 0.848 },
123
+ { x: 356, y: 0.868 }, { x: 288, y: 0.964 }, { x: 388, y: 0.876 }, { x: 322, y: 0.937 },
124
+ { x: 319, y: 0.877 }, { x: 259, y: 0.838 }, { x: 350, y: 0.921 }, { x: 349, y: 0.852 },
125
+ { x: 330, y: 0.871 }, { x: 372, y: 0.96 }, { x: 314, y: 0.925 }, { x: 267, y: 0.95 },
126
+ { x: 258, y: 0.897 }, { x: 341, y: 0.934 }, { x: 348, y: 0.957 }, { x: 242, y: 0.857 },
127
+ { x: 358, y: 0.93 }, { x: 394, y: 0.951 }, { x: 371, y: 0.911 }, { x: 320, y: 0.846 },
128
+ { x: 357, y: 0.869 }, { x: 348, y: 0.859 }, { x: 337, y: 0.855 }, { x: 342, y: 0.859 },
129
+ { x: 284, y: 0.853 }, { x: 289, y: 0.967 }, { x: 298, y: 0.958 }, { x: 247, y: 0.938 },
130
+ { x: 330, y: 0.835 }, { x: 250, y: 0.848 }, { x: 356, y: 0.923 }, { x: 304, y: 0.889 }
131
+ ];
132
+
133
+ export const Dense = () => {
134
+ return (
135
+ <VuiScatterChart
136
+ height={440}
137
+ series={[
138
+ { name: "Model A", data: modelA },
139
+ { name: "Model B", data: modelB },
140
+ { name: "Model C", data: modelC }
141
+ ]}
142
+ />
143
+ );
144
+ };
@@ -0,0 +1,22 @@
1
+ import { Basic } from "./Basic";
2
+ import { Dense } from "./Dense";
3
+
4
+ const BasicSource = require("!!raw-loader!./Basic");
5
+ const DenseSource = require("!!raw-loader!./Dense");
6
+
7
+ export const scatterChart = {
8
+ name: "Scatter chart",
9
+ path: "/scatter-chart",
10
+ examples: [
11
+ {
12
+ name: "Basic",
13
+ component: <Basic />,
14
+ source: BasicSource.default.toString()
15
+ },
16
+ {
17
+ name: "Dense",
18
+ component: <Dense />,
19
+ source: DenseSource.default.toString()
20
+ }
21
+ ]
22
+ };
@@ -0,0 +1,7 @@
1
+ import { VuiSparkline } from "../../../lib";
2
+
3
+ const data = [{ v: 4 }, { v: 6 }, { v: 5 }, { v: 8 }, { v: 7 }, { v: 10 }, { v: 9 }, { v: 12 }];
4
+
5
+ export const Basic = () => {
6
+ return <VuiSparkline data={data} dataKey="v" />;
7
+ };
@@ -0,0 +1,21 @@
1
+ import { VuiFlexContainer, VuiFlexItem, VuiSparkline, VuiStat } from "../../../lib";
2
+
3
+ const queries = [{ v: 320 }, { v: 410 }, { v: 380 }, { v: 520 }, { v: 610 }, { v: 700 }, { v: 740 }];
4
+ const latency = [{ v: 180 }, { v: 172 }, { v: 165 }, { v: 158 }, { v: 150 }, { v: 142 }, { v: 138 }];
5
+
6
+ // Sparklines sit inline beside the numbers they summarize.
7
+ export const Inline = () => {
8
+ return (
9
+ <VuiFlexContainer spacing="xl">
10
+ <VuiFlexItem grow={false}>
11
+ <VuiStat title="Queries" text="7,400" />
12
+ <VuiSparkline data={queries} dataKey="v" />
13
+ </VuiFlexItem>
14
+
15
+ <VuiFlexItem grow={false}>
16
+ <VuiStat title="p95 latency" text="138ms" />
17
+ <VuiSparkline data={latency} dataKey="v" variant="bar" color="teal" />
18
+ </VuiFlexItem>
19
+ </VuiFlexContainer>
20
+ );
21
+ };
@@ -0,0 +1,22 @@
1
+ import { Basic } from "./Basic";
2
+ import { Inline } from "./Inline";
3
+
4
+ const BasicSource = require("!!raw-loader!./Basic");
5
+ const InlineSource = require("!!raw-loader!./Inline");
6
+
7
+ export const sparkline = {
8
+ name: "Sparkline",
9
+ path: "/sparkline",
10
+ examples: [
11
+ {
12
+ name: "Basic",
13
+ component: <Basic />,
14
+ source: BasicSource.default.toString()
15
+ },
16
+ {
17
+ name: "Inline with stats",
18
+ component: <Inline />,
19
+ source: InlineSource.default.toString()
20
+ }
21
+ ]
22
+ };
@@ -0,0 +1,14 @@
1
+ import { VuiTreeMap } from "../../../lib";
2
+
3
+ const data = [
4
+ { name: "Documentation", value: 4200 },
5
+ { name: "Blog", value: 2100 },
6
+ { name: "Support tickets", value: 1450 },
7
+ { name: "Forums", value: 980 },
8
+ { name: "Release notes", value: 620 },
9
+ { name: "Changelog", value: 340 }
10
+ ];
11
+
12
+ export const Basic = () => {
13
+ return <VuiTreeMap data={data} categoryKey="name" valueKey="value" />;
14
+ };
@@ -0,0 +1,88 @@
1
+ import { VuiTreeMap } from "../../../lib";
2
+
3
+ // The same base categories and relative sizes as the Basic example. Each category's value is split
4
+ // across eight nested subcategories so the parents sum to the same totals, keeping their ratios identical.
5
+ const data = [
6
+ {
7
+ name: "Documentation",
8
+ children: [
9
+ { name: "Documentation 1", value: 826 },
10
+ { name: "Documentation 2", value: 689 },
11
+ { name: "Documentation 3", value: 620 },
12
+ { name: "Documentation 4", value: 551 },
13
+ { name: "Documentation 5", value: 482 },
14
+ { name: "Documentation 6", value: 413 },
15
+ { name: "Documentation 7", value: 344 },
16
+ { name: "Documentation 8", value: 275 }
17
+ ]
18
+ },
19
+ {
20
+ name: "Blog",
21
+ children: [
22
+ { name: "Blog 1", value: 413 },
23
+ { name: "Blog 2", value: 344 },
24
+ { name: "Blog 3", value: 310 },
25
+ { name: "Blog 4", value: 275 },
26
+ { name: "Blog 5", value: 241 },
27
+ { name: "Blog 6", value: 207 },
28
+ { name: "Blog 7", value: 172 },
29
+ { name: "Blog 8", value: 138 }
30
+ ]
31
+ },
32
+ {
33
+ name: "Support tickets",
34
+ children: [
35
+ { name: "Support tickets 1", value: 285 },
36
+ { name: "Support tickets 2", value: 238 },
37
+ { name: "Support tickets 3", value: 214 },
38
+ { name: "Support tickets 4", value: 190 },
39
+ { name: "Support tickets 5", value: 166 },
40
+ { name: "Support tickets 6", value: 143 },
41
+ { name: "Support tickets 7", value: 119 },
42
+ { name: "Support tickets 8", value: 95 }
43
+ ]
44
+ },
45
+ {
46
+ name: "Forums",
47
+ children: [
48
+ { name: "Forums 1", value: 193 },
49
+ { name: "Forums 2", value: 161 },
50
+ { name: "Forums 3", value: 145 },
51
+ { name: "Forums 4", value: 129 },
52
+ { name: "Forums 5", value: 112 },
53
+ { name: "Forums 6", value: 96 },
54
+ { name: "Forums 7", value: 80 },
55
+ { name: "Forums 8", value: 64 }
56
+ ]
57
+ },
58
+ {
59
+ name: "Release notes",
60
+ children: [
61
+ { name: "Release notes 1", value: 122 },
62
+ { name: "Release notes 2", value: 102 },
63
+ { name: "Release notes 3", value: 91 },
64
+ { name: "Release notes 4", value: 81 },
65
+ { name: "Release notes 5", value: 71 },
66
+ { name: "Release notes 6", value: 61 },
67
+ { name: "Release notes 7", value: 51 },
68
+ { name: "Release notes 8", value: 41 }
69
+ ]
70
+ },
71
+ {
72
+ name: "Changelog",
73
+ children: [
74
+ { name: "Changelog 1", value: 67 },
75
+ { name: "Changelog 2", value: 56 },
76
+ { name: "Changelog 3", value: 50 },
77
+ { name: "Changelog 4", value: 45 },
78
+ { name: "Changelog 5", value: 39 },
79
+ { name: "Changelog 6", value: 33 },
80
+ { name: "Changelog 7", value: 28 },
81
+ { name: "Changelog 8", value: 22 }
82
+ ]
83
+ }
84
+ ];
85
+
86
+ export const Nested = () => {
87
+ return <VuiTreeMap data={data} categoryKey="name" valueKey="value" childrenKey="children" height={440} />;
88
+ };
@@ -0,0 +1,22 @@
1
+ import { Basic } from "./Basic";
2
+ import { Nested } from "./Nested";
3
+
4
+ const BasicSource = require("!!raw-loader!./Basic");
5
+ const NestedSource = require("!!raw-loader!./Nested");
6
+
7
+ export const treeMap = {
8
+ name: "Tree map",
9
+ path: "/tree-map",
10
+ examples: [
11
+ {
12
+ name: "Basic",
13
+ component: <Basic />,
14
+ source: BasicSource.default.toString()
15
+ },
16
+ {
17
+ name: "Nested",
18
+ component: <Nested />,
19
+ source: NestedSource.default.toString()
20
+ }
21
+ ]
22
+ };
@@ -3,6 +3,7 @@ import { accordion } from "./pages/accordion";
3
3
  import { accountButton } from "./pages/accountButton";
4
4
  import { app } from "./pages/app";
5
5
  import { badge } from "./pages/badge";
6
+ import { barChart } from "./pages/barChart";
6
7
  import { button } from "./pages/button";
7
8
  import { callout } from "./pages/callout";
8
9
  import { card } from "./pages/card";
@@ -11,6 +12,7 @@ import { checkbox } from "./pages/checkbox";
11
12
  import { chip } from "./pages/chip";
12
13
  import { code } from "./pages/code";
13
14
  import { codeEditor } from "./pages/codeEditor";
15
+ import { composedChart } from "./pages/composedChart";
14
16
  import { colorPalette } from "./pages/colorPalette";
15
17
  import { complexConfigurationButton } from "./pages/complexConfigurationButton";
16
18
  import { composer } from "./pages/composer";
@@ -34,6 +36,7 @@ import { inProgress } from "./pages/inProgress";
34
36
  import { input } from "./pages/input";
35
37
  import { itemsInput } from "./pages/itemsInput";
36
38
  import { label } from "./pages/label";
39
+ import { lineChart } from "./pages/lineChart";
37
40
  import { link } from "./pages/link";
38
41
  import { list } from "./pages/list";
39
42
  import { menu } from "./pages/menu";
@@ -44,17 +47,20 @@ import { optionsList } from "./pages/optionsList";
44
47
  import { pagination } from "./pages/pagination";
45
48
  import { panel } from "./pages/panel";
46
49
  import { patch } from "./pages/patch";
50
+ import { pieChart } from "./pages/pieChart";
47
51
  import { popover } from "./pages/popover";
48
52
  import { progressBar } from "./pages/progressBar";
49
53
  import { prompt } from "./pages/prompt";
50
54
  import { radioButton } from "./pages/radioButton";
51
55
  import { searchInput } from "./pages/searchInput";
52
56
  import { searchResult } from "./pages/searchResult";
57
+ import { scatterChart } from "./pages/scatterChart";
53
58
  import { searchSelect } from "./pages/searchSelect";
54
59
  import { select } from "./pages/select";
55
60
  import { setting } from "./pages/setting";
56
61
  import { menuList } from "./pages/menuList";
57
62
  import { spacer } from "./pages/spacer";
63
+ import { sparkline } from "./pages/sparkline";
58
64
  import { spinner } from "./pages/spinner";
59
65
  import { stat } from "./pages/stat";
60
66
  import { status } from "./pages/status";
@@ -73,6 +79,7 @@ import { textArea } from "./pages/textArea";
73
79
  import { theme } from "./pages/theme";
74
80
  import { portalContainer } from "./pages/portalContainer";
75
81
  import { timeline } from "./pages/timeline";
82
+ import { treeMap } from "./pages/treeMap";
76
83
  import { toggle } from "./pages/toggle";
77
84
  import { tooltip } from "./pages/tooltip";
78
85
  import { topicButton } from "./pages/topicButton";
@@ -162,6 +169,10 @@ export const categories: Category[] = [
162
169
  searchSelect
163
170
  ]
164
171
  },
172
+ {
173
+ name: "Data visualization",
174
+ pages: [barChart, lineChart, pieChart, scatterChart, composedChart, treeMap, sparkline]
175
+ },
165
176
  {
166
177
  name: "Utils",
167
178
  pages: [errorBoundary, truncate]