marvel-sitemap
Install:
npm install marvel-sitemap --save
Usage:
import Sitemap from 'marvel-sitemap'
const options = {
canvasId : 'myCanvajs', // <canvas> element id
id: '2aah1d9', // marvel vanity id
}
// initiate a sitemap component in a canvas element
const sitemap = new Sitemap(options);
// initiate the load of the sitemap
sitemap.load()
.then(() => {
console.log('Sitemap Loaded')
})
// update a config property
sitemap.update({ scale: .4, lineColor: '#ccffbb' })
// config properties available:
{
scale: 0.2,
spacingX: 150,
spacingY: 50,
marginX: 30,
marginY: 80,
maxPerRow: 10,
maxPerColumn: 6,
lineWidth: 2,
arrow: 3,
radius: 5,
corridorMargin: 20,
useSingleColor: false,
joinLines: false,
lineColor: '#000000',
hotspotColor: '#0087ff',
};
// when you are done...
sitemap.destroy()
Publish
npm run build
npm publish