import {D3Sel} from "../etc/Util"; import * as d3 from "d3"; export function createStaticSkeleton(base: D3Sel) { // ---- TEMPLATE ----- // language=HTML function template() { return `
Filters
Hide Special Tokens
Show top 70% of att:
Layer
Selected heads:

You focus on one token by click. You can mask any token by double click.

You can select and de-select a head by a click on the heatmap columns

` } base.html(template); // ---- TEMPLATE.end ----- /** * Top level sections */ const sentenceInput = base.select("#sentence-input"); const connectorContainer = base.select('#connector-container'); const atnControls = base.select('#connector-controls'); const atnContainer = base.select('#atn-container'); /** * Sentence Input */ const sentenceA = base.select('#form-sentence-a'); const formButton = base.select('#update-sentence'); /** * Connector Controls */ const modelSelector = base.select('#model-option-selector') const threshSlider = base.select('#my-range'); const layerCheckboxes = base.select('#layer-select'); const clsToggle = base.select('#cls-toggle'); const selectedHeads = base.select('#selected-heads'); const headSelectAll = base.select('#select-all-heads'); const headSelectNone = base.select('#select-no-heads'); /** * For main attention vis */ const headInfoBox = base.select('#head-info-box'); const headBoxLeft = base.select('#left-att-heads'); const tokensLeft = base.select('#left-tokens'); const atnDisplay = base.select('#atn-display'); const tokensRight = base.select('#right-tokens'); const headBoxRight = base.select('#right-att-heads'); /** * Return an object that provides handles to the important parts here */ return { body: d3.select('body'), atnContainer: atnContainer, atnDisplay: atnDisplay, atnHeads: { left: headBoxLeft, right: headBoxRight, headInfo: headInfoBox }, form: { sentenceA: sentenceA, button: formButton }, tokens: { left: tokensLeft, right: tokensRight }, modelSelector: modelSelector, clsToggle: clsToggle, layerCheckboxes: layerCheckboxes, selectedHeads: selectedHeads, headSelectAll: headSelectAll, headSelectNone: headSelectNone, threshSlider: threshSlider, } }