Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DLS v8]: Addition of New Data-Viz Components (promoted from the Encoura Ecosystem Lib) #374

Merged
merged 45 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
167ec9c
BREAKING CHANGE: Rename MY_ENCOURA theme to ENCOURA
joncursi Mar 7, 2024
8374971
feat: Add support for ENCOURA theme in ThemeProvider
joncursi Mar 7, 2024
8a0ac9a
test: Add snapshot tests for all components with the ENCOURA theme
joncursi Mar 7, 2024
1e8869a
feat: Added AreaChart component and recharts dependency
joncursi Mar 7, 2024
6938309
chore: Bump DLS node version to v20
joncursi Mar 7, 2024
c2bfd09
docs: Add pragmas
joncursi Mar 7, 2024
358bbfb
feat: Bump deps and devDeps to their latest compatible releases
joncursi Mar 7, 2024
b509a68
test: Fix typescript test issues
joncursi Mar 7, 2024
36e8c11
test: Update snapshot tests
joncursi Mar 7, 2024
00ede48
test: Fix remaining snapshot tests
joncursi Mar 7, 2024
88927c3
fix: Fix loading of museo-sans font in storybook
joncursi Mar 7, 2024
fba16c0
build: Bump storybook memory limit to 8gb
joncursi Mar 7, 2024
dbbac5e
docs: Added stories for AreaChart component
joncursi Mar 7, 2024
c36f211
test: Add tests for AreaChart component
joncursi Mar 7, 2024
329899e
feat: Added BarChart component
joncursi Mar 7, 2024
ad54b0f
test: Added tests for BarChart component
joncursi Mar 7, 2024
96f725d
docs: Added stories for BarChart component
joncursi Mar 7, 2024
3d43719
test: Fix eslint tests
joncursi Mar 7, 2024
d3fdf6d
feat: Added LineChart component
joncursi Mar 7, 2024
8ab6ca3
feat: Added PieChart component
joncursi Mar 7, 2024
36301d3
docs: Add stories for PieChart component
joncursi Mar 7, 2024
92d1ac1
feat: Added OverlappedBarChart component
joncursi Mar 7, 2024
113d8d0
test: Added tests
joncursi Mar 7, 2024
729ef25
docs: Added stories
joncursi Mar 7, 2024
4d5b596
feat: Added ScatterPlot component
joncursi Mar 7, 2024
3768389
test: Added tests
joncursi Mar 7, 2024
c2e2de0
docs: Added stories
joncursi Mar 7, 2024
0a11422
feat: Added StackedBarChart component
joncursi Mar 7, 2024
d1cd630
test: Added tests
joncursi Mar 7, 2024
88e0e48
docs: Added stories
joncursi Mar 7, 2024
7be6371
feat: Added Map component
joncursi Mar 7, 2024
8f32805
docs: Added stories
joncursi Mar 7, 2024
d01c0c7
feat: Add support for storybook env vars, mapbox token
joncursi Mar 7, 2024
36f0d71
fix: Load mapbox css
joncursi Mar 7, 2024
808153d
feat: Added CountyMap, MapPopup components
joncursi Mar 7, 2024
4752f56
docs: Added stories
joncursi Mar 7, 2024
9f0ea57
docs: Added geojson files
joncursi Mar 7, 2024
cca26b1
docs: Fix default story
joncursi Mar 7, 2024
643781c
feat: Added GeomarketMap component
joncursi Mar 7, 2024
7ece5f3
docs: Added stories
joncursi Mar 7, 2024
b90c608
docs: Fix default data in stories
joncursi Mar 7, 2024
28fe7ed
feat: Added HeatMap component
joncursi Mar 7, 2024
d5f4686
feat: Added SCFMap component
joncursi Mar 7, 2024
5b71f01
feat: Added StateMap component
joncursi Mar 7, 2024
572fddb
docs: Fix comment typo
joncursi Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STORYBOOK_MAPBOX_ACCESS_TOKEN="<INSERT_MAPBOX_TOKEN_HERE>"
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
},
],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'import/order': [
'error',
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Test
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Test
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
storybook-static
dist
node_modules
.DS_Store
.env
coverage
dist
node_modules
storybook-static
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
v20
21 changes: 5 additions & 16 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,17 @@ const config: StorybookConfig = {
},
core: {},
features: {
previewMdx2: true,
storyStoreV7: true,
babelModeV7: true,
emotionAlias: false,
previewCsfV3: true,
modernInlineRender: true,
},
// babel: async options => {
// options.plugins.push([
// 'babel-plugin-root-import',
// {
// rootPathPrefix: '@actinc/dls',
// rootPathSuffix: './src',
// },
// ]);
// return options;
// },
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)', '../src/**/*.mdx'],
staticDirs: ['../public'],
typescript: {
check: true,
checkOptions: {},
checkOptions: {
typescript: {
memoryLimit: 8192,
},
},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions .storybook/preview-body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<style>
#root {
display: flex;
justify-content: center;
width: 100%;
}
</style>
27 changes: 6 additions & 21 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700&display=swap" rel="stylesheet">

