Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/document-issue-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ Copy the scripts in `SECRETS` folder into the gitignored `SECRETS` folder in the
Run the following `pixi` tasks, from the project ROOT folder, in the order shown to update the data.

```bash
# execute line by line in the root of the project
# -------------------------
pixi run chmod-scripts
pixi run mnt-jdrive
pixi run get-data # gets raw doc issue data
pixi run pull-data # get previously found data
pixi run find-files
pixi run push-data # push found files back to jobs folder
pixi run cp-to-dashboard # copy data to dashboard directory

# view the dashboard
pixi run dashboard-install # if not already installed
pixi run dashboard-preview
```
55 changes: 55 additions & 0 deletions packages/document-issue-data/dashboard/src/_index_wip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Latest Issued Documents
theme: dashboard
toc: false
---

## Latest Issued Documents

```js
const data = FileAttachment("data/latest_found.csv").csv({typed: true});
```

```js
const unique_systems = [...new Set(data.map(d => d.system))].filter(d => d != null && d !== "");
```

```js
const filters = view(Inputs.form({
search: Inputs.search(data, {placeholder: "Global search..."}),
system: Inputs.select(unique_systems, {
label: "System",
multiple: true,
unique: true,
sort: true,
placeholder: "All systems",
allowClear: true // <-- Add this line
})
}));
```

```js
const filtered = data.filter(d => {
// Robustly extract the search string
let search = "";
if (typeof filters.search?.value === "string") {
search = filters.search.value.toLowerCase();
} else if (typeof filters.search === "string") {
search = filters.search.toLowerCase();
}
const matchesSearch = !search || Object.values(d).some(v => (v + "").toLowerCase().includes(search));
const matchesSystem = !filters.system?.length || filters.system.includes(d.system);
return matchesSearch && matchesSystem;
});
```

```js
Inputs.table(
filtered, {
format: {
project: d3.format("d"), // format as "1960" rather than "1,960"
link: id => htl.html`<a href=mfllp:explorer.exe?${id} target=_blank>🔗</a>`
},
rows: 40})
```

13 changes: 7 additions & 6 deletions packages/document-issue-data/dashboard/src/index.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
---
title: Latest Issued Documents
theme: dashboard
# theme: [light, dark, alt, wide]
toc: false
---

## Latest Issued Documents

```js
const docs = FileAttachment("data/latest_found.csv").csv({typed: true});
const data = FileAttachment("data/latest_found.csv").csv({typed: true});
```

```js
const search_docs = view(Inputs.search(docs, {placeholder: "Search docs"}));
const filtered = view(Inputs.search(data));

```


```js
Inputs.table(search_docs, {
Inputs.table(filtered, {
format: {
project: d3.format("d"), // format as "1960" rather than "1,960"
project: d3.format("d"),
link: id => htl.html`<a href=mfllp:explorer.exe?${id} target=_blank>🔗</a>`
},
rows : 40
rows: 40
})
```
Loading