File: files.js

package info (click to toggle)
libreswan 5.2-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 81,632 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (18 lines) | stat: -rw-r--r-- 378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function files(files_json, files_id) {

    // convert to a list
    let files = Object.entries(files_json).map((entry, index) => {
	return { "name": entry[0], "url": entry[1] }
    })

    d3.select("div#"+files_id)
	.selectAll("a")
	.data(files)
	.enter()
	.append("div")
	.append("a")
	.attr("href", (file) => file.url)
	.attr("class", "file")
	.text((file) => file.name)

}