Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Commit c190106

Browse files
author
Juan Pablo Sarmiento
authored
Added visualization explorer tab to dataset page (#362)
* Added ability to load data * Added table visualization * Added tailwind and more base UI components * Updated UI components * Updated scout font size and added several fixes * Fixed more styles * Expanded visualization dropdown * Updated select background color * Added viz picker * Added histogram * Added histogram visualization
1 parent deacaaa commit c190106

File tree

37 files changed

+2514
-138
lines changed

37 files changed

+2514
-138
lines changed

.eslintrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@
5252
"components": ["Link"],
5353
"specialLink": ["to"]
5454
}
55+
],
56+
"jsx-a11y/label-has-associated-control": [
57+
"error",
58+
{
59+
"labelComponents": ["LabelWrapper"],
60+
"labelAttributes": ["label"],
61+
"controlComponents": [
62+
"InputText",
63+
"InputNumber",
64+
"Select",
65+
"MixedCheckbox",
66+
"MultiSelect",
67+
"TextArea"
68+
]
69+
}
5570
]
5671
},
5772
"settings": {

packages/frontend/package.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@
77
"@azure/msal-browser": "^2.22.0",
88
"@azure/msal-react": "^1.3.0",
99
"@elastic/elasticsearch": "^7.9.1",
10-
"@fortawesome/fontawesome-svg-core": "^1.2.26",
11-
"@fortawesome/free-brands-svg-icons": "^5.12.1",
12-
"@fortawesome/free-regular-svg-icons": "^5.12.0",
13-
"@fortawesome/free-solid-svg-icons": "^5.12.0",
14-
"@fortawesome/react-fontawesome": "^0.1.8",
10+
"@fortawesome/fontawesome-svg-core": "^6.3.0",
11+
"@fortawesome/free-brands-svg-icons": "^6.3.0",
12+
"@fortawesome/free-regular-svg-icons": "^6.3.0",
13+
"@fortawesome/free-solid-svg-icons": "^6.3.0",
14+
"@fortawesome/react-fontawesome": "^0.2.0",
1515
"@nestjs/elasticsearch": "^7.1.0",
16+
"@nivo/bar": "^0.80.0",
17+
"@nivo/core": "^0.80.0",
18+
"@radix-ui/react-select": "^1.2.1",
19+
"@radix-ui/react-slider": "^1.1.1",
20+
"@radix-ui/react-tooltip": "^1.0.5",
1621
"@reach/dialog": "^0.16.2",
1722
"@reach/menu-button": "^0.16.2",
1823
"@reach/visually-hidden": "^0.16.0",
1924
"@testing-library/jest-dom": "^4.2.4",
2025
"@testing-library/react": "^9.3.2",
2126
"@testing-library/user-event": "^7.1.2",
27+
"@types/invariant": "^2.2.35",
2228
"@types/pluralize": "^0.0.29",
2329
"@types/react": "^17.0.38",
2430
"@types/react-dom": "^17.0.11",
2531
"@types/styled-components": "^5.1.25",
2632
"@types/uuid": "^8.3.4",
33+
"ag-grid-community": "^29.1.0",
34+
"ag-grid-react": "^29.1.0",
2735
"antd": "^4.8.2",
2836
"bootstrap": "^4.4.1",
2937
"classnames": "^2.3.1",
@@ -39,6 +47,7 @@
3947
"node-sass": "^6.0.0",
4048
"normalize.css": "^8.0.1",
4149
"numeral": "^2.0.6",
50+
"papaparse": "^5.4.0",
4251
"pluralize": "^8.0.0",
4352
"react": "^17.0.2",
4453
"react-bootstrap": "^1.0.0-beta.16",
@@ -51,12 +60,16 @@
5160
"react-share": "^4.4.0",
5261
"react-toastify": "^8.2.0",
5362
"react-use-fuse": "^0.5.2",
63+
"remeda": "^1.9.0",
5464
"styled-components": "^5.3.5",
65+
"tailwindcss": "^3.2.7",
5566
"uuid": "^8.3.2"
5667
},
5768
"devDependencies": {
58-
"@types/numeral": "^2.0.2",
5969
"@types/jwt-decode": "^3.1.0",
70+
"@types/numeral": "^2.0.2",
71+
"@types/papaparse": "^5.3.7",
72+
"eslint-plugin-tailwindcss": "^3.10.1",
6073
"gh-pages": "^2.2.0",
6174
"husky": "1.2.0",
6275
"lint-staged": "^9.2.1",

packages/frontend/src/App.scss

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
15
// Color Variables
26
$PaleGrey: #f1f1f2;
37
$LightGrey: #b2b2b2;
@@ -18,7 +22,7 @@ body {
1822
margin: 0px;
1923
padding: 0px;
2024
font-family: 'Lato', sans-serif;
21-
font-size: 11px;
25+
font-size: 16px;
2226
}
2327
ul {
2428
list-style: None;
@@ -28,18 +32,18 @@ ul {
2832

2933
h1 {
3034
width: 100%;
31-
font-size: 18px;
35+
font-size: 1.125rem;
3236
font-weight: normal;
33-
line-height: 22px;
37+
line-height: 1.75rem;
3438
margin: 0;
3539
padding: 2px 0;
3640
}
3741

3842
h2 {
3943
width: 100%;
40-
font-size: 18px;
44+
font-size: 1.125rem;
4145
font-weight: 700;
42-
line-height: 17px;
46+
line-height: 1.75rem;
4347
text-align: left;
4448
}
4549

@@ -49,15 +53,15 @@ a.title {
4953
}
5054

5155
h3 {
52-
font-size: 11px;
56+
font-size: 0.875rem;
5357
font-weight: bold;
54-
line-height: 13px;
58+
line-height: 1.25rem;
5559
}
5660

5761
p {
5862
font-weight: normal;
59-
font-size: 11px;
60-
line-height: 13px;
63+
font-size: 0.875rem;
64+
line-height: 1.25rem;
6165
}
6266

6367
#root {
@@ -115,17 +119,17 @@ p {
115119
font-weight: bold;
116120
}
117121

118-
button {
119-
font-weight: bold;
120-
color: white;
122+
button.primary-button {
121123
border: none;
122124
background: none;
123125
background-color: #1c4d5e;
124-
// background-color: #e7f2ff;
125-
height: 24px;
126-
width: 131px;
126+
font-weight: bold;
127+
color: white;
127128
outline: none;
129+
padding: 0.25rem 0.75rem;
130+
min-width: 135px;
128131
}
132+
129133
button::-moz-focus-inner {
130134
border: 0;
131135
}
@@ -149,19 +153,6 @@ button.header-button {
149153
}
150154
}
151155

152-
button.header-button {
153-
color: white;
154-
width: 100%;
155-
background-color: transparent;
156-
color: white;
157-
border: none;
158-
display: flex;
159-
justify-content: space-between;
160-
&:active {
161-
outline: none;
162-
}
163-
}
164-
165156
.bold {
166157
font-weight: 700;
167158
}

packages/frontend/src/components/AddToCollectionButton/index.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ import { usePreventCollectionTabBlur } from '../CollectionTab/CollectionTab';
1717
import { useUserCollections } from '../../hooks/collections';
1818

1919
const MenuItemHeader = styled.h6`
20-
font-size: 13px;
20+
font-size: 0.9rem;
2121
font-weight: 700;
22+
line-height: 1.25rem;
2223
padding-left: 10px;
2324
padding-right: 24px;
2425
`;
2526

2627
const StyledMenuList = styled(MenuList)`
2728
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
28-
font-size: 12px;
29+
font-size: 0.875rem;
30+
line-height: 1.25rem;
2931
margin-top: 4px;
3032
`;
3133

@@ -123,9 +125,11 @@ export default function AddToCollectionButton({
123125
if (itemsWithDataset.length > 0) {
124126
return (
125127
<>
126-
<MenuItemHeader>Collections that have this dataset</MenuItemHeader>
128+
<MenuItemHeader className="mb-1">
129+
Collections that have this dataset
130+
</MenuItemHeader>
127131
{itemsWithDataset}
128-
<MenuItemHeader style={{ marginTop: 8 }}>
132+
<MenuItemHeader className="mb-1 mt-2">
129133
Other collections
130134
</MenuItemHeader>
131135
{itemsWithoutDataset.length === 0 ? (
@@ -148,7 +152,7 @@ export default function AddToCollectionButton({
148152
return (
149153
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
150154
<Menu>
151-
<MenuButton>
155+
<MenuButton className="primary-button text-sm w-40">
152156
<div onClick={preventCollectionTabBlur}>
153157
{menuButtonText}
154158
<FontAwesomeIcon
@@ -169,14 +173,9 @@ export default function AddToCollectionButton({
169173
onNameChange={setName}
170174
onDescriptionChange={setDescription}
171175
/>
172-
<div
173-
css={`
174-
display: flex;
175-
flex: 1;
176-
justify-content: center;
177-
`}
178-
>
176+
<div className="flex flex-1 justify-center mt-2">
179177
<button
178+
className="primary-button"
180179
type="button"
181180
style={{ marginRight: 8 }}
182181
disabled={isCreating}
@@ -192,7 +191,11 @@ export default function AddToCollectionButton({
192191
>
193192
Create and add dataset
194193
</button>
195-
<button type="button" onClick={onDismissModal}>
194+
<button
195+
className="primary-button !text-slate-700 !bg-gray-200"
196+
type="button"
197+
onClick={onDismissModal}
198+
>
196199
Cancel
197200
</button>
198201
</div>

packages/frontend/src/components/CollectionTab/CollectionCreateForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ export default function CollectionCreateForm({
2626
return (
2727
<>
2828
<h2>Create Collection</h2>
29-
<div className="collections-tab-create-options">
29+
<div className="collections-tab-create-options space-y-2">
3030
<p>Name your new collection</p>
3131
<input
3232
placeholder="Name"
33+
className="border !border-gray-400"
3334
type="text"
3435
value={name}
3536
onChange={onNameChangeFn}
3637
/>
3738
<p>Describe your collection</p>
3839
<input
40+
className="border !border-gray-400"
3941
placeholder="Description"
4042
type="text"
4143
value={description}

packages/frontend/src/components/CollectionTab/CollectionTab.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
height: 44px;
109109
.collection-name {
110110
color: #152935;
111-
font-size: 14px;
112111
font-weight: normal;
113112
padding-bottom: 0px;
114113
margin-bottom: 4px;
@@ -131,9 +130,6 @@
131130
padding: 0px;
132131
color: black;
133132
display: flex;
134-
p {
135-
font-size: 12px;
136-
}
137133
ul {
138134
overflow-y: auto;
139135
flex: 1;

packages/frontend/src/components/CollectionTab/CollectionTabCreate.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function CollectionTabCreate({ onDone }) {
1818
/>
1919
<div className="collection-tab-buttons">
2020
<button
21+
className="primary-button"
2122
type="submit"
2223
onClick={async () => {
2324
await onTryCreateCollection(name, description);
@@ -27,7 +28,11 @@ export function CollectionTabCreate({ onDone }) {
2728
>
2829
Create
2930
</button>
30-
<button type="button" onClick={() => onDone()}>
31+
<button
32+
className="primary-button"
33+
type="button"
34+
onClick={() => onDone()}
35+
>
3136
Cancel
3237
</button>
3338
</div>

packages/frontend/src/components/CollectionTab/CollectionTabList/DatasetList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default function DatasetList({ collection }: Props): JSX.Element {
6565
</div>
6666
<button
6767
type="button"
68+
className="px-2 hover:bg-slate-200 transition-colors"
6869
onClick={async () => {
6970
removeFromCollection(dataset.id, collection.id);
7071
}}

packages/frontend/src/components/CollectionTab/CollectionTabList/EmptyPanelContent.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,12 @@ const StyledDiv = styled.div`
77
padding: 10px 12px;
88
text-align: center;
99
width: 100%;
10-
p {
11-
width: 100%;
12-
font-size: 1.2rem;
13-
line-height: 1.4rem;
14-
}
1510
`;
1611

1712
type Props = {
1813
children: ReactNode;
1914
};
2015

2116
export default function EmptyPanelContent({ children }: Props): JSX.Element {
22-
return (
23-
<StyledDiv>
24-
<p>{children}</p>
25-
</StyledDiv>
26-
);
17+
return <StyledDiv>{children}</StyledDiv>;
2718
}

0 commit comments

Comments
 (0)