<style type="text/css">
@font-face {
font-family: 'Museo';
src: url('fonts/Museo/Museo300.otf');
font-style: normal;
font-weight: 300;
}
@font-face {
font-family: 'Museo';
src: url('fonts/Museo/Museo500.otf');
font-style: normal;
font-weight: 500;
}
@font-face {
font-family: 'Museo';
src: url('fonts/Museo/Museo700.otf');
font-style: normal;
font-weight: 700;
}
</style>

<link
href="https://fonts.googleapis.com/css2?display=swap&family=Work+Sans:[email protected]"
rel="stylesheet"
Expand All @@ -33,3 +12,9 @@
href="https://fonts.googleapis.com/css2?display=swap&family=Roboto+Mono:[email protected]"
rel="stylesheet"
/>

<style>
@import url("https://use.typekit.net/zno7zee.css");
</style>

<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.css' rel='stylesheet' />
18 changes: 10 additions & 8 deletions .storybook/preview.js → .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ configureActions({
});

export const parameters = {
controls: { expanded: false },
docs: {
container: DocsContainer,
page: DocsPage,
inlineStories: true,
},
backgrounds: {
default: 'White',
values: [
Expand All @@ -44,7 +38,15 @@ export const parameters = {
},
],
},
layout: 'centered',
controls: { expanded: false },
docs: {
container: DocsContainer,
page: DocsPage,
story: {
inline: true,
},
},
layout: 'padded',
options: {
storySort: {
order: [
Expand Down Expand Up @@ -81,7 +83,7 @@ export const globalTypes = {
name: 'Theme',
toolbar: {
icon: 'paintbrush',
items: ['ACT', 'ACT_ET', 'ENCOURA_CLASSIC', 'ENCOURAGE'],
items: ['ACT', 'ACT_ET', 'ENCOURA', 'ENCOURA_CLASSIC', 'ENCOURAGE'],
},
},
language: {
Expand Down
18 changes: 9 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
"typescript.tsdk": "node_modules/typescript/lib",
"[javascript]": {
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true,
"source.organizeImports": false
"source.fixAll": "never",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true,
"source.organizeImports": false
"source.fixAll": "never",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true,
"source.organizeImports": false
"source.fixAll": "never",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Material UI, and ships with several themes out of the box:

1. `"ACT"`: for ACT's "traditional" look and feel
2. `"ACT_ET"`: for ACT's "Emerging Technology" look and feel
3. `"ENCOURA_CLASSIC"`: for Encoura's "Classic" look and feel
4. `"ENCOURAGE"`: for the Encoura's "Encourage" look and feel
5. `"MY_ENCOURA"`: for the Encoura's "MyEncoura" look and feel
3. `"ENCOURA"`: for the Encoura's "MyEncoura" look and feel
4. `"ENCOURA_CLASSIC"`: for Encoura's "Classic" look and feel
5. `"ENCOURAGE"`: for the Encoura's "Encourage" look and feel

To apply one of these themes to your components, simply wrap your application
in the `ThemeProvider` component and specify a theme!
Expand Down Expand Up @@ -140,7 +140,7 @@ reference in the `head` of your React app:

#### Museo Sans

The `ENCOURA_CLASSIC` and `MY_ENCOURA` theme assumes that the
The `ENCOURA` and `ENCOURA_CLASSIC` themes assume that the
[Museo Sans](https://fonts.adobe.com/fonts/museo-sans) font
is available in the browser. Include this embed code in the `head`
of your React app after obtaining the licensed font URL from Marketing:
Expand All @@ -149,7 +149,6 @@ of your React app after obtaining the licensed font URL from Marketing:
<style>
@import url("licensed-font-url");
</style>

```

#### Work Sans, Roboto, Roboto Mono
Expand Down
13 changes: 12 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,20 @@ collectCoverage: true,
'internal.tsx',
],
coverageReporters: ['text', 'html'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths , { prefix: '<rootDir>/' }),
moduleNameMapper: {
...(pathsToModuleNameMapper(compilerOptions.paths , { prefix: '<rootDir>/' })),
'd3-array': '<rootDir>/node_modules/d3-array/dist/d3-array.min.js',
'd3-color': '<rootDir>/node_modules/d3-color/dist/d3-color.min.js',
'd3-format': '<rootDir>/node_modules/d3-format/dist/d3-format.min.js',
'd3-interpolate': '<rootDir>/node_modules/d3-interpolate/dist/d3-interpolate.min.js',
'd3-path': '<rootDir>/node_modules/d3-path/dist/d3-path.min.js',
'd3-scale': '<rootDir>/node_modules/d3-scale/dist/d3-scale.min.js',
'd3-shape': '<rootDir>/node_modules/d3-shape/dist/d3-shape.min.js',
'd3-time': '<rootDir>/node_modules/d3-time/dist/d3-time.min.js',
},
preset: 'ts-jest',
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['./jest.setup.ts'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.tsx?$': [
Expand Down
7 changes: 0 additions & 7 deletions jest.setup.js

This file was deleted.

22 changes: 22 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) ACT, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @prettier
*/

/* eslint-disable import/no-extraneous-dependencies */

import { configure } from '@testing-library/dom';
import '@testing-library/jest-dom';
import fetch from 'isomorphic-fetch';
import { TextDecoder } from 'text-encoding';

global.fetch = fetch;
global.TextDecoder = TextDecoder;

configure({
computedStyleSupportsPseudoElements: true,
});
Loading
Loading