UNPKG

agentscape

Version:

Agentscape is a library for creating agent-based simulations. It provides a simple API for defining agents and their behavior, and for defining the environment in which the agents interact. Agentscape is designed to be flexible and extensible, allowing

19 lines 813 B
import { parse } from 'marked'; export default class InfoPane { constructor(opts) { const { title = 'About', width = 300, height = 500 } = opts; const draggable = document.createElement('drag-pane'); draggable.setAttribute('heading', title); draggable.setAttribute('key', opts.id); const infoContent = document.createElement('div'); infoContent.style.width = width + 'px'; infoContent.style.height = height + 'px'; infoContent.style.padding = '5px'; infoContent.style.textAlign = 'justify'; infoContent.style.overflowY = 'scroll'; infoContent.innerHTML = parse(opts.info, { async: false }); draggable.appendChild(infoContent); opts.root.appendChild(draggable); } } //# sourceMappingURL=InfoPane.js.map