dashed links
This commit is contained in:
+18
-4
@@ -3,20 +3,34 @@ const fs = require('fs');
|
||||
const rendering = require('./src/rendering')({
|
||||
'scale': 0.05,
|
||||
'h-spacing': 1,
|
||||
beautify: true,
|
||||
});
|
||||
|
||||
['default', 'double', 'line'].forEach(type => {
|
||||
fs.writeFileSync(`preview/link-${type}.svg`, rendering.toXML({
|
||||
const g = [];
|
||||
|
||||
['default', 'line', 'double', 'split-double', 'dashed', 'dashed-line', 'dashed-double', 'dashed-split-double'].forEach((type, i) => {
|
||||
g.push({
|
||||
'g': {
|
||||
'_attributes': {
|
||||
'transform': 'translate(0 -128)'
|
||||
'transform': `translate(${(i % 2) * 1536 + 256} ${Math.floor(i / 2) * 712 + 150})`
|
||||
},
|
||||
'path': {
|
||||
'_attributes': {
|
||||
'd': rendering.getLinkPath(type, 2)
|
||||
}
|
||||
},
|
||||
'text': {
|
||||
'_attributes': {
|
||||
'x': 512,
|
||||
'y': 0,
|
||||
'font-family': 'Verdana',
|
||||
'font-size': 120,
|
||||
'text-anchor': 'middle'
|
||||
},
|
||||
'_text': type
|
||||
}
|
||||
}
|
||||
}, {w: 1024, h: 256}), {encoding: 'utf-8'});
|
||||
});
|
||||
});
|
||||
|
||||
fs.writeFileSync(`preview/links.svg`, rendering.toXML({'g': g}, {w: 1536 * 2, h: 4 * 712 + 100}), {encoding: 'utf-8'});
|
||||
Reference in New Issue
Block a user