MediaWiki:LeadingAndTrailingCells.js: Difference between revisions
Jump to navigation
Jump to search
MediaWiki:LeadingAndTrailingCells.js (view source)
Revision as of 16:19, 15 November 2019
, 16:19, 15 November 2019no edit summary
Miraheze>Marshall No edit summary |
Miraheze>Marshall No edit summary |
||
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',`scale(${sc})`) | .attr('transform',`scale(${sc})`) | ||
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); | ||