Skip to content

Commit 4ce0cba

Browse files
committed
Updates and zoom fiddling.
1 parent d564d56 commit 4ce0cba

2 files changed

Lines changed: 50 additions & 27 deletions

File tree

src/dataflows/bfi-na.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A (emailed): Not intentional, just reflecting what I'd thought about, and my foc
2626

2727
Note focus on acquisition of born digital material, digitisation is not covered in detail. This covers A/V and images, not documents, which are not currently preserved actively
2828

29-
## Digital Preservation Infrastructure (DPI) Dataflow
29+
## Ingest & Preservation
3030

3131
The following dataflow diagram summarises the flow of data into the BFI National Archive's Digital Preservation Infrastructure (DPI). This bitstream preservation dataflow is shared across all content streams.
3232

@@ -197,23 +197,22 @@ end
197197
```
198198

199199

200-
At the end of the ingest process, there are immediately accessible 'access copies' (DIPs) and the 'preservation copies' (AIPs) are stored on multiple tapes. The Collections Information Database (CID) contains all metadata needed for management and discovery of content, along with the appropriate identifier for the information packages that contain the digital assets. The CID remains the master metadata store, and this metadata is preserved independently of the DPI.
200+
At the end of the ingest process, there are immediately accessible 'access copies' (DIPs) and the 'preservation copies' (AIPs) are stored on multiple tapes. The Collections Information Database (CID) contains all metadata needed for management and discovery of content, along with the appropriate identifier for the information packages that contain the digital assets. CID remains the master metadata store, and this metadata is preserved independently of DPI (unique identifier is the join key).
201201

202202
The code for the core `autoingest job` and related workflows is here: [bfidatadigipres/BFI_scripts](https://github.com/bfidatadigipres/BFI_scripts).
203203

204-
## Access Dataflow
204+
## Internet Access For Public Users
205205

206206
There are two different modes of access. Some content is available over the public web (rights clearance required), while virtually all collection material is discoverable via the collections search and is available on site, by submitting an access request.
207207

208-
### Internet Access
209208

210209
Public internet access uses the 'access copies':
211210

212211
```dataflow
213212
dataflow 1.0
214213
title "BFI National Archive Public Access Workflow"
215-
zoom 0.84
216-
offset 0 0
214+
zoom 1.0
215+
offset 25 25
217216
height 300
218217
219218
data request "User Request/Query" black
@@ -259,7 +258,7 @@ move dip@website dip@internet "Deliver DIP"@W
259258
end
260259
```
261260

262-
### On-Site Access
261+
## On-Premises Access For Public Users
263262

264263
Only BFI staff are able to access the highest-quality (very high bitrate) 'preservation copies'. These copies are retrieved from tape on demand:
265264

@@ -320,6 +319,10 @@ delete aip_tape@tape1 "Unload\nTape"
320319
end
321320
```
322321

322+
## BFI Network Access For Staff Users
323+
324+
...
325+
323326
## Content Streams
324327

325328
Some links and notes about the details on the content stream variations are given below.

