Skip to content

Commit

Permalink
fix link to csv
Browse files Browse the repository at this point in the history
  • Loading branch information
enjalot committed May 13, 2024
1 parent ab5b55f commit 6560761
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 16 deletions.
75 changes: 75 additions & 0 deletions _import/components/clusterListCard.c2fe14e1.js
Original file line number Diff line number Diff line change
@@ -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`<div class="cluster-card grid grid-cols-1">
<div class="card">
<h2>${heading}</h2>
<h3>${cda.length} rows</h3>
<div class="cluster-content grid grid-cols-3">
<div class="cluster-plot">
${
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
}
}
})
}
</div>
<div class="cluster-description">
${cos.map(c => html`${c.cluster}: ${c.label}<br>`)}
</div>
<div class="cluster-diagram">
${plot}
</div>
</div>
<div class="static-table">
${Inputs.table(cda, tableConfig)}
</div>
</div>`
}

2 changes: 1 addition & 1 deletion datavis-survey.html
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,6 @@ <h1>Survey Analysis Example</h1>
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./exporting-data"><span>Exporting data</span></a><a rel="next" href="./plot-issues"><span>GitHub Issues &amp; PRs</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
6 changes: 3 additions & 3 deletions enjalot-tweets.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<link rel="modulepreload" href="./_import/components/hull.f981bcf2.js">
<link rel="modulepreload" href="./_import/components/tooltip.c593267a.js">
<link rel="modulepreload" href="./_import/components/clusterCard.eba8a284.js">
<link rel="modulepreload" href="./_import/components/clusterListCard.2bd231cb.js">
<link rel="modulepreload" href="./_import/components/clusterListCard.c2fe14e1.js">
<link rel="modulepreload" href="./_node/markdown-it@14.0.0/index.js">
<link rel="modulepreload" href="./_npm/d3-array@3.2.4/_esm.js">
<link rel="modulepreload" href="./_npm/regl-scatterplot@1.8.5/_esm.js">
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -680,6 +680,6 @@ <h2 id="filtering-on-metadata" tabindex="-1"><a class="observablehq-header-ancho
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./plot-issues"><span>GitHub Issues &amp; PRs</span></a><a rel="next" href="./us-federal-laws"><span>US Federal Laws</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
2 changes: 1 addition & 1 deletion explore-and-curate.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ <h1 id="export" tabindex="-1"><a class="observablehq-header-anchor" href="#expor
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./your-first-scope"><span>Your First Scope</span></a><a rel="next" href="./exporting-data"><span>Exporting data</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
2 changes: 1 addition & 1 deletion exporting-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ <h1 id="tags" tabindex="-1"><a class="observablehq-header-anchor" href="#tags">T
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./explore-and-curate"><span>Explore and Curate</span></a><a rel="next" href="./datavis-survey"><span>Datavis Survey</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ <h2 id="design-principles" tabindex="-1"><a class="observablehq-header-anchor" h
</main>
<footer id="observablehq-footer">
<nav><a rel="next" href="./install-and-config"><span>Install &amp; Configure</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
2 changes: 1 addition & 1 deletion install-and-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ <h2 id="third-party-api-keys" tabindex="-1"><a class="observablehq-header-anchor
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./"><span>Latent Scope</span></a><a rel="next" href="./your-first-scope"><span>Your First Scope</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
2 changes: 1 addition & 1 deletion plot-issues.html
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,6 @@ <h1 id="github-issues-%26-prs" tabindex="-1"><a class="observablehq-header-ancho
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./datavis-survey"><span>Datavis Survey</span></a><a rel="next" href="./enjalot-tweets"><span>enjalot&#x27;s tweets</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
14 changes: 9 additions & 5 deletions us-federal-laws.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<link rel="modulepreload" href="./_import/components/dynamicHull.09110e6a.js">
<link rel="modulepreload" href="./_import/components/tooltip.c593267a.js">
<link rel="modulepreload" href="./_import/components/clusterCard.eba8a284.js">
<link rel="modulepreload" href="./_import/components/clusterListCard.2bd231cb.js">
<link rel="modulepreload" href="./_import/components/clusterListCard.c2fe14e1.js">
<link rel="modulepreload" href="./_node/markdown-it@14.0.0/index.js">
<link rel="modulepreload" href="./_npm/d3-selection@3.0.0/_esm.js">
<link rel="modulepreload" href="./_npm/d3-array@3.2.4/_esm.js">
Expand Down Expand Up @@ -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",
Expand All @@ -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
}),
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -695,7 +699,7 @@ <h2 id="civil-rights" tabindex="-1"><a class="observablehq-header-anchor" href="
<p>I wasn't able to identify clusters that related specifically to civil rights, but thanks to the embeddings I was able to use nearest neighbor search to find 150 laws that are related to the concept of civil rights.</p>
<div id="cell-e16e65c2" class="observablehq observablehq--block"></div>
<div class="card">
<div id="cell-c042747d" class="observablehq observablehq--block observablehq--loading"></div>
<div id="cell-e64a9588" class="observablehq observablehq--block observablehq--loading"></div>
<div class="static-table">
<span id="cell-60c87720" class="observablehq--loading"></span>
</div>
Expand Down Expand Up @@ -725,6 +729,6 @@ <h2 id="civil-rights" tabindex="-1"><a class="observablehq-header-anchor" href="
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./enjalot-tweets"><span>enjalot&#x27;s tweets</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>
4 changes: 2 additions & 2 deletions your-first-scope.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<main id="observablehq-main" class="observablehq">
<h1 id="your-first-scope" tabindex="-1"><a class="observablehq-header-anchor" href="#your-first-scope">Your First Scope</a></h1>
<p>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 <a href="https://storage.googleapis.com/fun-data/latent-scope/examples/dvs-survey/datavis-misunderstood.csv" target="_blank" rel="noopener noreferrer">download this csv</a>
To use the sample data you can <a href="https://storage.googleapis.com/fun-data/latent-scope/examples/dvs-survey/datavis-notunderstood.csv" target="_blank" rel="noopener noreferrer">download this csv</a>
of survey questions and answers extracted from the <a href="https://gist.github.com/curran/003cca0643e9947162359268821415f5" target="_blank" rel="noopener noreferrer">2022 Data Visualization Society annual survey</a>.</p>
<h1 id="starting-the-tool" tabindex="-1"><a class="observablehq-header-anchor" href="#starting-the-tool">Starting the tool</a></h1>
<p>If you've already <a href="install-and-config">installed &amp; configured</a> Latent Scope, you can start the web UI</p>
Expand Down Expand Up @@ -155,6 +155,6 @@ <h1 id="save-scope" tabindex="-1"><a class="observablehq-header-anchor" href="#s
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./install-and-config"><span>Install &amp; Configure</span></a><a rel="next" href="./explore-and-curate"><span>Explore and Curate</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-10T15:08:00">May 10, 2024</a>.</div>
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-05-13T09:35:53">May 13, 2024</a>.</div>
</footer>
</div>

0 comments on commit 6560761

Please sign in to comment.