Skip to content

Files

Latest commit

Mar 25, 2025
b09566f · Mar 25, 2025

History

History

editor

@cdc/editor

npm

React component for creating configurations for the dashboard, map, chart and data-bite packages. This package is part of the larger CDC Open Visualization project.

Examples

Installation and Usage

  1. Install the package in your React project npm install @cdc/editor
  2. Import the component and begin using in your code.
import CdcEditor from '@cdc/editor'

function App() {

  return (
    <div className="App">
      <CdcEditor />
    </div>
  );
}

export default App;

Note: If no properties are passed, the map will load a default configuration file.

Data Formatting

The data that you are mapping needs to be formatted in a specific way - must have distinct rows for each type of data and columns. If your data conforms to a regular spreadsheet, it's likely okay to utilize.

The supported formats are CSV and JSON files.

For more information and example data files, see the CDC's official guidance on formatting.

Properties

| Property | Type | Description | | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------- | --- | | config | Object | You can pass an existing config object to make changes to it with the editor. If no config is passed, it lets you start from scratch. | |