screeps-viz
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    screeps-viz

    sample dashboard

    A visualization library for Screeps

    Installation

    Install via npm:

    npm install screeps-viz
    

    Usage

    This library is designed around functional programming principles. Until we have better documentation, please consult the source and tests for each widget for its expected parameters, and see src/demo.ts for examples.

    Widgets

    Most of the widgets will use a pattern like this, passing in a function that will be invoked each tick to get the current data & configuration.

    const barWidget = Bar(() => ({
        data: {
            value: Game.time % 20,
            maxValue: 20
        },
        config: {
            label: 'Bar 1',
            style: {
                stroke: 'red',
                fill: 'red',
                lineStyle: 'dashed'
            }
        }
    })

    Dashboard

    The Dashboard itself takes a list of Widgets with position & size information and renders each.

    export function loop() {
        Dashboard({ 
            widgets: [{
                x: 1,
                y: 1,
                width: 5,
                height: 10,
                widget: barWidget
            }]
        })
    }

    Install

    npm i screeps-viz

    DownloadsWeekly Downloads

    4

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    92.2 kB

    Total Files

    28

    Last publish

    Collaborators

    • glitchassassin