@vectara/vectara-ui 18.4.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 (81) hide show
  1. package/lib/components/card/SimpleCard.d.ts +1 -1
  2. package/lib/components/card/_index.scss +5 -30
  3. package/lib/components/chart/BarChart.d.ts +20 -0
  4. package/lib/components/chart/BarChart.js +28 -0
  5. package/lib/components/chart/ComposedChart.d.ts +21 -0
  6. package/lib/components/chart/ComposedChart.js +29 -0
  7. package/lib/components/chart/LineChart.d.ts +22 -0
  8. package/lib/components/chart/LineChart.js +42 -0
  9. package/lib/components/chart/PieChart.d.ts +15 -0
  10. package/lib/components/chart/PieChart.js +36 -0
  11. package/lib/components/chart/ScatterChart.d.ts +18 -0
  12. package/lib/components/chart/ScatterChart.js +34 -0
  13. package/lib/components/chart/Sparkline.d.ts +13 -0
  14. package/lib/components/chart/Sparkline.js +23 -0
  15. package/lib/components/chart/TreeMap.d.ts +13 -0
  16. package/lib/components/chart/TreeMap.js +51 -0
  17. package/lib/components/chart/_index.scss +19 -0
  18. package/lib/components/chart/chartTheme.d.ts +21 -0
  19. package/lib/components/chart/chartTheme.js +13 -0
  20. package/lib/components/chart/palette.d.ts +5 -0
  21. package/lib/components/chart/palette.js +29 -0
  22. package/lib/components/composer/Composer.d.ts +41 -0
  23. package/lib/components/composer/Composer.js +148 -0
  24. package/lib/components/composer/_index.scss +4 -0
  25. package/lib/components/composer/useComposerHistory.d.ts +34 -0
  26. package/lib/components/composer/useComposerHistory.js +127 -0
  27. package/lib/components/context/Theme.d.ts +32 -0
  28. package/lib/components/context/Theme.js +116 -3
  29. package/lib/components/fileDropTarget/FileDropTarget.d.ts +8 -0
  30. package/lib/components/fileDropTarget/FileDropTarget.js +69 -0
  31. package/lib/components/fileDropTarget/_index.scss +34 -0
  32. package/lib/components/index.d.ts +13 -2
  33. package/lib/components/index.js +12 -1
  34. package/lib/components/patch/VuiPatch.d.ts +10 -0
  35. package/lib/components/patch/VuiPatch.js +32 -0
  36. package/lib/components/patch/_index.scss +30 -0
  37. package/lib/styles/index.css +143 -27
  38. package/package.json +4 -3
  39. package/src/docs/Docs.tsx +10 -0
  40. package/src/docs/pages/barChart/Basic.tsx +21 -0
  41. package/src/docs/pages/barChart/Horizontal.tsx +20 -0
  42. package/src/docs/pages/barChart/Stacked.tsx +23 -0
  43. package/src/docs/pages/barChart/index.tsx +29 -0
  44. package/src/docs/pages/card/SimpleCard.tsx +72 -6
  45. package/src/docs/pages/colorPalette/CategoricalColors.tsx +89 -0
  46. package/src/docs/pages/colorPalette/ChartColors.tsx +68 -0
  47. package/src/docs/pages/colorPalette/NeutralColors.tsx +42 -0
  48. package/src/docs/pages/colorPalette/SemanticColors.tsx +64 -0
  49. package/src/docs/pages/colorPalette/Swatch.tsx +59 -0
  50. package/src/docs/pages/colorPalette/TextAndBorderColors.tsx +37 -0
  51. package/src/docs/pages/colorPalette/Usage.tsx +72 -0
  52. package/src/docs/pages/colorPalette/index.tsx +50 -0
  53. package/src/docs/pages/composedChart/Basic.tsx +25 -0
  54. package/src/docs/pages/composedChart/index.tsx +15 -0
  55. package/src/docs/pages/composer/Composer.tsx +130 -0
  56. package/src/docs/pages/composer/index.tsx +11 -0
  57. package/src/docs/pages/fileDropTarget/FileDropTarget.tsx +80 -0
  58. package/src/docs/pages/fileDropTarget/index.tsx +11 -0
  59. package/src/docs/pages/lineChart/Area.tsx +25 -0
  60. package/src/docs/pages/lineChart/Basic.tsx +23 -0
  61. package/src/docs/pages/lineChart/Curved.tsx +25 -0
  62. package/src/docs/pages/lineChart/StackedArea.tsx +27 -0
  63. package/src/docs/pages/lineChart/index.tsx +36 -0
  64. package/src/docs/pages/patch/Icons.tsx +16 -0
  65. package/src/docs/pages/patch/Sizes.tsx +20 -0
  66. package/src/docs/pages/patch/index.tsx +22 -0
  67. package/src/docs/pages/pieChart/Basic.tsx +13 -0
  68. package/src/docs/pages/pieChart/Donut.tsx +12 -0
  69. package/src/docs/pages/pieChart/ManyValues.tsx +51 -0
  70. package/src/docs/pages/pieChart/Unlabeled.tsx +15 -0
  71. package/src/docs/pages/pieChart/index.tsx +36 -0
  72. package/src/docs/pages/scatterChart/Basic.tsx +31 -0
  73. package/src/docs/pages/scatterChart/Dense.tsx +144 -0
  74. package/src/docs/pages/scatterChart/index.tsx +22 -0
  75. package/src/docs/pages/sparkline/Basic.tsx +7 -0
  76. package/src/docs/pages/sparkline/Inline.tsx +21 -0
  77. package/src/docs/pages/sparkline/index.tsx +22 -0
  78. package/src/docs/pages/treeMap/Basic.tsx +14 -0
  79. package/src/docs/pages/treeMap/Nested.tsx +88 -0
  80. package/src/docs/pages/treeMap/index.tsx +22 -0
  81. package/src/docs/pages.tsx +20 -3
