GithubHelp home page GithubHelp logo

cdcgov / cdc-open-viz Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 16.0 113.68 MB

CDC OpenViz is a library of React packages for data visualization.

License: Apache License 2.0

JavaScript 19.03% SCSS 11.36% HTML 1.34% TypeScript 67.55% Shell 0.04% CSS 0.32% MDX 0.38%
data react visualization visualization-library

cdc-open-viz's Issues

test branch: generateValuesForFilter function refactor introduced breaking change

@mpallansch wrote this comment:
"Additionally, I'm not sure where the "generateValuesForFilter" function in CdcDashboard.tsx was refactored but it does not appear to be working with the current data structure:

{ dataKey1: [{...}, {...}, ...], dataKey2: [{...}, {...}, ...] }

This will apply to data filters (non URL filters). The function on the integration branch is working, you can look at that to see what might be wrong with the refactor.

You can add showDropdown: true to the filter in this example file default-filter-control.json to see where the filter is not being populated."

`npm install` for `"^2.6.1"` fails

Steps:

  1. Create a new, clean directory.
  2. cd into directory
  3. Create a minimal package.json
    (e.g. this can be done with node init or use the package.json below.
  4. Add "dependencies": { "@cdc/map": "2.6.1" } to file
{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@cdc/map": "^2.6.1"
  }
}
  1. Run npm install in this directory.
  2. Observe contents of node_module/@cdc/map directory.
    (e.g. ls -lasR ./node_modules/@cdc/map)

Result:
Directory contains only 3 files: LICENSE, README.md and package.json

Notes:

  • changing to 2.5 works as expected
    (e.g."dependencies": {"@cdc/map": "2.5.0" })
  • My npm --version 6.14.13
  • My node --version v14.17.0

forceConsistentCasingInFileNames in tsconfig.json

It looks like there is an option in typescript for forcing consistent casing in file names. I remember when I initially set this project up with other developers, I had to fix an error because a scss import was written as "datatable" instead of "DataTable" in /chart/src/scss/main.scss using @import "datatable" instead of @import "DataTable" . I'm not sure, but I think adding this key into the tsconfig file could help us avoid case sensitivity file errors. Any thoughts?

"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */

CdcDashboard has sideEffects affecting the reducer state

Steps to Reproduce:

  1. In the CdcDashboard component. replace the useReducer function with the following lines:
    const [_state, dispatch] = useReducer(dashboardReducer, initialState)
    const state = _.cloneDeep(_state)
  2. set dashboard example to DEV-6574.json
  3. run lerna run start --scope @cdc/dashboard

Expected: the bar chart should be loaded with data with the selected values of Colorado and Adams.
Actual: Colorado and Adams are selected however there is no data in the chart.

Advanced Editor

We currently support the advanced editor on maps and charts packages. We could add this to the other packages as well.

Create dev-zfi4 branch request + Minor changes to get to build

I am working on creating some visuals for EDO office at CDC.

Request 1:

  • Please create a branch dev-zfi4 or grant user jcbowyer permission to create branch dev-zfi4 and publish

Request 2:

Review notes below.

When doing a pull request and following these steps on Ubuntu, I ran into a couple of issues:

  • Start by cloning this repo and running yarn install at the root.
  • Run lerna bootstrap and Lerna will initialize all the packages for you.
  • Run lerna run build to build all of the packages in the correct order.
  • 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).

Changes required in package.json in devDependencies

  • changed "react": "17.0.1" to "react": "17.0.2"
  • changed "react-dom": "17.0.1" to "17.0.2

Changes required in package.json in dependencies

  • changed "@cdc/core": "^1.1.2" to "@cdc/core": "^4.23.1"

[WCMSRD-12782] React warns of memory leak when unloading usa cdcmap

We're getting console warnings when our unit tests run that is coming from the cdcmap component when it unloads.

To produce:

const [showMap, setShowMap] = useState(false);
import mapdata from "./mapdata.json";

return (<>
<div>
  <label>Show map
  <input
    type="checkbox"
    checked={showMap}
    onChange={() => setShowMap((prev) => !prev)}
  />
  </label>
</div>

<div>{showMap ? <CdcMap config={mapdata} /> : null}</div>
</>);
  • toggle the map on and back off while watching the debugger console.

You can also try it out here:
https://codesandbox.io/s/demo-cdc-map-unmount-leak-rbv0h?file=/src/App.js

Error:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
at LC (/node_modules/@cdc/map/dist/cdcmap.js:1:716965)

@cdc/core 4.23.9 doesn't exist

In a clean directory, run npm install @cdc/[email protected]. This results in the following error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @cdc/core@^4.23.9.

Running npm info @cdc/core, it looks like 4.23.8 is the latest published version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.