-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start working on plot github issues example
- Loading branch information
Showing
12 changed files
with
1,090 additions
and
130 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
|
||
/* HEADER STYLES */ | ||
#observablehq-header a[href] { | ||
color: inherit; | ||
} | ||
|
||
#observablehq-header a[target="_blank"] { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.25rem; | ||
text-decoration: none; | ||
} | ||
|
||
#observablehq-header a[target="_blank"]:hover span { | ||
text-decoration: underline; | ||
} | ||
|
||
#observablehq-header a[target="_blank"]::after { | ||
content: "↗"; | ||
} | ||
|
||
@container not (min-width: 640px) { | ||
.hide-if-small { | ||
display: none; | ||
} | ||
} | ||
|
||
|
||
/* DOCUMENTATION STYLES */ | ||
.pageshot { | ||
width: 60%; | ||
} | ||
.screenshot { | ||
width: 55%; | ||
margin: 0 24px; | ||
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3); | ||
margin-bottom: 16px; | ||
} | ||
|
||
@container not (min-width: 640px) { | ||
.pageshot { | ||
width: 100%; | ||
} | ||
.screenshot { | ||
width: 100%; | ||
} | ||
} | ||
|
||
|
||
.static-table input[type=checkbox] { | ||
display: none; | ||
} | ||
|
||
|
||
/* HULL COMPONENT */ | ||
.hull { | ||
display: block; | ||
} | ||
|
||
/* TOOLTIP STYLES */ | ||
.tooltip { | ||
position: absolute; | ||
pointer-events: none; | ||
z-index: 1000; | ||
background-color: white; | ||
padding: 8px; | ||
border-radius: 4px; | ||
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3); | ||
} | ||
|
||
.cluster-content { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.cluster-plot { | ||
background-color: white; | ||
padding: 4px; | ||
border-radius: 4px; | ||
margin: 6px; | ||
width: 300px; | ||
max-width: 300px; | ||
display: inline-block; | ||
} | ||
.cluster-description { | ||
margin: 6px; | ||
padding: 4px; | ||
} | ||
|
||
.cluster-card .static-table { | ||
margin-top: 6px; | ||
} | ||
|
||
.cluster-card .static-table thead th { | ||
background: #f0f0f0; | ||
} | ||
|
||
@container not (min-width: 640px) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
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"; | ||
|
||
export function clusterCard(cluster, description, tableConfig, da, scope) { | ||
const cda = da.filter(d => d.cluster == cluster) | ||
return html`<div class="cluster-card grid grid-cols-1"> | ||
<div class="card"> | ||
<h2>Cluster ${cluster}: ${scope.cluster_labels_lookup[cluster].label}</h2> | ||
<h3>${cda.length} rows</h3> | ||
<div class="cluster-content"> | ||
<div class="cluster-plot"> | ||
${ | ||
Plot.plot({ | ||
marks: [ | ||
Plot.dot(da, { | ||
x: "x", | ||
y: "y", | ||
fill: "lightgray", | ||
}), | ||
Plot.dot(da, { | ||
filter: d => d.cluster == cluster, | ||
x: "x", | ||
y: "y", | ||
fill: "cluster", | ||
}) | ||
], | ||
width: 300, | ||
height: 300, | ||
color: { scheme: "cool" }, | ||
y: { axis: null}, | ||
x: { axis: null } | ||
}) | ||
} | ||
</div> | ||
<div class="cluster-description"> | ||
${description} | ||
</div> | ||
</div> | ||
<div class="static-table"> | ||
${Inputs.table(cda, tableConfig)} | ||
</div> | ||
</div>` | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.