Skip to content

Commit

Permalink
Merge pull request #611 from CDCgov/integration
Browse files Browse the repository at this point in the history
4.23.2 Release
  • Loading branch information
adamdoe authored Mar 2, 2023
2 parents 2d9fa40 + 81590e7 commit 29631c4
Show file tree
Hide file tree
Showing 188 changed files with 9,642 additions and 10,543 deletions.
10 changes: 1 addition & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@ module.exports = {
browser: true,
},
extends: ['react-app', 'plugin:jsx-a11y/recommended', 'prettier'],
parserOptions: {
es2021: true,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
'import/no-named-as-default': 0,
'no-labels': 0,
'no-unused-labels': 0,
"import/no-anonymous-default-export": 0
},
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ composer.lock
*.swo

# Project Specific
/.storybook_build
/packages/**/examples/private
/packages/**/example/private
/packages/**/example/dev
Expand Down
46 changes: 33 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Contributing to COVE

Table of Contents

- [Contributing to COVE](#contributing-to-cove)
- [Introduction](#introduction)
- [How Can I Contribute?](#how-can-i-contribute)
Expand All @@ -12,29 +13,34 @@ Table of Contents
- [Thank You!](#thank-you)

## Introduction

Welcome! We’re excited that you’re interested in using the CDC Open Visualization Environment (COVE), and are looking forward to working with you on this project. As you work through the project's initial setup, you’re in the best position to report any issues you might run into (ie. compilation errors or gaps in our documentation).
If something doesn't make sense, please [open an issue](https://github.com/CDCgov/cdc-open-viz/issues) and let us know!

## How Can I Contribute?

We welcome many different types of contributions including:

* Code
* Design/Usability
* Copy/Documentation
* Accesibility
* Security & Performance
- Code
- Design/Usability
- Copy/Documentation
- Accesibility
- Security & Performance

Please see the additional sections below before initiating a pull request. All ideas and questions should be routed through a Github Issue.

## How to Request New Features and Report Bugs

Please start all feature requests, bug reports, and ideas by [opening an issue](https://github.com/CDCgov/cdc-open-viz/issues) so that our internal project maintainers are aware of the ideas you want to contribute. We'll do our best to accommodate your request, however, our internal team makes final decisions on how the project is structured. Pitching your ideas early will help avoid unnecessary work and increase your chances of a successful pull request.

*Issues labeled "Help Wanted" are a great place to start for a first contribution.*
_Issues labeled "Help Wanted" are a great place to start for a first contribution._

## Asking for Help

The best way to get questions answered is by [opening an issue](https://github.com/CDCgov/cdc-open-viz/issues). We treat Github Issues the same as our internal communication tools and will respond in a timely manner. In the future, we hope to provide additional communication tools for project support.

## Project Setup Instructions

This repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) that is managed with [Lerna](https://github.com/lerna/lerna#readme) and uses [yarn](https://yarnpkg.com/) for package management. Make sure you have yarn installed before beginning. To work on individual packages you must setup the entire monorepo.

1. Start by cloning/forking this repo and running `yarn install` at the root.
Expand All @@ -44,29 +50,43 @@ This repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) that i
5. To begin working on an individual package, run `lerna run --scope @cdc/package_name start`, replacing package_name with the package's name (ex: @cdc/map).

### Branching Information

Notice - all pull requests you should branch from and target test.

|Branch Name | Description |
|---|---|
| main | Default branch we create releases on |
| test | Development branch we use to branch from |
| Branch Name | Description |
| ----------- | ---------------------------------------- |
| main | Default branch we create releases on |
| test | Development branch we use to branch from |

After pulling the code to your local, the `main` branch will be checked out by default. Switch to test using `git checkout test` and then create a feature branch to work on using gitflow, or manually using:

`git checkout -b feature/new-feature-branch`
`git checkout -b feature/new-feature-branch`

## Opening a Pull Request

You should open a pull request after a project maintainer has approved your idea in a Github Issue.

Steps for submitting a pull request:

- Fork the repository and clone it locally.
- Fork the repository

- When forking, uncheck _Copy the main branch only_

![Creating a fork](./docs/img/forking_1.png)

- Clone to your local using ssh

- Important - Create a new branch from the test branch
- Reference relevant issues in your pull request
- Include supporting documentation and screenshots
- Fill out the pull request template to the best of your ability. Note - Some items in the template might not apply
- Fill out the pull request template to the best of your ability, and be sure to reset the base branch to _test_

![Reset the branch to test](./docs/img/forking_2.png)

- Note - Some items in the template might not apply
- Tag a project maintainer in the pull request for review
- One of our project maintainers will provide timely feedback

## Thank You!

The COVE team thanks you for considering our project. Once your pull request is accepted and merged through our internal release process, you'll be able to see your updates on the main branch and npm.
Binary file added docs/img/forking_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/forking_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions generateViteConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { defineConfig } from 'vite'

import react from '@vitejs/plugin-react'
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
import svgr from 'vite-plugin-svgr' // Svg Support
import dsv from '@rollup/plugin-dsv' // CSV Support
import dns from 'dns' // nodeJS

// Force load dev server on `localhost` vs 127.0.0.1
dns.setDefaultResultOrder('verbatim')

// DEV NOTE: Modifications made to this file will not be hot-loaded through HMR for component.
// - Active dev servers ('lerna run start') must be restarted in order to view the changed settings.
const generateViteConfig = (componentName, configOptions = {}, reactOptions = {}) => {
let configOptionsDefault = {
server: { port: 8080 },
build: {
commonjsOptions: {
include: [/@cdc\/core/, /node_modules/],
},
sourcemap: false,
lib: {
entry: `src/${componentName}.jsx`,
formats: ['es'],
fileName: (format) => `${componentName.toLowerCase()}.js`,
},
rollupOptions: {
external: [ 'react', 'reactDOM' ],
output: {
chunkFileNames: `${componentName.toLowerCase()}-[hash].[format].js`,
globals: {
react: 'React',
reactDOM: 'ReactDOM'
},
},
},
},
plugins: [
react(reactOptions),
svgr({
exportAsDefault: true
}),
cssInjectedByJsPlugin(),
dsv()
],
...configOptions
}

return defineConfig({
...configOptionsDefault,
...configOptions
})
}

export default generateViteConfig
5 changes: 2 additions & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"packages": [
"packages/*"
],
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"npmClient": "yarn",
"version": "independent"
}
54 changes: 21 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@
"name": "@cdc/root",
"version": "0.0.0",
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/plugin-transform-arrow-functions": "^7.12.13",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@types/react": "17.x",
"@types/react-dom": "17.x",
"@rollup/plugin-dsv": "^3.0.2",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@types/resize-observer-browser": "^0.1.5",
"@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0",
"@visx/group": "^2.1.0",
"@visx/heatmap": "^2.1.0",
"@visx/scale": "^2.1.0",
"@visx/group": "^3.0.0",
"@visx/heatmap": "^3.0.0",
"@visx/scale": "^3.0.0",
"@vitejs/plugin-react": "^3.0.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"core-js": "^3.8.3",
"css-loader": "^4.3.0",
"d3-composite-projections": "^1.4.0",
"eslint": "^7.16.0",
"eslint-config-airbnb-typescript": "12.0.0",
Expand All @@ -31,34 +29,25 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"html-react-parser": "1.4.9",
"html-webpack-plugin": "^5.3.1",
"html-react-parser": "^3.0.8",
"husky": "^4.3.0",
"lerna": "^3.22.1",
"lerna": "^6.5.1",
"lint-staged": "^10.4.0",
"mini-svg-data-uri": "^1.2.3",
"pathe": "^1.1.0",
"prettier": "^2.8.1",
"react": "17.0.1",
"react-beautiful-dnd": "^13.1.0",
"react-dom": "17.0.1",
"react-svg-loader": "^3.0.3",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
"react-dom": "^18.2.0",
"react-visibility-sensor": "^5.1.1",
"resize-observer-polyfill": "^1.5.1",
"sass": "^1.32.8",
"sass-loader": "^11.0.1",
"style-loader": "^1.0.0",
"ts-loader": "^8.0.9",
"typescript": "^4.0.5",
"url-loader": "^4.1.1",
"sass": "^1.57.1",
"use-debounce": "^7.0.1",
"webpack": "5.44.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2",
"vite": "^4.0.0",
"vite-plugin-css-injected-by-js": "^2.4.0",
"vite-plugin-svgr": "^2.4.0",
"whatwg-fetch": "^3.6.2"
},
"resolutions": {
"@types/react": "17.x"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
Expand All @@ -74,8 +63,7 @@
"publish": "npx lerna publish"
},
"dependencies": {
"@cdc/core": "^1.1.2",
"@visx/legend": "^2.10.0",
"@visx/legend": "^3.0.0",
"@visx/responsive": "^2.10.0"
}
}
34 changes: 34 additions & 0 deletions packages/chart/examples/Barchart_with_negative.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Category": "One",
"Values": 888
},
{
"Category": "Two",
"Values": 400
},
{
"Category": "Three",
"Values": -100
},
{
"Category": "Four",
"Values": 500
},
{
"Category": "Five",
"Values": 700
},
{
"Category": "Six",
"Values": -1000
},
{
"Category": "Seven",
"Values": 300
},
{
"Category": "Eight",
"Values": -500
}
]
4 changes: 2 additions & 2 deletions packages/chart/examples/box-plot.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"numTicks": "",
"label": "Observations"
},
"boxplot": [],
"topAxis": {
"hasLine": false
},
Expand Down Expand Up @@ -80,6 +79,7 @@
"colorCode": "",
"reverseLabelOrder": false,
"description": "",
"hide": true,
"dynamicLegend": false,
"dynamicLegendDefaultText": "Show All",
"dynamicLegendItemLimit": 5,
Expand Down Expand Up @@ -111,7 +111,7 @@
"dataDescription": {
"horizontal": false,
"series": false,
"singleRow": false,
"singleRow": true,
"xKey": "Group_Category",
"valueKey": "Value"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/chart/examples/dynamic-legends.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"behavior": "isolate",
"position": "right",
"label": "Type of Data",
"dynamicLegend": true
"dynamicLegend": false
},
"palette": "qualitative-bold",
"labels": false,
Expand Down
36 changes: 36 additions & 0 deletions packages/chart/examples/example-bar-chart-nonnumeric.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"type": "chart",
"title": "Example Bar Chart",
"theme": "theme-blue",
"fontSize": "medium",
"height": 300,
"padding": { "left": 5, "right": 5 },
"yAxis": { "size": "76", "gridLines": false, "label": "Y Axis Example Label" },
"barThickness": "0.6",
"xAxis": { "size": "59", "tickRotation": 0, "dataKey": "Date", "label": "X Axis Example Label" },
"table": { "label": "Data Type by Date", "expanded": true },
"legend": { "behavior": "isolate", "position": "right", "label": "Type of Data" },
"palette": "qualitative-bold",
"labels": false,
"dataFormat": { "suffix": " units" },
"confidenceKeys": {},
"data": [
{ "Date": "1/15/2016", "Data 1": "90", "Data 2": "1323.5", "Data 3": "1000", "Data 4": "95", "Data 5": "120", "Data 6": "310" },
{ "Date": "2/15/2016", "Data 1": "NA", "Data 2": "90.3", "Data 3": "240", "Data 4": "60", "Data 5": "160", "Data 6": "200" },
{ "Date": "3/15/2016", "Data 1": "50", "Data 2": "booo", "Data 3": "290", "Data 4": "100", "Data 5": "200", "Data 6": "250" },
{ "Date": "4/15/2016", "Data 1": "", "Data 2": "160", "Data 3": "230", "Data 4": "180", "Data 5": "160", "Data 6": "220" },
{ "Date": "5/15/2016", "Data 1": "", "Data 2": "350", "Data 3": "300", "Data 4": "150", "Data 5": "130", "Data 6": "100" },
{ "Date": "6/15/2016", "Data 1": "90", "Data 2": "220", "Data 3": "320", "Data 4": "100", "Data 5": "220", "Data 6": "300" }
],
"visualizationType": "Bar",
"series": [
{ "dataKey": "Data 1", "type": "Bar" },
{ "dataKey": "Data 2", "type": "Bar" },
{ "dataKey": "Data 3", "type": "Bar" },
{ "dataKey": "Data 4", "type": "Bar" },
{ "dataKey": "Data 5", "type": "Bar" },
{ "dataKey": "Data 6", "type": "Bar" }
],
"description": "This example shows a bar chart created in the visualization editor in WCMS",
"dataCutoff": "0"
}
Loading

0 comments on commit 29631c4

Please sign in to comment.