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

@vue-pivottable/multi-value-renderer

v0.6.0

Published

Multi-value aggregator renderer for vue-pivottable (Vue 2/3 compatible)

Readme

@vue-pivottable/multi-value-renderer

Multi-value aggregator renderer for vue-pivottable. Display multiple aggregated values per cell, each with its own aggregation function.

Demo

Screenshots

Vue 3 - PivotTable

Vue 3 Example

Vue 3 - PivotTable UI

Vue 3 UI Example

Vue 2 - PivotTable

Vue 2 Example

Vue 2 - PivotTable UI

Vue 2 UI Example

Features

  • Multiple Values per Cell: Display sales (Sum), quantity (Average), and more in a single pivot table cell
  • Vue 2 & Vue 3 Support: Works with both vue-pivottable (Vue 2) and vue3-pivottable (Vue 3)
  • Flexible Layout: Choose between vertical, horizontal, or compact cell layouts
  • Custom Value Labels: Display user-friendly labels for each value column
  • Full Integration: Works with existing vue-pivottable features like click callbacks, labels, and totals

Installation

npm install @vue-pivottable/multi-value-renderer

# or
pnpm add @vue-pivottable/multi-value-renderer

Usage

Vue 3

<template>
  <VuePivottable
    :data="data"
    :rows="['region']"
    :cols="['product']"
    :vals="['sales', 'quantity']"
    :renderers="renderers"
    renderer-name="Multi-Value Table"
    :aggregator-map="aggregatorMap"
  />
</template>

<script setup>
import { VuePivottable, PivotUtilities } from 'vue-pivottable'
import { MultiValueRenderers } from '@vue-pivottable/multi-value-renderer'

const data = [
  { region: 'East', product: 'Apple', sales: 100, quantity: 10 },
  { region: 'East', product: 'Banana', sales: 80, quantity: 20 },
  // ...
]

const renderers = {
  ...MultiValueRenderers
}

// Different aggregation for each value
const aggregatorMap = {
  sales: 'Sum',
  quantity: 'Average'
}
</script>

Vue 2

<template>
  <VuePivottable
    :data="data"
    :rows="['region']"
    :cols="['product']"
    :vals="['sales', 'quantity']"
    :renderers="renderers"
    renderer-name="Multi-Value Table"
    :aggregator-map="aggregatorMap"
  />
</template>

<script>
import { VuePivottable } from 'vue-pivottable'
import { MultiValueRenderers } from '@vue-pivottable/multi-value-renderer/vue2'

export default {
  components: { VuePivottable },
  data() {
    return {
      data: [
        { region: 'East', product: 'Apple', sales: 100, quantity: 10 },
        // ...
      ],
      renderers: { ...MultiValueRenderers },
      aggregatorMap: {
        sales: 'Sum',
        quantity: 'Average'
      }
    }
  }
}
</script>

Props

aggregatorMap

Map of value column names to aggregator names.

{
  sales: 'Sum',
  quantity: 'Average',
  profit: 'Maximum'
}

cellLayout

How to display multiple values in each cell:

  • 'vertical' (default): Stack values vertically
  • 'horizontal': Display values side by side
  • 'compact': Show values separated by " / "

showValueLabels

Whether to show labels before each value (default: true).

valueLabels

Custom display labels for value columns:

{
  sales: 'Total Sales',
  quantity: 'Avg Qty'
}

Styling

Import the included CSS for default styling:

import '@vue-pivottable/multi-value-renderer/styles.css'

Or customize with your own CSS targeting these classes:

  • .multi-value-cell - Cell container
  • .multi-value-item - Individual value row
  • .multi-value-label - Value label (e.g., "Sales:")
  • .multi-value-value - The actual value
  • .layout-vertical, .layout-horizontal - Layout modifiers

Available Aggregators

The renderer supports all aggregators from vue-pivottable:

Single-Input Aggregators

  • Count
  • Count Unique Values
  • List Unique Values
  • Sum
  • Integer Sum
  • Average
  • Median
  • Minimum
  • Maximum
  • First
  • Last
  • Sample Variance
  • Sample Standard Deviation

Multi-Input Aggregators

Multi-input aggregators (like Sum over Sum) compute relationships between two fields. When selected, an additional field selector appears in the UI.

  • Sum over Sum - Calculates sum(field1) / sum(field2)
  • Sum as Fraction of Total
  • Sum as Fraction of Rows
  • Sum as Fraction of Columns
  • Count as Fraction of Total
  • Count as Fraction of Rows
  • Count as Fraction of Columns

Configuration Format

For multi-input aggregators, use an object format in aggregatorMap:

const aggregatorMap = {
  // Single-input: string format
  sales: 'Sum',
  quantity: 'Average',

  // Multi-input: object format with fields array
  unit_price: {
    aggregator: 'Sum over Sum',
    fields: ['sales', 'quantity']  // sum(sales) / sum(quantity)
  }
}

Helper Function

Use getAggregatorNumInputs to check if an aggregator requires multiple inputs:

import { getAggregatorNumInputs } from '@vue-pivottable/multi-value-renderer/vue3'

const numInputs = getAggregatorNumInputs(aggregators['Sum over Sum'])
// Returns 2 for multi-input aggregators

License

MIT