From 65607611ec042e3c550aebec2c7ef3136d72c9ac Mon Sep 17 00:00:00 2001 From: Ian Johnson Date: Mon, 13 May 2024 09:36:03 -0400 Subject: [PATCH] fix link to csv --- .../components/clusterListCard.c2fe14e1.js | 75 +++++++++++++++++++ datavis-survey.html | 2 +- enjalot-tweets.html | 6 +- explore-and-curate.html | 2 +- exporting-data.html | 2 +- index.html | 2 +- install-and-config.html | 2 +- plot-issues.html | 2 +- us-federal-laws.html | 14 ++-- your-first-scope.html | 4 +- 10 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 _import/components/clusterListCard.c2fe14e1.js diff --git a/_import/components/clusterListCard.c2fe14e1.js b/_import/components/clusterListCard.c2fe14e1.js new file mode 100644 index 0000000..b7d1263 --- /dev/null +++ b/_import/components/clusterListCard.c2fe14e1.js @@ -0,0 +1,75 @@ +import {html} from "../../_npm/htl@0.3.1/_esm.js"; +import * as Inputs from "../../_observablehq/stdlib/inputs.js"; +import * as Plot from "../../_npm/@observablehq/plot@0.6.14/_esm.js"; + +// cluster is the cluster index +export function clusterListCard(clusters, { + heading, + description, + plot, + tableConfig, + da, + scope, + hulls, +}) { + const cda = da.filter(d => clusters.indexOf(d.cluster) >= 0) + const cos = clusters.map(c => scope.cluster_labels_lookup[c]) + return html`
+
+

${heading}

+

${cda.length} rows

