Skip to content

Commit

Permalink
Merge pull request #21 from concord-consortium/186435580-backport-cod…
Browse files Browse the repository at this point in the history
…ap-plugin-api

Backport CODAP Plugin API (PT-186435580)
  • Loading branch information
lublagg authored Dec 8, 2023
2 parents f50d498 + d86d49d commit 5db2b15
Show file tree
Hide file tree
Showing 8 changed files with 375 additions and 594 deletions.
285 changes: 279 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"report-dir": "coverage-cypress"
},
"devDependencies": {
"@concord-consortium/codap-plugin-api": "0.1.1",
"@cypress/code-coverage": "^3.10.0",
"@cypress/webpack-preprocessor": "^5.12.0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
Expand Down
11 changes: 9 additions & 2 deletions src/components/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useEffect, useState} from "react";
import {initializePlugin} from "@concord-consortium/codap-plugin-api";
import { Dropdown } from "./dropdown";
import classnames from "classnames";
import { Information } from "./information";
Expand All @@ -7,7 +8,6 @@ import { attributeOptions, categories, defaultSelectedOptions, fiftyStates } fro
import { countyData } from "../constants/counties";
import { IStateOptions } from "../constants/types";
import { createTableFromSelections } from "../scripts/api";
import { connect } from "../scripts/connect";
import { flatten } from "../scripts/utils";
import { queryData } from "../constants/queryHeaders";
import { strings } from "../constants/strings";
Expand All @@ -17,6 +17,13 @@ import Error from "../assets/warning.svg";

import css from "./app.scss";

const iFrameDescriptor ={
version: "0.0.1",
pluginName: "nass-plugin",
title: "NASS Quickstats Data",
dimensions: {width: 300, height: 400},
};

function App() {
const [showInfo, setShowInfo] = useState<boolean>(false);
const [selectedOptions, setSelectedOptions] = useState<IStateOptions>(defaultSelectedOptions);
Expand All @@ -30,7 +37,7 @@ function App() {

useEffect(() => {
const init = async () => {
await connect.initialize();
await initializePlugin(iFrameDescriptor);
};
init();
}, []);
Expand Down
Loading

0 comments on commit 5db2b15

Please sign in to comment.