From a228267b43010b13bb121ad4577405eefb10136b Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Tue, 14 May 2024 13:48:53 -0700 Subject: [PATCH 1/9] feat: basic plotting example This adds a basic plot to tabs in a naive, hardcoded way. This will be updated to be more customizable. --- frontend/app/block/plotblock.tsx | 64 ++++ frontend/app/tab/tab.tsx | 2 + package.json | 1 + public/plotdata/congress.csv | 542 +++++++++++++++++++++++++++++++ yarn.lock | 299 ++++++++++++++++- 5 files changed, 907 insertions(+), 1 deletion(-) create mode 100644 frontend/app/block/plotblock.tsx create mode 100644 public/plotdata/congress.csv diff --git a/frontend/app/block/plotblock.tsx b/frontend/app/block/plotblock.tsx new file mode 100644 index 000000000..4efdfd852 --- /dev/null +++ b/frontend/app/block/plotblock.tsx @@ -0,0 +1,64 @@ +import * as React from "react"; +import * as Plot from "@observablehq/plot"; +import * as d3 from "d3"; + +function PlotWindow() { + return
; +} + +function PlotConfig() { + return ; +} + +function PlotBlock() { + const containerRef = React.useRef(); + const [data, setData] = React.useState(); + + React.useEffect(() => { + d3.csv("/plotdata/congress.csv", d3.autoType).then(setData); + }, []); + + React.useEffect(() => { + if (data === undefined) { + return; + } + // replace start + const plot = Plot.plot({ + aspectRatio: 1, + x: { label: "Age (years)" }, + y: { + grid: true, + label: "← Women · Men →", + labelAnchor: "center", + tickFormat: Math.abs, + }, + marks: [ + Plot.dot( + data, + Plot.stackY2({ + x: (d) => 2023 - d.birthday.getUTCFullYear(), + y: (d) => (d.gender === "M" ? 1 : -1), + fill: "gender", + title: "full_name", + }) + ), + Plot.ruleY([0]), + ], + }); + // replace end + containerRef.current.append(plot); + + return () => { + plot.remove(); + }; + }, [data]); + + return ( +
+
+ +
+ ); +} + +export { PlotBlock }; diff --git a/frontend/app/tab/tab.tsx b/frontend/app/tab/tab.tsx index cb71ce9c0..c6763e344 100644 --- a/frontend/app/tab/tab.tsx +++ b/frontend/app/tab/tab.tsx @@ -5,6 +5,7 @@ import * as React from "react"; import * as jotai from "jotai"; import { Block } from "@/app/block/block"; import { atoms } from "@/store/global"; +import { PlotBlock } from "@/app/block/plotblock"; import "./tab.less"; @@ -23,6 +24,7 @@ const TabContent = ({ tabId }: { tabId: string }) => {
); })} + ); }; diff --git a/package.json b/package.json index f4b68f3ac..c4a410a0c 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "vite-tsconfig-paths": "^4.3.2" }, "dependencies": { + "@observablehq/plot": "^0.6.14", "@xterm/addon-fit": "^0.10.0", "@xterm/xterm": "^5.5.0", "base64-js": "^1.5.1", diff --git a/public/plotdata/congress.csv b/public/plotdata/congress.csv new file mode 100644 index 000000000..566be7461 --- /dev/null +++ b/public/plotdata/congress.csv @@ -0,0 +1,542 @@ +full_name,birthday,gender,type,state,party +Sherrod Brown,1952-11-09,M,sen,OH,Democrat +Maria Cantwell,1958-10-13,F,sen,WA,Democrat +Benjamin L. Cardin,1943-10-05,M,sen,MD,Democrat +Thomas R. Carper,1947-01-23,M,sen,DE,Democrat +"Robert P. Casey, Jr.",1960-04-13,M,sen,PA,Democrat +Dianne Feinstein,1933-06-22,F,sen,CA,Democrat +Amy Klobuchar,1960-05-25,F,sen,MN,Democrat +Robert Menendez,1954-01-01,M,sen,NJ,Democrat +Bernard Sanders,1941-09-08,M,sen,VT,Independent +Debbie Stabenow,1950-04-29,F,sen,MI,Democrat +Jon Tester,1956-08-21,M,sen,MT,Democrat +Sheldon Whitehouse,1955-10-20,M,sen,RI,Democrat +John Barrasso,1952-07-21,M,sen,WY,Republican +Roger F. Wicker,1951-07-05,M,sen,MS,Republican +Susan M. Collins,1952-12-07,F,sen,ME,Republican +John Cornyn,1952-02-02,M,sen,TX,Republican +Richard J. Durbin,1944-11-21,M,sen,IL,Democrat +Lindsey Graham,1955-07-09,M,sen,SC,Republican +Mitch McConnell,1942-02-20,M,sen,KY,Republican +Jeff Merkley,1956-10-24,M,sen,OR,Democrat +Jack Reed,1949-11-12,M,sen,RI,Democrat +James E. Risch,1943-05-03,M,sen,ID,Republican +Jeanne Shaheen,1947-01-28,F,sen,NH,Democrat +Mark R. Warner,1954-12-15,M,sen,VA,Democrat +Kirsten E. Gillibrand,1966-12-09,F,sen,NY,Democrat +Christopher A. Coons,1963-09-09,M,sen,DE,Democrat +"Joe Manchin, III",1947-08-24,M,sen,WV,Democrat +Robert B. Aderholt,1965-07-22,M,rep,AL,Republican +Tammy Baldwin,1962-02-11,F,sen,WI,Democrat +Michael F. Bennet,1964-11-28,M,sen,CO,Democrat +Gus M. Bilirakis,1963-02-08,M,rep,FL,Republican +"Sanford D. Bishop, Jr.",1947-02-04,M,rep,GA,Democrat +Marsha Blackburn,1952-06-06,F,sen,TN,Republican +Earl Blumenauer,1948-08-16,M,rep,OR,Democrat +Richard Blumenthal,1946-02-13,M,sen,CT,Democrat +John Boozman,1950-12-10,M,sen,AR,Republican +Vern Buchanan,1951-05-08,M,rep,FL,Republican +Larry Bucshon,1962-05-31,M,rep,IN,Republican +Michael C. Burgess,1950-12-23,M,rep,TX,Republican +Ken Calvert,1953-06-08,M,rep,CA,Republican +Shelley Moore Capito,1953-11-26,F,sen,WV,Republican +André Carson,1974-10-16,M,rep,IN,Democrat +John R. Carter,1941-11-06,M,rep,TX,Republican +Bill Cassidy,1957-09-28,M,sen,LA,Republican +Kathy Castor,1966-08-20,F,rep,FL,Democrat +Judy Chu,1953-07-07,F,rep,CA,Democrat +David N. Cicilline,1961-07-15,M,rep,RI,Democrat +Yvette D. Clarke,1964-11-21,F,rep,NY,Democrat +Emanuel Cleaver,1944-10-26,M,rep,MO,Democrat +James E. Clyburn,1940-07-21,M,rep,SC,Democrat +Steve Cohen,1949-05-24,M,rep,TN,Democrat +Tom Cole,1949-04-28,M,rep,OK,Republican +Gerald E. Connolly,1950-03-30,M,rep,VA,Democrat +Jim Costa,1952-04-13,M,rep,CA,Democrat +Joe Courtney,1953-04-06,M,rep,CT,Democrat +Mike Crapo,1951-05-20,M,sen,ID,Republican +"Eric A. ""Rick"" Crawford",1966-01-22,M,rep,AR,Republican +Henry Cuellar,1955-09-19,M,rep,TX,Democrat +Danny K. Davis,1941-09-06,M,rep,IL,Democrat +Diana DeGette,1957-07-29,F,rep,CO,Democrat +Rosa L. DeLauro,1943-03-02,F,rep,CT,Democrat +Scott DesJarlais,1964-02-21,M,rep,TN,Republican +Mario Diaz-Balart,1961-09-25,M,rep,FL,Republican +Lloyd Doggett,1946-10-06,M,rep,TX,Democrat +Jeff Duncan,1966-01-07,M,rep,SC,Republican +Anna G. Eshoo,1942-12-13,F,rep,CA,Democrat +"Charles J. ""Chuck"" Fleischmann",1962-10-11,M,rep,TN,Republican +Virginia Foxx,1943-06-29,F,rep,NC,Republican +John Garamendi,1945-01-24,M,rep,CA,Democrat +Paul A. Gosar,1958-11-22,M,rep,AZ,Republican +Kay Granger,1943-01-18,F,rep,TX,Republican +Chuck Grassley,1933-09-17,M,sen,IA,Republican +Sam Graves,1963-11-07,M,rep,MO,Republican +Al Green,1947-09-01,M,rep,TX,Democrat +H. Morgan Griffith,1958-03-15,M,rep,VA,Republican +Raúl M. Grijalva,1948-02-19,M,rep,AZ,Democrat +Brett Guthrie,1964-02-18,M,rep,KY,Republican +Andy Harris,1957-01-25,M,rep,MD,Republican +Martin Heinrich,1971-10-17,M,sen,NM,Democrat +Brian Higgins,1959-10-06,M,rep,NY,Democrat +James A. Himes,1966-07-05,M,rep,CT,Democrat +Mazie K. Hirono,1947-11-03,F,sen,HI,Democrat +John Hoeven,1957-03-13,M,sen,ND,Republican +Steny H. Hoyer,1939-06-14,M,rep,MD,Democrat +Bill Huizenga,1969-01-31,M,rep,MI,Republican +Sheila Jackson Lee,1950-01-12,F,rep,TX,Democrat +Bill Johnson,1954-11-10,M,rep,OH,Republican +"Henry C. ""Hank"" Johnson, Jr.",1954-10-02,M,rep,GA,Democrat +Ron Johnson,1955-04-08,M,sen,WI,Republican +Jim Jordan,1964-02-17,M,rep,OH,Republican +Marcy Kaptur,1946-06-17,F,rep,OH,Democrat +William R. Keating,1952-09-06,M,rep,MA,Democrat +Mike Kelly,1948-05-10,M,rep,PA,Republican +Doug Lamborn,1954-05-24,M,rep,CO,Republican +James Lankford,1968-03-04,M,sen,OK,Republican +Rick Larsen,1965-06-15,M,rep,WA,Democrat +John B. Larson,1948-07-22,M,rep,CT,Democrat +Robert E. Latta,1956-04-18,M,rep,OH,Republican +Barbara Lee,1946-07-16,F,rep,CA,Democrat +Mike Lee,1971-06-04,M,sen,UT,Republican +Zoe Lofgren,1947-12-21,F,rep,CA,Democrat +Frank D. Lucas,1960-01-06,M,rep,OK,Republican +Blaine Luetkemeyer,1952-05-07,M,rep,MO,Republican +Ben Ray Luján,1972-06-07,M,sen,NM,Democrat +Stephen F. Lynch,1955-03-31,M,rep,MA,Democrat +Edward J. Markey,1946-07-11,M,sen,MA,Democrat +Doris O. Matsui,1944-09-25,F,rep,CA,Democrat +Kevin McCarthy,1965-01-26,M,rep,CA,Republican +Michael T. McCaul,1962-01-14,M,rep,TX,Republican +Tom McClintock,1956-07-10,M,rep,CA,Republican +Betty McCollum,1954-07-12,F,rep,MN,Democrat +James P. McGovern,1959-11-20,M,rep,MA,Democrat +Patrick T. McHenry,1975-10-22,M,rep,NC,Republican +Cathy McMorris Rodgers,1969-05-22,F,rep,WA,Republican +Gregory W. Meeks,1953-09-25,M,rep,NY,Democrat +Gwen Moore,1951-04-18,F,rep,WI,Democrat +Jerry Moran,1954-05-29,M,sen,KS,Republican +Lisa Murkowski,1957-05-22,F,sen,AK,Republican +Christopher Murphy,1973-08-03,M,sen,CT,Democrat +Patty Murray,1950-10-11,F,sen,WA,Democrat +Jerrold Nadler,1947-06-13,M,rep,NY,Democrat +Grace F. Napolitano,1936-12-04,F,rep,CA,Democrat +Richard E. Neal,1949-02-14,M,rep,MA,Democrat +Eleanor Holmes Norton,1937-06-13,F,rep,DC,Democrat +"Frank Pallone, Jr.",1951-10-30,M,rep,NJ,Democrat +"Bill Pascrell, Jr.",1937-01-25,M,rep,NJ,Democrat +Rand Paul,1963-01-07,M,sen,KY,Republican +Nancy Pelosi,1940-03-26,F,rep,CA,Democrat +Gary C. Peters,1958-12-01,M,sen,MI,Democrat +Chellie Pingree,1955-04-02,F,rep,ME,Democrat +Bill Posey,1947-12-18,M,rep,FL,Republican +Mike Quigley,1958-10-17,M,rep,IL,Democrat +Harold Rogers,1937-12-31,M,rep,KY,Republican +Mike Rogers,1958-07-16,M,rep,AL,Republican +Marco Rubio,1971-05-28,M,sen,FL,Republican +C. A. Dutch Ruppersberger,1946-01-31,M,rep,MD,Democrat +Gregorio Kilili Camacho Sablan,1955-01-19,M,rep,MP,Democrat +John P. Sarbanes,1962-05-22,M,rep,MD,Democrat +Steve Scalise,1965-10-06,M,rep,LA,Republican +Janice D. Schakowsky,1944-05-26,F,rep,IL,Democrat +Adam B. Schiff,1960-06-22,M,rep,CA,Democrat +Charles E. Schumer,1950-11-23,M,sen,NY,Democrat +David Schweikert,1962-03-03,M,rep,AZ,Republican +Austin Scott,1969-12-10,M,rep,GA,Republican +David Scott,1945-06-27,M,rep,GA,Democrat +"Robert C. ""Bobby"" Scott",1947-04-30,M,rep,VA,Democrat +Tim Scott,1965-09-19,M,sen,SC,Republican +Terri A. Sewell,1965-01-01,F,rep,AL,Democrat +Brad Sherman,1954-10-24,M,rep,CA,Democrat +Michael K. Simpson,1950-09-08,M,rep,ID,Republican +Adam Smith,1965-06-15,M,rep,WA,Democrat +Adrian Smith,1970-12-19,M,rep,NE,Republican +Christopher H. Smith,1953-03-04,M,rep,NJ,Republican +Linda T. Sánchez,1969-01-28,F,rep,CA,Democrat +Bennie G. Thompson,1948-01-28,M,rep,MS,Democrat +Mike Thompson,1951-01-24,M,rep,CA,Democrat +Glenn Thompson,1959-07-27,M,rep,PA,Republican +John Thune,1961-01-07,M,sen,SD,Republican +Paul Tonko,1949-06-18,M,rep,NY,Democrat +Michael R. Turner,1960-01-11,M,rep,OH,Republican +Chris Van Hollen,1959-01-10,M,sen,MD,Democrat +Nydia M. Velázquez,1953-03-28,F,rep,NY,Democrat +Tim Walberg,1951-04-12,M,rep,MI,Republican +Debbie Wasserman Schultz,1966-09-27,F,rep,FL,Democrat +Maxine Waters,1938-08-15,F,rep,CA,Democrat +Daniel Webster,1949-04-27,M,rep,FL,Republican +Peter Welch,1947-05-02,M,sen,VT,Democrat +Joe Wilson,1947-07-31,M,rep,SC,Republican +Frederica S. Wilson,1942-11-05,F,rep,FL,Democrat +Robert J. Wittman,1959-02-03,M,rep,VA,Republican +Steve Womack,1957-02-18,M,rep,AR,Republican +Ron Wyden,1949-05-03,M,sen,OR,Democrat +Todd Young,1972-08-24,M,sen,IN,Republican +Mark E. Amodei,1958-06-12,M,rep,NV,Republican +Suzanne Bonamici,1954-10-14,F,rep,OR,Democrat +Suzan K. DelBene,1962-02-17,F,rep,WA,Democrat +Thomas Massie,1971-01-13,M,rep,KY,Republican +"Donald M. Payne, Jr.",1958-12-17,M,rep,NJ,Democrat +Brian Schatz,1972-10-20,M,sen,HI,Democrat +Bill Foster,1955-10-07,M,rep,IL,Democrat +Dina Titus,1950-05-23,F,rep,NV,Democrat +Tom Cotton,1977-05-13,M,sen,AR,Republican +Kyrsten Sinema,1976-07-12,F,sen,AZ,Independent +Doug LaMalfa,1960-07-02,M,rep,CA,Republican +Jared Huffman,1964-02-18,M,rep,CA,Democrat +Ami Bera,1965-03-02,M,rep,CA,Democrat +Eric Swalwell,1980-11-16,M,rep,CA,Democrat +Julia Brownley,1952-08-28,F,rep,CA,Democrat +Tony Cárdenas,1963-03-31,M,rep,CA,Democrat +Raul Ruiz,1972-08-25,M,rep,CA,Democrat +Mark Takano,1960-12-10,M,rep,CA,Democrat +Juan Vargas,1961-03-07,M,rep,CA,Democrat +Scott H. Peters,1958-06-17,M,rep,CA,Democrat +Lois Frankel,1948-05-16,F,rep,FL,Democrat +Tammy Duckworth,1968-03-12,F,sen,IL,Democrat +Andy Barr,1973-07-24,M,rep,KY,Republican +Elizabeth Warren,1949-06-22,F,sen,MA,Democrat +"Angus S. King, Jr.",1944-03-31,M,sen,ME,Independent +Daniel T. Kildee,1958-08-11,M,rep,MI,Democrat +Ann Wagner,1962-09-13,F,rep,MO,Republican +Steve Daines,1962-08-20,M,sen,MT,Republican +Richard Hudson,1971-11-04,M,rep,NC,Republican +Kevin Cramer,1961-01-21,M,sen,ND,Republican +Deb Fischer,1951-03-01,F,sen,NE,Republican +Ann M. Kuster,1956-09-05,F,rep,NH,Democrat +Grace Meng,1975-10-01,F,rep,NY,Democrat +Hakeem S. Jeffries,1970-08-04,M,rep,NY,Democrat +Brad R. Wenstrup,1958-06-17,M,rep,OH,Republican +Joyce Beatty,1950-03-12,F,rep,OH,Democrat +David P. Joyce,1957-03-17,M,rep,OH,Republican +Markwayne Mullin,1977-07-26,M,sen,OK,Republican +Scott Perry,1962-05-27,M,rep,PA,Republican +Matt Cartwright,1961-05-01,M,rep,PA,Democrat +Ted Cruz,1970-12-22,M,sen,TX,Republican +"Randy K. Weber, Sr.",1953-07-02,M,rep,TX,Republican +Joaquin Castro,1974-09-16,M,rep,TX,Democrat +Roger Williams,1949-09-13,M,rep,TX,Republican +Marc A. Veasey,1971-01-03,M,rep,TX,Democrat +Chris Stewart,1960-07-15,M,rep,UT,Republican +Tim Kaine,1958-02-26,M,sen,VA,Democrat +Derek Kilmer,1974-01-01,M,rep,WA,Democrat +Mark Pocan,1964-08-14,M,rep,WI,Democrat +Robin L. Kelly,1956-04-30,F,rep,IL,Democrat +Jason Smith,1980-06-16,M,rep,MO,Republican +Cory A. Booker,1969-04-27,M,sen,NJ,Democrat +Katherine M. Clark,1963-07-17,F,rep,MA,Democrat +Donald Norcross,1958-12-13,M,rep,NJ,Democrat +Alma S. Adams,1946-05-27,F,rep,NC,Democrat +Gary J. Palmer,1954-05-14,M,rep,AL,Republican +J. French Hill,1956-12-05,M,rep,AR,Republican +Bruce Westerman,1967-11-18,M,rep,AR,Republican +Ruben Gallego,1979-11-20,M,rep,AZ,Democrat +Mark DeSaulnier,1952-03-31,M,rep,CA,Democrat +Pete Aguilar,1979-06-19,M,rep,CA,Democrat +Ted Lieu,1969-03-29,M,rep,CA,Democrat +Norma J. Torres,1965-04-04,F,rep,CA,Democrat +Ken Buck,1959-02-16,M,rep,CO,Republican +"Earl L. ""Buddy"" Carter",1957-09-06,M,rep,GA,Republican +Barry Loudermilk,1963-12-22,M,rep,GA,Republican +Rick W. Allen,1951-11-07,M,rep,GA,Republican +Mike Bost,1960-12-30,M,rep,IL,Republican +Garret Graves,1972-01-31,M,rep,LA,Republican +Seth Moulton,1978-10-24,M,rep,MA,Democrat +John R. Moolenaar,1961-05-08,M,rep,MI,Republican +Debbie Dingell,1953-11-23,F,rep,MI,Democrat +Tom Emmer,1961-03-03,M,rep,MN,Republican +David Rouzer,1972-02-16,M,rep,NC,Republican +Bonnie Watson Coleman,1945-02-06,F,rep,NJ,Democrat +Elise M. Stefanik,1984-07-02,F,rep,NY,Republican +Brendan F. Boyle,1977-02-06,M,rep,PA,Democrat +Brian Babin,1948-03-23,M,rep,TX,Republican +"Donald S. Beyer, Jr.",1950-06-20,M,rep,VA,Democrat +Stacey E. Plaskett,1966-05-13,F,rep,VI,Democrat +Dan Newhouse,1955-07-10,M,rep,WA,Republican +Glenn Grothman,1955-07-03,M,rep,WI,Republican +Alexander X. Mooney,1971-06-05,M,rep,WV,Republican +Aumua Amata Coleman Radewagen,1947-12-29,F,rep,AS,Republican +Dan Sullivan,1964-11-13,M,sen,AK,Republican +Joni Ernst,1970-07-01,F,sen,IA,Republican +Thom Tillis,1960-08-30,M,sen,NC,Republican +Mike Rounds,1954-10-24,M,sen,SD,Republican +Trent Kelly,1966-03-01,M,rep,MS,Republican +Darin LaHood,1968-07-05,M,rep,IL,Republican +Warren Davidson,1970-03-01,M,rep,OH,Republican +James Comer,1972-08-19,M,rep,KY,Republican +Dwight Evans,1954-05-16,M,rep,PA,Democrat +John Kennedy,1951-11-21,M,sen,LA,Republican +Margaret Wood Hassan,1958-02-27,F,sen,NH,Democrat +Catherine Cortez Masto,1964-03-29,F,sen,NV,Democrat +Bradley Scott Schneider,1961-08-20,M,rep,IL,Democrat +Andy Biggs,1958-11-07,M,rep,AZ,Republican +Ro Khanna,1976-09-13,M,rep,CA,Democrat +Jimmy Panetta,1969-10-01,M,rep,CA,Democrat +Salud O. Carbajal,1964-11-18,M,rep,CA,Democrat +Nanette Diaz Barragán,1976-09-15,F,rep,CA,Democrat +J. Luis Correa,1958-01-24,M,rep,CA,Democrat +Lisa Blunt Rochester,1962-02-10,F,rep,DE,Democrat +Matt Gaetz,1982-05-07,M,rep,FL,Republican +Neal P. Dunn,1953-02-16,M,rep,FL,Republican +John H. Rutherford,1952-09-02,M,rep,FL,Republican +Darren Soto,1978-02-25,M,rep,FL,Democrat +Brian J. Mast,1980-07-10,M,rep,FL,Republican +A. Drew Ferguson IV,1966-11-15,M,rep,GA,Republican +Raja Krishnamoorthi,1973-07-19,M,rep,IL,Democrat +Jim Banks,1979-07-16,M,rep,IN,Republican +Roger Marshall,1960-08-09,M,sen,KS,Republican +Clay Higgins,1961-08-24,M,rep,LA,Republican +Mike Johnson,1972-01-30,M,rep,LA,Republican +Jamie Raskin,1962-12-13,M,rep,MD,Democrat +Jack Bergman,1947-02-02,M,rep,MI,Republican +Ted Budd,1971-10-21,M,sen,NC,Republican +Don Bacon,1963-08-16,M,rep,NE,Republican +Josh Gottheimer,1975-03-08,M,rep,NJ,Democrat +Jacky Rosen,1957-08-02,F,sen,NV,Democrat +Adriano Espaillat,1954-09-27,M,rep,NY,Democrat +Brian K. Fitzpatrick,1973-12-17,M,rep,PA,Republican +Lloyd Smucker,1964-01-23,M,rep,PA,Republican +Jenniffer González-Colón,1976-08-05,F,rep,PR,Republican +David Kustoff,1966-10-08,M,rep,TN,Republican +Vicente Gonzalez,1967-09-04,M,rep,TX,Democrat +Jodey C. Arrington,1972-03-09,M,rep,TX,Republican +Pramila Jayapal,1965-09-21,F,rep,WA,Democrat +Mike Gallagher,1984-03-03,M,rep,WI,Republican +Ron Estes,1956-07-19,M,rep,KS,Republican +Ralph Norman,1953-06-20,M,rep,SC,Republican +Jimmy Gomez,1974-11-25,M,rep,CA,Democrat +John R. Curtis,1960-05-10,M,rep,UT,Republican +Tina Smith,1958-03-04,F,sen,MN,Democrat +Cindy Hyde-Smith,1959-05-10,F,sen,MS,Republican +Debbie Lesko,1958-11-14,F,rep,AZ,Republican +Michael Cloud,1975-05-13,M,rep,TX,Republican +Troy Balderson,1962-01-16,M,rep,OH,Republican +Kevin Hern,1961-12-04,M,rep,OK,Republican +Joseph D. Morelle,1957-04-29,M,rep,NY,Democrat +Mary Gay Scanlon,1959-08-30,F,rep,PA,Democrat +Susan Wild,1957-06-07,F,rep,PA,Democrat +Ed Case,1952-09-27,M,rep,HI,Democrat +Steven Horsford,1973-04-29,M,rep,NV,Democrat +Greg Stanton,1970-03-08,M,rep,AZ,Democrat +Josh Harder,1986-08-01,M,rep,CA,Democrat +Katie Porter,1974-01-03,F,rep,CA,Democrat +Mike Levin,1978-10-28,M,rep,CA,Democrat +Joe Neguse,1984-05-13,M,rep,CO,Democrat +Jason Crow,1979-03-15,M,rep,CO,Democrat +Jahana Hayes,1973-03-08,F,rep,CT,Democrat +Michael Waltz,1974-01-31,M,rep,FL,Republican +W. Gregory Steube,1978-05-19,M,rep,FL,Republican +Lucy McBath,1960-06-01,F,rep,GA,Democrat +Russ Fulcher,1973-07-19,M,rep,ID,Republican +"Jesús G. ""Chuy"" García",1956-04-12,M,rep,IL,Democrat +Sean Casten,1971-11-23,M,rep,IL,Democrat +Lauren Underwood,1986-10-04,F,rep,IL,Democrat +James R. Baird,1945-06-04,M,rep,IN,Republican +Greg Pence,1956-11-14,M,rep,IN,Republican +Sharice Davids,1980-05-22,F,rep,KS,Democrat +Lori Trahan,1973-10-27,F,rep,MA,Democrat +Ayanna Pressley,1974-02-03,F,rep,MA,Democrat +David J. Trone,1955-09-21,M,rep,MD,Democrat +Elissa Slotkin,1976-07-10,F,rep,MI,Democrat +Haley M. Stevens,1983-06-24,F,rep,MI,Democrat +Rashida Tlaib,1976-07-24,F,rep,MI,Democrat +Angie Craig,1972-02-14,F,rep,MN,Democrat +Dean Phillips,1969-01-20,M,rep,MN,Democrat +Ilhan Omar,1981-10-04,F,rep,MN,Democrat +Pete Stauber,1966-05-10,M,rep,MN,Republican +Michael Guest,1970-02-04,M,rep,MS,Republican +Kelly Armstrong,1976-10-08,M,rep,ND,Republican +Chris Pappas,1980-06-04,M,rep,NH,Democrat +Jefferson Van Drew,1953-02-23,M,rep,NJ,Republican +Andy Kim,1982-07-12,M,rep,NJ,Democrat +Mikie Sherrill,1972-01-19,F,rep,NJ,Democrat +Susie Lee,1966-11-07,F,rep,NV,Democrat +Alexandria Ocasio-Cortez,1989-10-13,F,rep,NY,Democrat +Madeleine Dean,1959-06-06,F,rep,PA,Democrat +Chrissy Houlahan,1967-06-05,F,rep,PA,Democrat +Daniel Meuser,1964-02-10,M,rep,PA,Republican +John Joyce,1957-02-08,M,rep,PA,Republican +Guy Reschenthaler,1983-04-17,M,rep,PA,Republican +William R. Timmons IV,1984-04-30,M,rep,SC,Republican +Dusty Johnson,1976-09-30,M,rep,SD,Republican +Tim Burchett,1964-08-25,M,rep,TN,Republican +John W. Rose,1965-02-23,M,rep,TN,Republican +Mark E. Green,1964-11-08,M,rep,TN,Republican +Dan Crenshaw,1984-03-14,M,rep,TX,Republican +Lance Gooden,1982-12-01,M,rep,TX,Republican +Lizzie Fletcher,1975-02-13,F,rep,TX,Democrat +Veronica Escobar,1969-09-15,F,rep,TX,Democrat +Chip Roy,1972-08-07,M,rep,TX,Republican +Sylvia R. Garcia,1950-09-06,F,rep,TX,Democrat +Colin Z. Allred,1983-04-15,M,rep,TX,Democrat +Ben Cline,1972-02-29,M,rep,VA,Republican +Abigail Davis Spanberger,1979-08-07,F,rep,VA,Democrat +Jennifer Wexton,1968-05-27,F,rep,VA,Democrat +Kim Schrier,1968-08-23,F,rep,WA,Democrat +Bryan Steil,1981-03-30,M,rep,WI,Republican +Carol D. Miller,1950-11-04,F,rep,WV,Republican +Rick Scott,1952-12-01,M,sen,FL,Republican +Mike Braun,1954-03-24,M,sen,IN,Republican +Josh Hawley,1979-12-31,M,sen,MO,Republican +Mitt Romney,1947-03-12,M,sen,UT,Republican +Jared F. Golden,1982-07-25,M,rep,ME,Democrat +Dan Bishop,1964-07-01,M,rep,NC,Republican +Gregory F. Murphy,1963-03-05,M,rep,NC,Republican +Kweisi Mfume,1948-10-24,M,rep,MD,Democrat +Thomas P. Tiffany,1957-12-30,M,rep,WI,Republican +Mike Garcia,1976-04-24,M,rep,CA,Republican +Mark Kelly,1964-02-21,M,sen,AZ,Democrat +Cynthia M. Lummis,1954-09-10,F,sen,WY,Republican +Darrell Issa,1953-11-01,M,rep,CA,Republican +Pete Sessions,1955-03-22,M,rep,TX,Republican +David G. Valadao,1977-04-14,M,rep,CA,Republican +Tommy Tuberville,1954-09-18,M,sen,AL,Republican +John W. Hickenlooper,1952-02-07,M,sen,CO,Democrat +Bill Hagerty,1959-08-14,M,sen,TN,Republican +Jerry L. Carl,1958-06-17,M,rep,AL,Republican +Barry Moore,1966-09-26,M,rep,AL,Republican +Jay Obernolte,1970-08-18,M,rep,CA,Republican +Young Kim,1962-10-18,F,rep,CA,Republican +Michelle Steel,1955-06-21,F,rep,CA,Republican +Sara Jacobs,1989-02-01,F,rep,CA,Democrat +Lauren Boebert,1986-12-15,F,rep,CO,Republican +Kat Cammack,1988-02-16,F,rep,FL,Republican +C. Scott Franklin,1964-08-23,M,rep,FL,Republican +Byron Donalds,1978-10-28,M,rep,FL,Republican +Carlos A. Gimenez,1954-01-17,M,rep,FL,Republican +Maria Elvira Salazar,1961-11-01,F,rep,FL,Republican +Nikema Williams,1978-07-30,F,rep,GA,Democrat +Andrew S. Clyde,1963-11-22,M,rep,GA,Republican +Marjorie Taylor Greene,1974-05-27,F,rep,GA,Republican +Ashley Hinson,1983-06-27,F,rep,IA,Republican +Mariannette Miller-Meeks,1955-09-06,F,rep,IA,Republican +Randy Feenstra,1969-01-14,M,rep,IA,Republican +Mary E. Miller,1959-08-27,F,rep,IL,Republican +Frank J. Mrvan,1969-04-16,M,rep,IN,Democrat +Victoria Spartz,1978-10-06,F,rep,IN,Republican +Tracey Mann,1976-12-17,M,rep,KS,Republican +Jake LaTurner,1988-02-17,M,rep,KS,Republican +Jake Auchincloss,1988-01-29,M,rep,MA,Democrat +Lisa C. McClain,1966-04-07,F,rep,MI,Republican +Michelle Fischbach,1965-11-03,F,rep,MN,Republican +Cori Bush,1976-07-21,F,rep,MO,Democrat +"Matthew M. Rosendale, Sr.",1960-07-07,M,rep,MT,Republican +Deborah K. Ross,1963-06-20,F,rep,NC,Democrat +Kathy E. Manning,1956-12-03,F,rep,NC,Democrat +Teresa Leger Fernandez,1959-07-01,F,rep,NM,Democrat +Andrew R. Garbarino,1984-09-27,M,rep,NY,Republican +Nicole Malliotakis,1980-11-11,F,rep,NY,Republican +Ritchie Torres,1988-03-12,M,rep,NY,Democrat +Jamaal Bowman,1976-04-01,M,rep,NY,Democrat +Stephanie I. Bice,1973-11-11,F,rep,OK,Republican +Cliff Bentz,1952-01-12,M,rep,OR,Republican +Nancy Mace,1977-12-04,F,rep,SC,Republican +Diana Harshbarger,1960-01-01,F,rep,TN,Republican +Pat Fallon,1967-12-19,M,rep,TX,Republican +August Pfluger,1978-12-28,M,rep,TX,Republican +Ronny Jackson,1967-05-04,M,rep,TX,Republican +Troy E. Nehls,1968-04-07,M,rep,TX,Republican +Tony Gonzales,1980-10-10,M,rep,TX,Republican +Beth Van Duyne,1970-11-16,F,rep,TX,Republican +Blake D. Moore,1980-06-22,M,rep,UT,Republican +Burgess Owens,1951-08-02,M,rep,UT,Republican +Bob Good,1965-09-11,M,rep,VA,Republican +Marilyn Strickland,1962-09-25,F,rep,WA,Democrat +Scott Fitzgerald,1963-11-16,M,rep,WI,Republican +Alex Padilla,1973-03-22,M,sen,CA,Democrat +Jon Ossoff,1987-02-16,M,sen,GA,Democrat +Raphael G. Warnock,1969-07-23,M,sen,GA,Democrat +Claudia Tenney,1961-02-04,F,rep,NY,Republican +Julia Letlow,1981-03-16,F,rep,LA,Republican +Troy A. Carter,1963-10-26,M,rep,LA,Democrat +Melanie A. Stansbury,1979-01-31,F,rep,NM,Democrat +Jake Ellzey,1970-01-24,M,rep,TX,Republican +Shontel M. Brown,1975-06-24,F,rep,OH,Democrat +Mike Carey,1971-03-13,M,rep,OH,Republican +Sheila Cherfilus-McCormick,1979-01-25,F,rep,FL,Democrat +Mike Flood,1975-02-23,M,rep,NE,Republican +Brad Finstad,1976-05-30,M,rep,MN,Republican +Mary Sattler Peltola,1973-08-31,F,rep,AK,Democrat +Patrick Ryan,1982-03-28,M,rep,NY,Democrat +Rudy Yakym III,1984-02-24,M,rep,IN,Republican +Ryan K. Zinke,1961-11-01,M,rep,MT,Republican +Katie Boyd Britt,1982-02-02,F,sen,AL,Republican +Eric Schmitt,1975-06-20,M,sen,MO,Republican +J.D. Vance,1984-08-02,M,sen,OH,Republican +John Fetterman,1969-08-15,M,sen,PA,Democrat +Dale W. Strong,1970-05-08,M,rep,AL,Republican +Elijah Crane,1980-01-03,M,rep,AZ,Republican +Juan Ciscomani,1982-08-30,M,rep,AZ,Republican +Kevin Kiley,1985-01-30,M,rep,CA,Republican +John S. Duarte,1966-09-06,M,rep,CA,Republican +Kevin Mullin,1970-06-15,M,rep,CA,Democrat +Sydney Kamlager-Dove,1972-07-20,F,rep,CA,Democrat +Robert Garcia,1977-12-02,M,rep,CA,Democrat +Brittany Pettersen,1981-12-06,F,rep,CO,Democrat +Yadira Caraveo,1980-12-23,F,rep,CO,Democrat +Aaron Bean,1967-01-25,M,rep,FL,Republican +Cory Mills,1980-07-30,M,rep,FL,Republican +Maxwell Frost,1997-01-17,M,rep,FL,Democrat +Anna Paulina Luna,1989-05-06,F,rep,FL,Republican +Laurel M. Lee,1974-03-26,F,rep,FL,Republican +Jared Moskowitz,1980-12-18,M,rep,FL,Democrat +Richard McCormick,1968-10-07,M,rep,GA,Republican +Mike Collins,1967-07-02,M,rep,GA,Republican +James C. Moylan,1962-07-18,M,rep,GU,Republican +Jill N. Tokuda,1976-03-28,F,rep,HI,Democrat +Zachary Nunn,1979-05-04,M,rep,IA,Republican +Jonathan L. Jackson,1966-01-07,M,rep,IL,Democrat +Delia C. Ramirez,1983-06-02,F,rep,IL,Democrat +Nikki Budzinski,1977-03-11,F,rep,IL,Democrat +Eric Sorensen,1976-03-18,M,rep,IL,Democrat +Erin Houchin,1976-09-24,F,rep,IN,Republican +Morgan McGarvey,1979-12-23,M,rep,KY,Democrat +Glenn Ivey,1961-02-27,M,rep,MD,Democrat +Hillary J. Scholten,1982-02-22,F,rep,MI,Democrat +John James,1981-06-08,M,rep,MI,Republican +Shri Thanedar,1955-02-22,M,rep,MI,Democrat +Mark Alford,1963-10-04,M,rep,MO,Republican +Eric Burlison,1976-10-02,M,rep,MO,Republican +Mike Ezell,1959-04-06,M,rep,MS,Republican +Donald G. Davis,1971-08-29,M,rep,NC,Democrat +Valerie P. Foushee,1956-05-07,F,rep,NC,Democrat +Chuck Edwards,1960-09-13,M,rep,NC,Republican +Wiley Nickel,1975-11-23,M,rep,NC,Democrat +Jeff Jackson,1982-09-12,M,rep,NC,Democrat +"Thomas H. Kean, Jr.",1968-09-05,M,rep,NJ,Republican +Robert Menendez,1985-07-12,M,rep,NJ,Democrat +Gabe Vasquez,1984-08-03,M,rep,NM,Democrat +Nick LaLota,1978-06-23,M,rep,NY,Republican +George Santos,1988-07-22,M,rep,NY,Republican +Anthony D’Esposito,1982-02-22,M,rep,NY,Republican +Daniel S. Goldman,1976-02-26,M,rep,NY,Democrat +Michael Lawler,1986-09-09,M,rep,NY,Republican +Marcus J. Molinaro,1975-10-08,M,rep,NY,Republican +Brandon Williams,1967-05-22,M,rep,NY,Republican +Nicholas A. Langworthy,1981-02-27,M,rep,NY,Republican +Greg Landsman,1976-12-04,M,rep,OH,Democrat +Max L. Miller,1988-11-13,M,rep,OH,Republican +Emilia Strong Sykes,1986-01-04,F,rep,OH,Democrat +Josh Brecheen,1979-06-19,M,rep,OK,Republican +Val T. Hoyle,1964-02-14,F,rep,OR,Democrat +Lori Chavez-DeRemer,1968-04-07,F,rep,OR,Republican +Andrea Salinas,1969-12-06,F,rep,OR,Democrat +Summer L. Lee,1987-11-26,F,rep,PA,Democrat +Christopher R. Deluzio,1984-07-13,M,rep,PA,Democrat +Seth Magaziner,1983-07-22,M,rep,RI,Democrat +Russell Fry,1985-01-31,M,rep,SC,Republican +Andrew Ogles,1971-06-18,M,rep,TN,Republican +Nathaniel Moran,1974-07-22,M,rep,TX,Republican +Keith Self,1953-03-20,M,rep,TX,Republican +Morgan Luttrell,1975-11-07,M,rep,TX,Republican +Monica De La Cruz,1974-11-11,F,rep,TX,Republican +Jasmine Crockett,1981-03-29,F,rep,TX,Democrat +Greg Casar,1989-05-04,M,rep,TX,Democrat +Wesley Hunt,1981-11-13,M,rep,TX,Republican +Jennifer Kiggans,1971-06-18,F,rep,VA,Republican +Becca Balint,1968-05-04,F,rep,VT,Democrat +Marie Gluesenkamp Perez,1988-06-06,F,rep,WA,Democrat +Derrick Van Orden,1969-09-15,M,rep,WI,Republican +Harriet M. Hageman,1962-10-18,F,rep,WY,Republican +Pete Ricketts,1964-08-19,M,sen,NE,Republican +Jennifer L. McClellan,1972-12-28,F,rep,VA,Democrat \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index f5dc07561..8992ddf69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -356,6 +356,15 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@observablehq/plot@^0.6.14": + version "0.6.14" + resolved "https://registry.yarnpkg.com/@observablehq/plot/-/plot-0.6.14.tgz#4644279bb938cc4d64b1f3cc4893bcf88b250202" + integrity sha512-A9HWSboh1WgFonKqYKC522VkxJwhkTUTye606qjxQH8iPtSVjVXUF6JRKwf7MPaYTin/MypaSSd+08ML4LA1rw== + dependencies: + d3 "^7.9.0" + interval-tree-1d "^1.0.0" + isoformat "^0.2.0" + "@rollup/rollup-android-arm-eabi@4.17.2": version "4.17.2" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz#1a32112822660ee104c5dd3a7c595e26100d4c2d" @@ -585,6 +594,11 @@ base64-js@^1.5.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +binary-search-bounds@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/binary-search-bounds/-/binary-search-bounds-2.0.5.tgz#125e5bd399882f71e6660d4bf1186384e989fba7" + integrity sha512-H0ea4Fd3lS1+sTEB2TgcLoK21lLhwEJzlQv3IN47pJS976Gx4zoWe0ak3q+uYh60ppQxg9F16Ri4tS1sfD4+jA== + browserslist@^4.22.2: version "4.23.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" @@ -656,6 +670,11 @@ comma-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== +commander@7: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -673,6 +692,250 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== +"d3-array@2 - 3", "d3-array@2.10.0 - 3", "d3-array@2.5.0 - 3", d3-array@3, d3-array@^3.2.0: + version "3.2.4" + resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-3.2.4.tgz#15fec33b237f97ac5d7c986dc77da273a8ed0bb5" + integrity sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg== + dependencies: + internmap "1 - 2" + +d3-axis@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-axis/-/d3-axis-3.0.0.tgz#c42a4a13e8131d637b745fc2973824cfeaf93322" + integrity sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw== + +d3-brush@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-brush/-/d3-brush-3.0.0.tgz#6f767c4ed8dcb79de7ede3e1c0f89e63ef64d31c" + integrity sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ== + dependencies: + d3-dispatch "1 - 3" + d3-drag "2 - 3" + d3-interpolate "1 - 3" + d3-selection "3" + d3-transition "3" + +d3-chord@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-chord/-/d3-chord-3.0.1.tgz#d156d61f485fce8327e6abf339cb41d8cbba6966" + integrity sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g== + dependencies: + d3-path "1 - 3" + +"d3-color@1 - 3", d3-color@3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-3.1.0.tgz#395b2833dfac71507f12ac2f7af23bf819de24e2" + integrity sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA== + +d3-contour@4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/d3-contour/-/d3-contour-4.0.2.tgz#bb92063bc8c5663acb2422f99c73cbb6c6ae3bcc" + integrity sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA== + dependencies: + d3-array "^3.2.0" + +d3-delaunay@6: + version "6.0.4" + resolved "https://registry.yarnpkg.com/d3-delaunay/-/d3-delaunay-6.0.4.tgz#98169038733a0a5babbeda55054f795bb9e4a58b" + integrity sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A== + dependencies: + delaunator "5" + +"d3-dispatch@1 - 3", d3-dispatch@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-dispatch/-/d3-dispatch-3.0.1.tgz#5fc75284e9c2375c36c839411a0cf550cbfc4d5e" + integrity sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg== + +"d3-drag@2 - 3", d3-drag@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-drag/-/d3-drag-3.0.0.tgz#994aae9cd23c719f53b5e10e3a0a6108c69607ba" + integrity sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg== + dependencies: + d3-dispatch "1 - 3" + d3-selection "3" + +"d3-dsv@1 - 3", d3-dsv@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-dsv/-/d3-dsv-3.0.1.tgz#c63af978f4d6a0d084a52a673922be2160789b73" + integrity sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q== + dependencies: + commander "7" + iconv-lite "0.6" + rw "1" + +"d3-ease@1 - 3", d3-ease@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-ease/-/d3-ease-3.0.1.tgz#9658ac38a2140d59d346160f1f6c30fda0bd12f4" + integrity sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w== + +d3-fetch@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-fetch/-/d3-fetch-3.0.1.tgz#83141bff9856a0edb5e38de89cdcfe63d0a60a22" + integrity sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw== + dependencies: + d3-dsv "1 - 3" + +d3-force@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-force/-/d3-force-3.0.0.tgz#3e2ba1a61e70888fe3d9194e30d6d14eece155c4" + integrity sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg== + dependencies: + d3-dispatch "1 - 3" + d3-quadtree "1 - 3" + d3-timer "1 - 3" + +"d3-format@1 - 3", d3-format@3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-3.1.0.tgz#9260e23a28ea5cb109e93b21a06e24e2ebd55641" + integrity sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA== + +d3-geo@3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/d3-geo/-/d3-geo-3.1.1.tgz#6027cf51246f9b2ebd64f99e01dc7c3364033a4d" + integrity sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q== + dependencies: + d3-array "2.5.0 - 3" + +d3-hierarchy@3: + version "3.1.2" + resolved "https://registry.yarnpkg.com/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz#b01cd42c1eed3d46db77a5966cf726f8c09160c6" + integrity sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA== + +"d3-interpolate@1 - 3", "d3-interpolate@1.2.0 - 3", d3-interpolate@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz#3c47aa5b32c5b3dfb56ef3fd4342078a632b400d" + integrity sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g== + dependencies: + d3-color "1 - 3" + +"d3-path@1 - 3", d3-path@3, d3-path@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-3.1.0.tgz#22df939032fb5a71ae8b1800d61ddb7851c42526" + integrity sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ== + +d3-polygon@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-polygon/-/d3-polygon-3.0.1.tgz#0b45d3dd1c48a29c8e057e6135693ec80bf16398" + integrity sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg== + +"d3-quadtree@1 - 3", d3-quadtree@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-quadtree/-/d3-quadtree-3.0.1.tgz#6dca3e8be2b393c9a9d514dabbd80a92deef1a4f" + integrity sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw== + +d3-random@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-random/-/d3-random-3.0.1.tgz#d4926378d333d9c0bfd1e6fa0194d30aebaa20f4" + integrity sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ== + +d3-scale-chromatic@3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz#34c39da298b23c20e02f1a4b239bd0f22e7f1314" + integrity sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ== + dependencies: + d3-color "1 - 3" + d3-interpolate "1 - 3" + +d3-scale@4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-4.0.2.tgz#82b38e8e8ff7080764f8dcec77bd4be393689396" + integrity sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ== + dependencies: + d3-array "2.10.0 - 3" + d3-format "1 - 3" + d3-interpolate "1.2.0 - 3" + d3-time "2.1.1 - 3" + d3-time-format "2 - 4" + +"d3-selection@2 - 3", d3-selection@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-3.0.0.tgz#c25338207efa72cc5b9bd1458a1a41901f1e1b31" + integrity sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ== + +d3-shape@3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-3.2.0.tgz#a1a839cbd9ba45f28674c69d7f855bcf91dfc6a5" + integrity sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA== + dependencies: + d3-path "^3.1.0" + +"d3-time-format@2 - 4", d3-time-format@4: + version "4.1.0" + resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-4.1.0.tgz#7ab5257a5041d11ecb4fe70a5c7d16a195bb408a" + integrity sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg== + dependencies: + d3-time "1 - 3" + +"d3-time@1 - 3", "d3-time@2.1.1 - 3", d3-time@3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-3.1.0.tgz#9310db56e992e3c0175e1ef385e545e48a9bb5c7" + integrity sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q== + dependencies: + d3-array "2 - 3" + +"d3-timer@1 - 3", d3-timer@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-timer/-/d3-timer-3.0.1.tgz#6284d2a2708285b1abb7e201eda4380af35e63b0" + integrity sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA== + +"d3-transition@2 - 3", d3-transition@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-transition/-/d3-transition-3.0.1.tgz#6869fdde1448868077fdd5989200cb61b2a1645f" + integrity sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w== + dependencies: + d3-color "1 - 3" + d3-dispatch "1 - 3" + d3-ease "1 - 3" + d3-interpolate "1 - 3" + d3-timer "1 - 3" + +d3-zoom@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-zoom/-/d3-zoom-3.0.0.tgz#d13f4165c73217ffeaa54295cd6969b3e7aee8f3" + integrity sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw== + dependencies: + d3-dispatch "1 - 3" + d3-drag "2 - 3" + d3-interpolate "1 - 3" + d3-selection "2 - 3" + d3-transition "2 - 3" + +d3@^7.9.0: + version "7.9.0" + resolved "https://registry.yarnpkg.com/d3/-/d3-7.9.0.tgz#579e7acb3d749caf8860bd1741ae8d371070cd5d" + integrity sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA== + dependencies: + d3-array "3" + d3-axis "3" + d3-brush "3" + d3-chord "3" + d3-color "3" + d3-contour "4" + d3-delaunay "6" + d3-dispatch "3" + d3-drag "3" + d3-dsv "3" + d3-ease "3" + d3-fetch "3" + d3-force "3" + d3-format "3" + d3-geo "3" + d3-hierarchy "3" + d3-interpolate "3" + d3-path "3" + d3-polygon "3" + d3-quadtree "3" + d3-random "3" + d3-scale "4" + d3-scale-chromatic "3" + d3-selection "3" + d3-shape "3" + d3-time "3" + d3-time-format "4" + d3-timer "3" + d3-transition "3" + d3-zoom "3" + debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -687,6 +950,13 @@ decode-named-character-reference@^1.0.0: dependencies: character-entities "^2.0.0" +delaunator@5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-5.0.1.tgz#39032b08053923e924d6094fe2cde1a99cc51278" + integrity sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw== + dependencies: + robust-predicates "^3.0.2" + dequal@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" @@ -828,7 +1098,7 @@ html-url-attributes@^3.0.0: resolved "https://registry.yarnpkg.com/html-url-attributes/-/html-url-attributes-3.0.0.tgz#fc4abf0c3fb437e2329c678b80abb3c62cff6f08" integrity sha512-/sXbVCWayk6GDVg3ctOX6nxaVj7So40FcFAnWlWGNAB1LpYKcV5Cd10APjPjW80O7zYW2MsjBV4zZ7IZO5fVow== -iconv-lite@^0.6.3: +iconv-lite@0.6, iconv-lite@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== @@ -845,6 +1115,18 @@ inline-style-parser@0.2.3: resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.2.3.tgz#e35c5fb45f3a83ed7849fe487336eb7efa25971c" integrity sha512-qlD8YNDqyTKTyuITrDOffsl6Tdhv+UC4hcdAVuQsK4IMQ99nSgd1MIA/Q+jQYoh9r3hVUXhYh7urSRmXPkW04g== +"internmap@1 - 2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/internmap/-/internmap-2.0.3.tgz#6685f23755e43c524e251d29cbc97248e3061009" + integrity sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg== + +interval-tree-1d@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/interval-tree-1d/-/interval-tree-1d-1.0.4.tgz#b44f657de7ddae69ea3f98e0a9ad4bb046b07d11" + integrity sha512-wY8QJH+6wNI0uh4pDQzMvl+478Qh7Rl4qLmqiluxALlNvl+I+o5x38Pw3/z7mDPTPS1dQalZJXsmbvxx5gclhQ== + dependencies: + binary-search-bounds "^2.0.0" + is-alphabetical@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" @@ -878,6 +1160,11 @@ is-what@^3.14.1: resolved "https://registry.yarnpkg.com/is-what/-/is-what-3.14.1.tgz#e1222f46ddda85dead0fd1c9df131760e77755c1" integrity sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA== +isoformat@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/isoformat/-/isoformat-0.2.1.tgz#2526344a4276a101b2881848dc337d1d2ae74494" + integrity sha512-tFLRAygk9NqrRPhJSnNGh7g7oaVWDwR0wKh/GM2LgmPa50Eg4UfyaCO4I8k6EqJHl1/uh2RAD6g06n5ygEnrjQ== + jotai@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jotai/-/jotai-2.8.0.tgz#5a6585cd5576c400c2c5f8e157b83ad2ba70b2ab" @@ -1559,6 +1846,11 @@ remark-stringify@^11.0.0: mdast-util-to-markdown "^2.0.0" unified "^11.0.0" +robust-predicates@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/robust-predicates/-/robust-predicates-3.0.2.tgz#d5b28528c4824d20fc48df1928d41d9efa1ad771" + integrity sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg== + rollup@^4.13.0: version "4.17.2" resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.17.2.tgz#26d1785d0144122277fdb20ab3a24729ae68301f" @@ -1584,6 +1876,11 @@ rollup@^4.13.0: "@rollup/rollup-win32-x64-msvc" "4.17.2" fsevents "~2.3.2" +rw@1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" + integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ== + rxjs@^7.8.1: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" From 1290d5639706ea7ad4e82221627046e31fad7ae6 Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Tue, 14 May 2024 16:53:56 -0700 Subject: [PATCH 2/9] feat: allow user-supplied function to run plot This allows user to customize their plot as desired. It does not allow arbitrary data to be used yet. --- frontend/app/block/plotblock.less | 0 frontend/app/block/plotblock.tsx | 34 +++++++++++++++++++++++-------- package.json | 3 ++- 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 frontend/app/block/plotblock.less diff --git a/frontend/app/block/plotblock.less b/frontend/app/block/plotblock.less new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/app/block/plotblock.tsx b/frontend/app/block/plotblock.tsx index 4efdfd852..671ee5113 100644 --- a/frontend/app/block/plotblock.tsx +++ b/frontend/app/block/plotblock.tsx @@ -12,6 +12,7 @@ function PlotConfig() { function PlotBlock() { const containerRef = React.useRef(); + const [plotDef, setPlotDef] = React.useState(); const [data, setData] = React.useState(); React.useEffect(() => { @@ -19,11 +20,9 @@ function PlotBlock() { }, []); React.useEffect(() => { - if (data === undefined) { - return; - } // replace start - const plot = Plot.plot({ + /* + return Plot.plot({ aspectRatio: 1, x: { label: "Age (years)" }, y: { @@ -45,18 +44,37 @@ function PlotBlock() { Plot.ruleY([0]), ], }); + */ // replace end - containerRef.current.append(plot); + let plot; + let plotErr; + try { + console.log(plotDef); + plot = new Function("Plot", "data", plotDef)(Plot, data); + } catch (e) { + plotErr = e; + console.log("error: ", e); + return; + } + console.log(plot); + + if (plot !== undefined) { + containerRef.current.append(plot); + } else { + // todo + } return () => { - plot.remove(); + if (plot !== undefined) { + plot.remove(); + } }; - }, [data]); + }, [data, plotDef]); return (
- + setPlotDef(e.target.value)} />
); } diff --git a/package.json b/package.json index c4a410a0c..caf31073b 100644 --- a/package.json +++ b/package.json @@ -31,5 +31,6 @@ "remark-gfm": "^4.0.0", "rxjs": "^7.8.1", "uuid": "^9.0.1" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } From 1f85bfe9446ba7a7d797baea9fbf947db620d71a Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Wed, 15 May 2024 12:05:36 -0700 Subject: [PATCH 3/9] fix: remove hardcoded data state This adds an example that works to load in data properly without the hard-coded data --- frontend/app/block/plotblock.tsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/app/block/plotblock.tsx b/frontend/app/block/plotblock.tsx index 671ee5113..33608a8be 100644 --- a/frontend/app/block/plotblock.tsx +++ b/frontend/app/block/plotblock.tsx @@ -10,18 +10,35 @@ function PlotConfig() { return ; } +const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor; + +function evalAsync(Plot: any, d3: any, funcText: string): Promise { + return new Promise((resolve, reject) => { + new AsyncFunction( + "resolve", + "reject", + "Plot", + "d3", + `try { await ${funcText}; resolve(); } catch(e) { reject(e); } }` + )(resolve, reject, Plot, d3); + }); +} + function PlotBlock() { const containerRef = React.useRef(); const [plotDef, setPlotDef] = React.useState(); + /* const [data, setData] = React.useState(); React.useEffect(() => { d3.csv("/plotdata/congress.csv", d3.autoType).then(setData); }, []); + */ React.useEffect(() => { // replace start /* + d3.csv("/plotdata/congress.csv", d3.autoType).then((out) => data = out) return Plot.plot({ aspectRatio: 1, x: { label: "Age (years)" }, @@ -50,7 +67,9 @@ function PlotBlock() { let plotErr; try { console.log(plotDef); - plot = new Function("Plot", "data", plotDef)(Plot, data); + plot = new Function("Plot", "d3", plotDef)(Plot, d3); + //plot = new Function("Plot", "data", "d3", plotDef)(Plot, data, d3); + //evalAsync(Plot, d3, plotDef).then((out) => (plot = out)); } catch (e) { plotErr = e; console.log("error: ", e); @@ -69,7 +88,7 @@ function PlotBlock() { plot.remove(); } }; - }, [data, plotDef]); + }, [plotDef]); return (
From e0a02733097cf97ac791095debfbc7ac69224285 Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Wed, 15 May 2024 13:04:16 -0700 Subject: [PATCH 4/9] fix: switch input to textarea --- frontend/app/block/plotblock.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/app/block/plotblock.tsx b/frontend/app/block/plotblock.tsx index 33608a8be..04653e027 100644 --- a/frontend/app/block/plotblock.tsx +++ b/frontend/app/block/plotblock.tsx @@ -38,7 +38,7 @@ function PlotBlock() { React.useEffect(() => { // replace start /* - d3.csv("/plotdata/congress.csv", d3.autoType).then((out) => data = out) + d3.csv("/plotdata/congress.csv", d3.autoType).then((out) => data = out); return Plot.plot({ aspectRatio: 1, x: { label: "Age (years)" }, @@ -92,8 +92,9 @@ function PlotBlock() { return (
+ ß
- setPlotDef(e.target.value)} /> +