+
+
+ ${ + Plot.plot({ + marks: [ + Plot.hull(hulls.flatMap(d => d), { + x: "x", + y: "y", + z: "cluster", + // fill: "cluster", + fill: "lightgray", + fillOpacity: 0.1, + stroke: "lightgray", + curve: "catmull-rom", + }), + Plot.hull(hulls.flatMap(d => d), { + filter: d => clusters.indexOf(d.cluster) >= 0, + x: "x", + y: "y", + z: "cluster", + // fill: "cluster", + fill: "orange", + fillOpacity: 0.25, + // stroke: "cluster", + stroke: "orange", + curve: "catmull-rom", + }), + ], + width: 300, + height: 300, + color: { scheme: "cool" }, + y: { axis: null}, + x: { axis: null }, + tip: { + format: { + cluster: true, + title: true + } + } + }) + } +
+
+ ${cos.map(c => html`${c.cluster}: ${c.label}
`)} +
+
+ ${plot} +
+
+
+ ${Inputs.table(cda, tableConfig)} +
+
` +} + diff --git a/datavis-survey.html b/datavis-survey.html index 1fccdb9..d8114f3 100644 --- a/datavis-survey.html +++ b/datavis-survey.html @@ -426,6 +426,6 @@

Survey Analysis Example

diff --git a/enjalot-tweets.html b/enjalot-tweets.html index 9d1efc4..e0cbd4b 100644 --- a/enjalot-tweets.html +++ b/enjalot-tweets.html @@ -16,7 +16,7 @@ - + @@ -506,7 +506,7 @@ }}); define({id: "bdbd85b8", outputs: ["scatter","hull","tooltip","clusterCard","clusterListCard","markdownit","min","max","sum"], body: async () => { -const [{scatter}, {hull}, {tooltip}, {clusterCard}, {clusterListCard}, {default: markdownit}, {min, max, sum}] = await Promise.all([import("./_import/components/scatter.e6a504c8.js"), import("./_import/components/hull.f981bcf2.js"), import("./_import/components/tooltip.c593267a.js"), import("./_import/components/clusterCard.eba8a284.js"), import("./_import/components/clusterListCard.2bd231cb.js"), import("./_node/markdown-it@14.0.0/index.js"), import("./_npm/d3-array@3.2.4/_esm.js")]); +const [{scatter}, {hull}, {tooltip}, {clusterCard}, {clusterListCard}, {default: markdownit}, {min, max, sum}] = await Promise.all([import("./_import/components/scatter.e6a504c8.js"), import("./_import/components/hull.f981bcf2.js"), import("./_import/components/tooltip.c593267a.js"), import("./_import/components/clusterCard.eba8a284.js"), import("./_import/components/clusterListCard.c2fe14e1.js"), import("./_node/markdown-it@14.0.0/index.js"), import("./_npm/d3-array@3.2.4/_esm.js")]); return {scatter,hull,tooltip,clusterCard,clusterListCard,markdownit,min,max,sum}; @@ -680,6 +680,6 @@

-
Built with Observable on May 10, 2024.
+
Built with Observable on May 13, 2024.
diff --git a/explore-and-curate.html b/explore-and-curate.html index 14669cc..d8b2870 100644 --- a/explore-and-curate.html +++ b/explore-and-curate.html @@ -141,6 +141,6 @@

-
Built with Observable on May 10, 2024.
+
Built with Observable on May 13, 2024.
diff --git a/exporting-data.html b/exporting-data.html index c729564..5f61f68 100644 --- a/exporting-data.html +++ b/exporting-data.html @@ -163,6 +163,6 @@

T diff --git a/index.html b/index.html index 8fd64cc..cbac088 100644 --- a/index.html +++ b/index.html @@ -148,6 +148,6 @@

diff --git a/install-and-config.html b/install-and-config.html index decc0c6..062345a 100644 --- a/install-and-config.html +++ b/install-and-config.html @@ -123,6 +123,6 @@

-
Built with Observable on May 10, 2024.
+
Built with Observable on May 13, 2024.
diff --git a/plot-issues.html b/plot-issues.html index 799e48e..42c265e 100644 --- a/plot-issues.html +++ b/plot-issues.html @@ -578,6 +578,6 @@

-
Built with Observable on May 10, 2024.
+
Built with Observable on May 13, 2024.
diff --git a/us-federal-laws.html b/us-federal-laws.html index 2349a79..342f254 100644 --- a/us-federal-laws.html +++ b/us-federal-laws.html @@ -17,7 +17,7 @@ - + @@ -331,13 +331,14 @@ return {civilRights}; }}); -define({id: "c042747d", inputs: ["Plot","hulls","civilRights","display"], body: async (Plot,hulls,civilRights,display) => { +define({id: "e64a9588", inputs: ["Plot","hulls","civilRights","display"], body: async (Plot,hulls,civilRights,display) => { display(await( Plot.plot({ marks: [ Plot.hull(hulls.flatMap(d => d), { x: "x", y: "y", + z: "cluster", fill: "cluster", fillOpacity: 0.1, stroke: "lightgray", @@ -347,7 +348,10 @@ Plot.dot(civilRights, { x: "x", y: "y", + z: "cluster", + r: 2, fill: "cluster", + fill: "gray", title: d => `${d.Title}\n${d.date_of_passage}\n${d.cluster}: ${d.label}`, tip: true }), @@ -502,7 +506,7 @@ }}); define({id: "bf752053", outputs: ["scatter","hull","dynamicHull","tooltip","clusterCard","clusterListCard","markdownit","select","min","max","sum","mean"], body: async () => { -const [{scatter}, {hull}, {dynamicHull}, {tooltip}, {clusterCard}, {clusterListCard}, {default: markdownit}, {select}, {min, max, sum, mean}] = await Promise.all([import("./_import/components/scatter.e6a504c8.js"), import("./_import/components/hull.f981bcf2.js"), import("./_import/components/dynamicHull.09110e6a.js"), import("./_import/components/tooltip.c593267a.js"), import("./_import/components/clusterCard.eba8a284.js"), import("./_import/components/clusterListCard.2bd231cb.js"), import("./_node/markdown-it@14.0.0/index.js"), import("./_npm/d3-selection@3.0.0/_esm.js"), import("./_npm/d3-array@3.2.4/_esm.js")]); +const [{scatter}, {hull}, {dynamicHull}, {tooltip}, {clusterCard}, {clusterListCard}, {default: markdownit}, {select}, {min, max, sum, mean}] = await Promise.all([import("./_import/components/scatter.e6a504c8.js"), import("./_import/components/hull.f981bcf2.js"), import("./_import/components/dynamicHull.09110e6a.js"), import("./_import/components/tooltip.c593267a.js"), import("./_import/components/clusterCard.eba8a284.js"), import("./_import/components/clusterListCard.c2fe14e1.js"), import("./_node/markdown-it@14.0.0/index.js"), import("./_npm/d3-selection@3.0.0/_esm.js"), import("./_npm/d3-array@3.2.4/_esm.js")]); return {scatter,hull,dynamicHull,tooltip,clusterCard,clusterListCard,markdownit,select,min,max,sum,mean}; @@ -695,7 +699,7 @@

diff --git a/your-first-scope.html b/your-first-scope.html index 3a6804f..8d80945 100644 --- a/your-first-scope.html +++ b/your-first-scope.html @@ -91,7 +91,7 @@

Your First Scope

Let's walk through creating your first scope. You can use the sample data in this guide or use your own data and follow along. -To use the sample data you can download this csv +To use the sample data you can download this csv of survey questions and answers extracted from the 2022 Data Visualization Society annual survey.

Starting the tool

If you've already installed & configured Latent Scope, you can start the web UI

@@ -155,6 +155,6 @@

-
Built with Observable on May 10, 2024.
+
Built with Observable on May 13, 2024.