diff options
Diffstat (limited to 'src/scraping')
-rw-r--r-- | src/scraping/buxton/scraper.py | 6 | ||||
-rw-r--r-- | src/scraping/buxton/scripts/initialization.txt | 46 | ||||
-rw-r--r-- | src/scraping/buxton/scripts/layout.txt | 1 |
3 files changed, 2 insertions, 51 deletions
diff --git a/src/scraping/buxton/scraper.py b/src/scraping/buxton/scraper.py index 1c19118fd..807216ef1 100644 --- a/src/scraping/buxton/scraper.py +++ b/src/scraping/buxton/scraper.py @@ -131,8 +131,7 @@ def write_text_doc(content): "x": 10, "y": 10, "width": 400, - "zIndex": 2, - "libraryBrush": False + "zIndex": 2 }, "__type": "Doc" } @@ -184,8 +183,7 @@ def write_image(folder, name): "x": 10, "y": 10, "width": min(800, native_width), - "zIndex": 2, - "libraryBrush": False + "zIndex": 2 }, "__type": "Doc" } diff --git a/src/scraping/buxton/scripts/initialization.txt b/src/scraping/buxton/scripts/initialization.txt deleted file mode 100644 index 53f3f0d53..000000000 --- a/src/scraping/buxton/scripts/initialization.txt +++ /dev/null @@ -1,46 +0,0 @@ -const field = collection.pivotField || "title"; -const width = collection.pivotWidth || 200; - -const groups = new Map; - -for (const doc of docs) { - const val = doc[field]; - if (val === undefined) continue; - - const l = groups.get(val); - if (l) { - l.push(doc); - } else { - groups.set(val, [doc]); - } - -} - -let minSize = Infinity; - -groups.forEach((val, key) => { - minSize = Math.min(minSize, val.length); -}); - -const numCols = collection.pivotNumColumns || Math.ceil(Math.sqrt(minSize)); - -const docMap = new Map; -const groupNames = []; - -let x = 0; -groups.forEach((val, key) => { - let y = 0; - let xCount = 0; - groupNames.push({type:"text", text:String(key), x, y:width + 50, width: width * 1.25 * numCols, height:100, fontSize:collection.pivotFontSize}); - for (const doc of val) { - docMap.set(doc, {x: x + xCount * width * 1.25, y:-y, width, height:width}); - xCount++; - if (xCount >= numCols) { - xCount = 0; - y += width * 1.25; - } - } - x += width * 1.25 * (numCols + 1); -}); - -return {state:{ map: docMap}, views:groupNames };
\ No newline at end of file diff --git a/src/scraping/buxton/scripts/layout.txt b/src/scraping/buxton/scripts/layout.txt deleted file mode 100644 index 46b6dbaac..000000000 --- a/src/scraping/buxton/scripts/layout.txt +++ /dev/null @@ -1 +0,0 @@ -return state.map.get(doc)
\ No newline at end of file |