@@ -0,0 +1,80 @@
1
+ import { useRef, useState } from "react";
2
+ import { VuiFileDropTarget, VuiSpacer, VuiText, VuiTextColor, VuiToggle } from "../../../lib";
3
+
4
+ export const FileDropTarget = () => {
5
+ const [isScoped, setIsScoped] = useState(false);
6
+ const [droppedFiles, setDroppedFiles] = useState<string[]>([]);
7
+ const scopeRef = useRef<HTMLDivElement>(null);
8
+
9
+ // Only one target is mounted at a time: the global target listens on the whole
10
+ // document, so it would intercept drops meant for a scoped target.
11
+ return (
12
+ <>
13
+ <VuiToggle
14
+ label="Scope drop target to an element"
15
+ checked={isScoped}
16
+ onChange={(e) => {
17
+ setIsScoped(e.target.checked);
18
+ setDroppedFiles([]);
19
+ }}
20
+ />
21
+
22
+ <VuiSpacer size="m" />
23
+
24
+ <VuiText>
25
+ <p>
26
+ <VuiTextColor color="subdued">
27
+ {isScoped
28
+ ? "Drag a file over the box below. The overlay is scoped to the positioned container."
29
+ : "Drag a file anywhere over the page to reveal a full-screen overlay."}
30
+ </VuiTextColor>
31
+ </p>
32
+ </VuiText>
33
+
34
+ {droppedFiles.length > 0 && (
35
+ <>
36
+ <VuiSpacer size="xs" />
37
+ <VuiText size="s">
38
+ <p>Dropped: {droppedFiles.join(", ")}</p>
39
+ </VuiText>
40
+ </>
41
+ )}
42
+
43
+ <VuiSpacer size="s" />
44
+
45
+ {isScoped ? (
46
+ <div
47
+ ref={scopeRef}
48
+ style={{
49
+ position: "relative",
50
+ minHeight: 160,
51
+ display: "flex",
52
+ alignItems: "center",
53
+ justifyContent: "center",
54
+ padding: 16,
55
+ border: "1px dashed var(--vui-color-border)",
56
+ borderRadius: 8
57
+ }}
58
+ >
59
+ <VuiText>
60
+ <p>
61
+ <VuiTextColor color="subdued">Drop zone</VuiTextColor>
62
+ </p>
63
+ </VuiText>
64
+
65
+ <VuiFileDropTarget
66
+ scopeRef={scopeRef}
67
+ message={
68
+ <VuiText align="center" size="l">
69
+ <p>Release to drop here</p>
70
+ </VuiText>
71
+ }
72
+ onFilesDropped={(files) => setDroppedFiles(files.map((file) => file.name))}
73
+ />
74
+ </div>
75
+ ) : (
76
+ <VuiFileDropTarget onFilesDropped={(files) => setDroppedFiles(files.map((file) => file.name))} />
77
+ )}
78
+ </>
79
+ );
80
+ };
@@ -0,0 +1,11 @@
1
+ import { FileDropTarget } from "./FileDropTarget";
2
+ const FileDropTargetSource = require("!!raw-loader!./FileDropTarget");
3
+
4
+ export const fileDropTarget = {
5
+ name: "File drop target",
6
+ path: "/fileDropTarget",
7
+ example: {
8
+ component: <FileDropTarget />,
9
+ source: FileDropTargetSource.default.toString()
10
+ }
11
+ };
@@ -0,0 +1,25 @@
1
+ import { VuiLineChart } from "../../../lib";
2
+
3
+ const data = [
4
+ { month: "Jan", storage: 120, bandwidth: 80 },
5
+ { month: "Feb", storage: 180, bandwidth: 110 },
6
+ { month: "Mar", storage: 240, bandwidth: 140 },
7
+ { month: "Apr", storage: 320, bandwidth: 200 },
8
+ { month: "May", storage: 410, bandwidth: 260 },
9
+ { month: "Jun", storage: 520, bandwidth: 300 }
10
+ ];
11
+
12
+ export const Area = () => {
13
+ return (
14
+ <VuiLineChart
15
+ data={data}
16
+ categoryKey="month"
17
+ variant="area"
18
+ curved
19
+ series={[
20
+ { dataKey: "storage", name: "Storage (GB)" },
21
+ { dataKey: "bandwidth", name: "Bandwidth (GB)" }
22
+ ]}
23
+ />
24
+ );
25
+ };
@@ -0,0 +1,23 @@
1
+ import { VuiLineChart } from "../../../lib";
2
+
3
+ const data = [
4
+ { month: "Jan", queries: 4200, documents: 1800 },
5
+ { month: "Feb", queries: 4800, documents: 2100 },
6
+ { month: "Mar", queries: 4500, documents: 2600 },
7
+ { month: "Apr", queries: 6100, documents: 2900 },
8
+ { month: "May", queries: 6800, documents: 3400 },
9
+ { month: "Jun", queries: 7400, documents: 3600 }
10
+ ];
11
+
12
+ export const Basic = () => {
13
+ return (
14
+ <VuiLineChart
15
+ data={data}
16
+ categoryKey="month"
17
+ series={[
18
+ { dataKey: "queries", name: "Queries" },
19
+ { dataKey: "documents", name: "Documents" }
20
+ ]}
21
+ />
22
+ );
23
+ };
@@ -0,0 +1,25 @@
1
+ import { VuiLineChart } from "../../../lib";
2
+
3
+ const data = [
4
+ { day: "Mon", p50: 120, p95: 320 },
5
+ { day: "Tue", p50: 132, p95: 410 },
6
+ { day: "Wed", p50: 101, p95: 280 },
7
+ { day: "Thu", p50: 148, p95: 460 },
8
+ { day: "Fri", p50: 160, p95: 520 },
9
+ { day: "Sat", p50: 90, p95: 240 },
10
+ { day: "Sun", p50: 85, p95: 210 }
11
+ ];
12
+
13
+ export const Curved = () => {
14
+ return (
15
+ <VuiLineChart
16
+ data={data}
17
+ categoryKey="day"
18
+ curved
19
+ series={[
20
+ { dataKey: "p50", name: "p50 latency (ms)" },
21
+ { dataKey: "p95", name: "p95 latency (ms)" }
22
+ ]}
23
+ />
24
+ );
25
+ };
@@ -0,0 +1,27 @@
1
+ import { VuiLineChart } from "../../../lib";
2
+
3
+ // Search starts well above generation, then the two cross around March as generation overtakes it —
4
+ // in a stacked area, the bottom band thins while the top band thickens.
5
+ const data = [
6
+ { month: "Jan", search: 5200, generation: 1000 },
7
+ { month: "Feb", search: 4300, generation: 1800 },
8
+ { month: "Mar", search: 3400, generation: 2700 },
9
+ { month: "Apr", search: 2600, generation: 3600 },
10
+ { month: "May", search: 1800, generation: 4500 },
11
+ { month: "Jun", search: 1100, generation: 5400 }
12
+ ];
13
+
14
+ export const StackedArea = () => {
15
+ return (
16
+ <VuiLineChart
17
+ data={data}
18
+ categoryKey="month"
19
+ variant="stacked-area"
20
+ curved
21
+ series={[
22
+ { dataKey: "search", name: "Search" },
23
+ { dataKey: "generation", name: "Generation" }
24
+ ]}
25
+ />
26
+ );
27
+ };
@@ -0,0 +1,36 @@
1
+ import { Basic } from "./Basic";
2
+ import { Curved } from "./Curved";
3
+ import { Area } from "./Area";
4
+ import { StackedArea } from "./StackedArea";
5
+
6
+ const BasicSource = require("!!raw-loader!./Basic");
7
+ const CurvedSource = require("!!raw-loader!./Curved");
8
+ const AreaSource = require("!!raw-loader!./Area");
9
+ const StackedAreaSource = require("!!raw-loader!./StackedArea");
10
+
11
+ export const lineChart = {
12
+ name: "Line chart",
13
+ path: "/line-chart",
14
+ examples: [
15
+ {
16
+ name: "Basic",
17
+ component: <Basic />,
18
+ source: BasicSource.default.toString()
19
+ },
20
+ {
21
+ name: "Curved",
22
+ component: <Curved />,
23
+ source: CurvedSource.default.toString()
24
+ },
25
+ {
26
+ name: "Area",
27
+ component: <Area />,
28
+ source: AreaSource.default.toString()
29
+ },
30
+ {
31
+ name: "Stacked area",
32
+ component: <StackedArea />,
33
+ source: StackedAreaSource.default.toString()
34
+ }
35
+ ]
36
+ };
@@ -0,0 +1,16 @@
1
+ import { BiHelpCircle } from "react-icons/bi";
2
+ import { PATCH_COLOR, VuiIcon, VuiPatch, VuiFlexContainer } from "../../../lib";
3
+
4
+ export const Icons = () => {
5
+ return (
6
+ <VuiFlexContainer spacing="m" wrap>
7
+ {PATCH_COLOR.map((color) => (
8
+ <VuiPatch color={color}>
9
+ <VuiIcon size="m">
10
+ <BiHelpCircle />
11
+ </VuiIcon>
12
+ </VuiPatch>
13
+ ))}
14
+ </VuiFlexContainer>
15
+ );
16
+ };
@@ -0,0 +1,20 @@
1
+ import { BiCompass } from "react-icons/bi";
2
+ import { VuiPatch, VuiFlexContainer, VuiIcon } from "../../../lib";
3
+
4
+ const sizes = ["xs", "s", "m"] as const;
5
+
6
+ export const Sizes = () => {
7
+ return (
8
+ <VuiFlexContainer spacing="m" wrap>
9
+ {sizes.map((size) => (
10
+ <div>
11
+ <VuiPatch color="indigo" size={size}>
12
+ <VuiIcon>
13
+ <BiCompass />
14
+ </VuiIcon>
15
+ </VuiPatch>
16
+ </div>
17
+ ))}
18
+ </VuiFlexContainer>
19
+ );
20
+ };
@@ -0,0 +1,22 @@
1
+ import { Icons } from "./Icons";
2
+ import { Sizes } from "./Sizes";
3
+
4
+ const IconsSource = require("!!raw-loader!./Icons");
5
+ const SizesSource = require("!!raw-loader!./Sizes");
6
+
7
+ export const patch = {
8
+ name: "Patch",
9
+ path: "/patch",
10
+ examples: [
11
+ {
12
+ name: "Icons",
13
+ component: <Icons />,
14
+ source: IconsSource.default.toString()
15
+ },
16
+ {
17
+ name: "Sizes",
18
+ component: <Sizes />,
19
+ source: SizesSource.default.toString()
20
+ }
21
+ ]
22
+ };
@@ -0,0 +1,13 @@
1
+ import { VuiPieChart } from "../../../lib";
2
+
3
+ const data = [
4
+ { source: "Documentation", count: 3200 },
5
+ { source: "Blog", count: 2100 },
6
+ { source: "Support tickets", count: 1450 },
7
+ { source: "Forums", count: 980 },
8
+ { source: "Release notes", count: 540 }
9
+ ];
10
+
11
+ export const Basic = () => {
12
+ return <VuiPieChart data={data} categoryKey="source" valueKey="count" />;
13
+ };
@@ -0,0 +1,12 @@
1
+ import { VuiPieChart } from "../../../lib";
2
+
3
+ const data = [
4
+ { plan: "Free", accounts: 5400 },
5
+ { plan: "Pro", accounts: 2300 },
6
+ { plan: "Scale", accounts: 820 },
7
+ { plan: "Enterprise", accounts: 310 }
8
+ ];
9
+
10
+ export const Donut = () => {
11
+ return <VuiPieChart data={data} categoryKey="plan" valueKey="accounts" donut />;
12
+ };
@@ -0,0 +1,51 @@
1
+ import { VuiPieChart, VuiSpacer, VuiText, VuiTextColor } from "../../../lib";
2
+
3
+ // 24 categories exceed what a pie can show well. The palette shifts lightness on each wrap so the
4
+ // repeated hues stay distinct, but the wedges are still too thin to compare. Prefer grouping the long
5
+ // tail into an "Other" slice, or switch to a sorted bar chart.
6
+ const data = [
7
+ { label: "Category 1", value: 100 },
8
+ { label: "Category 2", value: 97 },
9
+ { label: "Category 3", value: 94 },
10
+ { label: "Category 4", value: 91 },
11
+ { label: "Category 5", value: 88 },
12
+ { label: "Category 6", value: 85 },
13
+ { label: "Category 7", value: 82 },
14
+ { label: "Category 8", value: 79 },
15
+ { label: "Category 9", value: 76 },
16
+ { label: "Category 10", value: 73 },
17
+ { label: "Category 11", value: 70 },
18
+ { label: "Category 12", value: 67 },
19
+ { label: "Category 13", value: 64 },
20
+ { label: "Category 14", value: 61 },
21
+ { label: "Category 15", value: 58 },
22
+ { label: "Category 16", value: 55 },
23
+ { label: "Category 17", value: 52 },
24
+ { label: "Category 18", value: 49 },
25
+ { label: "Category 19", value: 46 },
26
+ { label: "Category 20", value: 43 },
27
+ { label: "Category 21", value: 40 },
28
+ { label: "Category 22", value: 37 },
29
+ { label: "Category 23", value: 34 },
30
+ { label: "Category 24", value: 31 }
31
+ ];
32
+
33
+ export const ManyValues = () => {
34
+ return (
35
+ <>
36
+ <VuiText size="xs">
37
+ <p>
38
+ <VuiTextColor color="subdued">
39
+ The colors no longer repeat exactly. Each wraps past the eighth slice shifts lightness, but the wedges are
40
+ still too thin to compare. Avoid pies with this many categories. Group the long tail into an "Other" slice,
41
+ or switch to a sorted bar chart.
42
+ </VuiTextColor>
43
+ </p>
44
+ </VuiText>
45
+
46
+ <VuiSpacer size="s" />
47
+
48
+ <VuiPieChart data={data} categoryKey="label" valueKey="value" showLabels={false} height={420} />
49
+ </>
50
+ );
51
+ };
@@ -0,0 +1,15 @@
1
+ import { VuiPieChart } from "../../../lib";
2
+
3
+ // With many slices, outside labels overlap, so hide them and rely on the legend and tooltip.
4
+ const data = [
5
+ { region: "North America", revenue: 4200 },
6
+ { region: "Europe", revenue: 3100 },
7
+ { region: "Asia Pacific", revenue: 2400 },
8
+ { region: "Latin America", revenue: 1200 },
9
+ { region: "Middle East", revenue: 760 },
10
+ { region: "Africa", revenue: 480 }
11
+ ];
12
+
13
+ export const Unlabeled = () => {
14
+ return <VuiPieChart data={data} categoryKey="region" valueKey="revenue" showLabels={false} />;
15
+ };
@@ -0,0 +1,36 @@
1
+ import { Basic } from "./Basic";
2
+ import { Donut } from "./Donut";
3
+ import { Unlabeled } from "./Unlabeled";
4
+ import { ManyValues } from "./ManyValues";
5
+
6
+ const BasicSource = require("!!raw-loader!./Basic");
7
+ const DonutSource = require("!!raw-loader!./Donut");
8
+ const UnlabeledSource = require("!!raw-loader!./Unlabeled");
9
+ const ManyValuesSource = require("!!raw-loader!./ManyValues");
10
+
11
+ export const pieChart = {
12
+ name: "Pie chart",
13
+ path: "/pie-chart",
14
+ examples: [
15
+ {
16
+ name: "Basic",
17
+ component: <Basic />,
18
+ source: BasicSource.default.toString()
19
+ },
20
+ {
21
+ name: "Donut",
22
+ component: <Donut />,
23
+ source: DonutSource.default.toString()
24
+ },
25
+ {
26
+ name: "Unlabeled",
27
+ component: <Unlabeled />,
28
+ source: UnlabeledSource.default.toString()
29
+ },
30
+ {
31
+ name: "Many values",
32
+ component: <ManyValues />,
33
+ source: ManyValuesSource.default.toString()
34
+ }
35
+ ]
36
+ };
@@ -0,0 +1,31 @@
1
+ import { VuiScatterChart } from "../../../lib";
2
+
3
+ // Each point pairs a model's response latency (x, ms) with its relevance score (y).
4
+ const modelA = [
5
+ { x: 120, y: 0.78 },
6
+ { x: 150, y: 0.81 },
7
+ { x: 180, y: 0.85 },
8
+ { x: 210, y: 0.88 },
9
+ { x: 240, y: 0.9 },
10
+ { x: 300, y: 0.92 }
11
+ ];
12
+
13
+ const modelB = [
14
+ { x: 90, y: 0.72 },
15
+ { x: 130, y: 0.75 },
16
+ { x: 170, y: 0.79 },
17
+ { x: 220, y: 0.83 },
18
+ { x: 260, y: 0.86 },
19
+ { x: 320, y: 0.89 }
20
+ ];
21
+
22
+ export const Basic = () => {
23
+ return (
24
+ <VuiScatterChart
25
+ series={[
26
+ { name: "Model A", data: modelA },
27
+ { name: "Model B", data: modelB }
28
+ ]}
29
+ />
30
+ );
31
+ };
@@ -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
+ };