@cdc/editor
v4.24.10
Published
React component for generating a new component entry
Downloads
120
Readme
@cdc/editor
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
- Install the package in your React project
npm install @cdc/editor
- 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. | |