npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@univerjs-pro/bases-dashboard

v1.0.4

Published

Pivot views and dashboards for Univer Base.

Readme

@univerjs-pro/bases-dashboard

npm version license downloads

@univerjs-pro/bases-dashboard provides Base Pivot View calculation, Dashboard persistence, commands, Worker RPC, and Facade APIs.

Package Overview

| Package | UMD global | CSS | Locales | Facade entry | | --- | --- | :---: | :---: | :---: | | @univerjs-pro/bases-dashboard | UniverProBasesDashboard | No | Yes | Yes |

Installation

pnpm add @univerjs-pro/bases-dashboard
# or
npm install @univerjs-pro/bases-dashboard

Keep all @univerjs/* and @univerjs-pro/* packages on the same version.

Usage

Register UniverBaseDashboardPlugin after the Base plugin. In a Worker runtime, register it with notExecuteCalculation: false; on the main thread use true. Omit the option to calculate in the same thread.

Import @univerjs-pro/bases-dashboard/facade to extend the Base Facade with Dashboard and Pivot View APIs.

The executable example below expects the active Base to contain an orders table with region and revenue fields.

Facade API

The Base Facade owns Dashboard resources and Pivot View references. Pivot field configuration and calculation stay in @univerjs-pro/engine-pivot; Chart models and builders stay in @univerjs-pro/engine-chart.

import type { FUniver } from '@univerjs/core/facade';
import { ChartTypeBits } from '@univerjs-pro/engine-chart';
import { PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
import { ShapeTypeEnum } from '@univerjs-pro/engine-shape';
import { createFormulaShapeData } from '@univerjs-pro/shape-editor';
import {
    BaseFilterConjunction,
    BaseFilterOperator,
    ImageSourceType,
    RichTextBuilder,
} from '@univerjs/core';
import '@univerjs-pro/bases/facade';
import '@univerjs-pro/bases-dashboard/facade';

async function createSalesDashboard(univerAPI: FUniver) {
    const base = univerAPI.getActiveBase();
    if (!base) {
        throw new Error('No active Base.');
    }

    const table = base.getTableById('orders');
    if (!table) {
        throw new Error('Orders table not found.');
    }

    const pivotView = base.createPivotView('Revenue by region', table.getId(), {
        id: 'revenue-by-region',
        config: {
            chart: { type: ChartTypeBits.Column, orient: 'column' },
        },
    });

    const pivotTable = pivotView.getPivotTable();
    pivotTable.reset();
    const region = pivotTable.addFieldWithSourceId('region', PivotTableFiledAreaEnum.Row);
    const revenue = pivotTable.addFieldWithSourceId('revenue', PivotTableFiledAreaEnum.Value);
    if (!region || !revenue) {
        throw new Error('Expected region and revenue fields in the Orders table.');
    }
    if (!pivotView.updateConfig({ pivot: pivotTable.toJSON() })) {
        throw new Error('Failed to update the Pivot View.');
    }

    const dashboard = base.createDashboard('Executive overview', { id: 'executive-overview' });
    dashboard.addPivotChart(table.getId(), pivotView.getId(), {
        id: 'revenue-chart',
        layout: { column: 0, row: 0, columnSpan: 6, rowSpan: 6 },
    });
    dashboard.addTableFilter(table.getId(), {
        id: 'region-filter',
        filter: {
            conjunction: BaseFilterConjunction.AND,
            conditions: [{ fieldId: 'region', operator: BaseFilterOperator.IS, operand: 'APAC' }],
        },
        layout: { column: 6, row: 0, columnSpan: 6, rowSpan: 2 },
    });
    dashboard.addText({
        id: 'summary',
        document: RichTextBuilder.create().text('Revenue increased by 18%.').getData(),
        appearance: { backgroundColor: '#F8FAFC', textColor: '#111827', alignment: 'left' },
        layout: { column: 0, row: 6, columnSpan: 4, rowSpan: 4 },
    });
    dashboard.addImage({
        id: 'strategy-image',
        source: 'https://example.com/strategy.png',
        sourceType: ImageSourceType.URL,
        alt: 'FY26 growth strategy',
        displayMode: 'cover',
        layout: { column: 4, row: 6, columnSpan: 4, rowSpan: 4 },
    });
    dashboard.addFormulaShape(table.getId(), {
        id: 'total-revenue',
        shapeType: ShapeTypeEnum.RoundRect,
        shapeData: createFormulaShapeData({ formula: '=SUM(Orders[Revenue])' }),
        appearance: { backgroundColor: '#EEF2FF', textColor: '#4338CA', alignment: 'center' },
        layout: { column: 8, row: 6, columnSpan: 4, rowSpan: 4 },
    });
    dashboard.moveWidget('total-revenue', 0);

    return pivotView.calculate();
}

For a regular hosted Chart, keep using the Engine Chart Facade, for example worksheet.newChart(type).setSource(range).build() followed by worksheet.insertChart(chartInfo). Dashboard Charts do not duplicate that host lifecycle: they reference a Base Pivot View and may store Dashboard-local presentation overrides only.

Integration Notes

  • Keep all @univerjs/* and @univerjs-pro/* packages on the same version.
  • Merge the locale resources for each language enabled by your application.
  • Import @univerjs-pro/bases-dashboard/facade when using the package through Univer Facade APIs.

Resources