src/dataflows/dataflows.js

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -550,28 +550,36 @@ export async function generateDataflow(dfl) {
550550
.attr('type', 'text/css')
551551
.text("@import url('https://fonts.googleapis.com/css?family=Hammersmith+One');");
552552

553-
// Set up zoom:
554-
const zoom = d3.zoom().scaleExtent([0.1, 6]).on("zoom", zoomed);
555-
556-
var zoomContainer = svg.call(zoom);
557-
var initialScale = wf.initialZoom || 0.75;
558-
var initialTranslate = wf.initialOffset || undefined; // e.g. [100,10] percentages of the total w/h
553+
const zoomToInit = function () {
554+
// Set up zoom:
555+
const zoom = d3.zoom().scaleExtent([0.2, 6]).on("zoom", zoomed);
556+
557+
var zoomContainer = svg.call(zoom);
558+
var initialScale = wf.initialZoom || 0.75;
559+
var initialTranslate = wf.initialOffset || undefined; // e.g. [100,10] percentages of the total w/h
559560

560-
zoom.scaleTo(zoomContainer, initialScale);
561-
if( initialTranslate ) {
562-
zoom.translateTo(
563-
zoomContainer,
564-
(0.5-initialTranslate[0]/100)*width,
565-
(0.5-initialTranslate[1]/100)*height
566-
);
561+
//console.log(width, height);
562+
//console.log(div.offsetWidth, div.offsetHeight);
563+
//console.log(zoomContainer, initialScale, initialTranslate);
564+
zoom.scaleTo(zoomContainer, initialScale);
565+
if( initialTranslate ) {
566+
zoom.translateTo(
567+
zoomContainer,
568+
(0.5 - initialTranslate[0]/100.0)*width,
569+
(0.5 - initialTranslate[1]/100.0)*height
570+
);
571+
}
567572
}
568573

574+
zoomToInit();
575+
569576
function zoomed(event) {
570577
svg.select("g").attr("transform", event.transform.toString());
571578
}
572579

573580
// Attach a reference here so we can use it from the client:
574581
div.svg = svg;
582+
div.zoomToInit = zoomToInit;
575583

576584

577585
return div;
@@ -689,9 +697,9 @@ export function rasterize(svg) {
689697
}
690698

691699
// Support full-screen mode:
692-
function toggleFullscreen(element) {
700+
function toggleFullscreen(dataflow) {
693701
if(!document.fullscreenElement) {
694-
element.requestFullscreen();
702+
dataflow.requestFullscreen();
695703
} else {
696704
document.exitFullscreen();
697705
}
@@ -736,18 +744,24 @@ export async function renderDataflows() {
736744
const save_button = Inputs.button("SVG", {value: serialize(dataflow.svg.node()), reduce: saveSvg, disabled: false });
737745
save_button.style.position = 'absolute';
738746
save_button.style.left = '3px';
739-
save_button.style.top = '26px';
747+
save_button.style.top = '1px';
748+
save_button.style.width = 'auto';
740749
dataflow.insertAdjacentElement('afterBegin', save_button);
741750
const save_png_button = Inputs.button("PNG", {value: await rasterize(dataflow.svg.node()), reduce: saveImage, disabled: false });
742751
save_png_button.style.position = 'absolute';
743-
save_png_button.style.left = '3px';
744-
save_png_button.style.top = '51px';
752+
save_png_button.style.left = '51px';
753+
save_png_button.style.top = '1px';
754+
save_png_button.style.width = 'auto';
745755
dataflow.insertAdjacentElement('afterBegin', save_png_button);
746756

747-
const fullscreen_button = Inputs.button("Toggle Fullscreen View", { value: dataflow, reduce: toggleFullscreen, disabled: false });
757+
const fullscreen_button = Inputs.button("Toggle Fullscreen");
748758
fullscreen_button.style.position = 'absolute';
749-
fullscreen_button.style.left = '3px';
759+
fullscreen_button.style.left = '100px';
750760
fullscreen_button.style.top = '1px';
761+
fullscreen_button.style.width = 'auto';
762+
fullscreen_button.onclick = function() {
763+
toggleFullscreen(dataflow);
764+
}
751765
dataflow.insertAdjacentElement('afterBegin', fullscreen_button);
752766

753767
// Support full-screen mode:
@@ -758,6 +772,12 @@ export async function renderDataflows() {
758772
toggleFullscreen(dataflow);
759773
}
760774
});
775+
// Reset zoom when fullscreen mode changes:
776+
//dataflow.addEventListener("fullscreenchange", function () {
777+
// dataflow.zoomToInit();
778+
//});
779+
780+
761781
// And ensure tooltips show...
762782
enableTooltips(dataflow);
763783
}

0 commit comments

Comments
 (0)