2,951
edits
Miraheze>Marshall No edit summary |
m (Protected "MediaWiki:LeadingAndTrailingCells.js": Executed as JS ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
const sc = 0.7; | const sc = 0.7; | ||
let svg = d3.select('.LeadingAndTrailingCells') | let svg = d3.select('.LeadingAndTrailingCells') | ||
.append('svg').attrs({height: | .append('svg').attrs({height:820*sc, width:620*sc}) | ||
.append('g') | .append('g') | ||
.attr('transform', | .attr('transform',`scale(${sc})`) | ||
.attr('font-size',46) | .attr('font-size',46) | ||
.attr('text-anchor','middle'); | .attr('text-anchor','middle'); | ||
Line 29: | Line 29: | ||
H = (shape[0]*(1+shape[1])-1)*h; | H = (shape[0]*(1+shape[1])-1)*h; | ||
let gs = svg.selectAll().data(['Trailing','Leading']).enter() | let gs = svg.selectAll().data(['Trailing','Leading']).enter() | ||
.append('g').attr('transform',(_,i)=>`translate(${Wo+(W+Wg)*i}, | .append('g').attr('transform',(_,i)=>`translate(${Wo+(W+Wg)*i},70)`); | ||
gs.append('rect').attrs({x:-w/2,y:0,width:W+w,height:H,fill:'white'}); | gs.append('rect').attrs({x:-w/2,y:0,width:W+w,height:H,fill:'white'}); | ||
gs.append('text').text(t=>t).attrs({ x:W/2, y:-40, 'font-size':40, fill:'# | gs.append('text').text(t=>t).attrs({ x:W/2, y:-40, 'font-size':40, fill:'#6b6560' }); | ||
gs.attr('stroke-width',3); | gs.attr('stroke-width',3); | ||