polygon-points points) (apply string-append (map (lambda (pt) (string-append (number->string (car pt)) "," (number->string (cadr pt)) " ")) points))) (define (header-script) "var traces= new Array(); traces['ct-counterterrorism'] = new Array('Terrorist Data', 'Secure Flight', 'FBI CRS'); traces['ct-criminal-law-enforcement'] = new Array('Lexis Data', 'Secure Flight', 'FBI CRS'); traces['criminal-law-enforcement'] =new Array('PNR', 'Secure Flight', 'FBI CRS', 'USMS-WIN'); traces['civil-law-enforcement']= new Array('Terrorist Data', 'Secure Flight', 'FBI CRS'); var xvals = new Array(); xvals['ct-counterterrorism'] = 10; xvals['ct-criminal-law-enforcement'] = 20; xvals['criminal-law-enforcement'] = 30; xvals['civil-law-enforcement'] = 40; var colors = new Array(); colors['ct-counterterrorism'] = 'red'; colors['ct-criminal-law-enforcement'] = 'green'; colors['criminal-law-enforcement'] = 'blue'; colors['civil-law-enforcement']= 'yellow'; function makeLine(purpose, x1, y1, x2, y2){ color = colors[purpose]; newLine = document.createElementNS('http://www.w3.org/2000/svg', 'line'); newLine.setAttribute('x1', x1); newLine.setAttribute('y1', y1); newLine.setAttribute('x2', x2); newLine.setAttribute('y2', y2); newLine.setAttribute('stroke', color); newLine.setAttribute('stroke-width', '3'); newLine.setAttribute('z-index', '6'); //newLine.setAttribute('id', purpose); return newLine };") (define (make-callback node-value nextnode-value) (string-append "document.getElementById('node-name').innerHTML = '" "Transfer from " node-value " to " nextnode-value "';document.getElementById('node-description').innerHTML ='" (cadr (assoc nextnode-value purpose-descriptions)) "'" )) (define checkbox-callback " myGroup = document.getElementById(this.name); if(this.checked){ for (var i = 0; ipolygon-points (rotated-triangle (+ 275 (/ (- xval 200) 10)) ; (+ yval 60) ; 7.5 ; (- (atan 40 (- 200 xval)) 1.5707)))) "") labeled-box ) labeled-box))) (define (render-set set nextnode xval yval) (if (null? set) '() (append (render-node (car set) nextnode xval yval) (render-set (cdr set) nextnode (+ xval 200) yval)))) (define (process nodes yval) (if (null? nodes) '() (let ((nextnode (if (null? (cdr nodes)) #f (cadr nodes)))) (append (if (list? (car nodes)) (render-set (car nodes) nextnode 0 yval) (render-node (car nodes) nextnode 200 yval)) (process (cdr nodes) (+ yval 75)))))) (emit (standard-head "SVG Mockup") (html:b #f "This page describes how data item #34 in USMS-WIN came to have no allowed purposes") (html:script #f (header-script)) (html:table #f (html:tr #f (html:td #f (svg:svg (attributes 'xmlns:svg "http://www.w3.org/2000/svg") (append (purpose-groups (list "ct-counterterrorism" "ct-criminal-law-enforcement" "criminal-law-enforcement" "civil-law-enforcement")) (process nodes 10)))) (html:td (attributes 'valign "top" 'width 400) (html:table #f (html:tr #f (html:th (attributes 'class "subject-name") (html:b #f "Selected Transfer"))) (html:tr #f (html:div (attributes 'id "node-name"))) (html:tr #f (html:th (attributes 'class "subject-name") (html:b #f "Purpose Highlighter"))) (html:tr #f (html:td #f (html:form #f (html:input (attributes 'type "checkbox" 'name "ct-counterterrorism" 'onclick checkbox-callback)) "ct-counterterrorism" (html:br) (html:input (attributes 'type "checkbox" 'name "ct-criminal-law-enforcement" 'onclick checkbox-callback)) "ct-criminal-law-enforcement" (html:br) (html:input (attributes 'type "checkbox" 'name "criminal-law-enforcement" 'onclick checkbox-callback)) "criminal-law-enforcement" (html:br) (html:input (attributes 'type "checkbox" 'name "civil-law-enforcement" 'onclick checkbox-callback)) "civil-law-enforcement"))) (html:tr #f (html:th (attributes 'class "subject-name") (html:b #f "Purpose Transformation"))) (html:tr #f (html:td #f (html:div (attributes 'id "node-description") "")))))))) ?>