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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lumel/ap-viz-sdk

v0.0.3

Published

SDK for building custom data app in Analytics Plus

Readme

@lumel/ap-viz-sdk

SDK for building custom data apps in Analytics Plus.

Installation

npm install @lumel/ap-viz-sdk

Getting Started with ApViz CLI

The fastest way to create a new Analytics Plus app is using the ApViz CLI:

# Install ApViz CLI globally
npm install -g @lumel/ap-viz-cli

# Create a new React TypeScript app
apviz create my-analytics-app --template react-ts
cd my-analytics-app
npm start

Quick Start

import { ApVizSdk, IApVizSdkProps, EApUpdateType } from '@lumel/ap-viz-sdk';

// Configure your app
const config: IApVizSdkProps = {
    configurations: {
        pivot: {
            // Your pivot configuration
        },
    },
    update: (props) => {
        // Handle data updates
        switch (props.type) {
            case EApUpdateType.DATA:
                // Update your app with new data
                renderApp(props.data, props.element);
                break;
            case EApUpdateType.APP_RESIZE:
                // Handle resize events
                resizeApp(props.viewport);
                break;
        }
    },
};

// Register your application
const appHost = ApVizSdk.register(config);

React TypeScript Example

Here's a complete example using React and TypeScript:

import React, { useEffect, useState } from 'react';
import { createRoot } from 'react-dom/client';
import { ApVizSdk, IApVizSdkProps, EApUpdateType, IApUpdateProps } from '@lumel/ap-viz-sdk';

interface AppProps {
    data?: any;
    viewport?: { width: number; height: number };
}

const MyAnalyticsApp: React.FC<AppProps> = ({ data, viewport }) => {
    const [chartData, setChartData] = useState(null);

    useEffect(() => {
        if (data) {
            // Process your data here
            setChartData(data);
        }
    }, [data]);

    return (
        <div style={{ width: viewport?.width, height: viewport?.height }}>
            <h2>My Analytics App</h2>
            {chartData && (
                <div>
                    {/* Your visualization components */}
                    <p>Data loaded: {JSON.stringify(chartData)}</p>
                </div>
            )}
        </div>
    );
};

// App configuration
const config: IApVizSdkProps = {
    configurations: {
        pivot: {
            // Your pivot configuration
        },
    },
    update: (props: IApUpdateProps) => {
        const container = props.element;
        const root = createRoot(container);

        root.render(<MyAnalyticsApp data={props.data} viewport={props.viewport} />);
    },
};

// Initialize the app
const appHost = ApVizSdk.register(config);

// Use SDK features
appHost.selectionManager.select([{ queryName: 'Category', selectionId: 'value1' }]);
appHost.persistProperties({ theme: 'dark', showLabels: true });

Core Features

Data Selection Management

// Select data points
appHost.selectionManager.select([{ queryName: 'Category', selectionId: 'electronics' }]);

// Clear selections
appHost.selectionManager.clear();

Drill-down Operations

import { DrillType } from '@lumel/ap-viz-sdk';

// Drill down to next level
appHost.drillManager.drill([{ queryName: 'Category', drillType: DrillType.DOWN }]);

// Drill up to previous level
appHost.drillManager.drill([{ queryName: 'Category', drillType: DrillType.UP }]);

State Persistence

// Persist custom properties
appHost.persistProperties({
    customSettings: { theme: 'dark', showLabels: true },
    filters: { category: 'electronics' },
});

API Reference

ApVizSdk

Main SDK class providing the entry point for application registration.

Methods

  • ApVizSdk.register(config: IApVizSdkProps): AppHost - Registers a new visualization application

AppHost

Manages application lifecycle and communication with the parent Power BI environment.

Properties

  • selectionManager: SelectionManagerService - Handles data point selections
  • drillManager: DrillManagerService - Manages drill-down operations

Methods

  • persistProperties(properties: TPersistProperties): void - Persists custom properties

Configuration Types

IApVizSdkProps

interface IApVizSdkProps {
    configurations: {
        pivot: IPivotConfiguration;
    };
    update: (props: IApUpdateProps) => void;
}

IApUpdateProps

interface IApUpdateProps {
    type: EApUpdateType;
    element: HTMLElement;
    viewport: IDimension;
    data: DataView;
    state: TPersistProperties;
}

Update Types

  • EApUpdateType.DATA - Triggered when data changes
  • EApUpdateType.APP_RESIZE - Triggered when visualization container is resized

TypeScript Support

This package includes full TypeScript definitions. Import types as needed:

import { IApVizSdkProps, IApUpdateProps, EApUpdateType, DrillType, ISelectionId } from '@lumel/ap-viz-sdk';

License

ISC

Examples and Templates

Get started quickly with our templates:

  • React TypeScript: apviz create my-app --template react-ts
  • Vanilla TypeScript: apviz create my-app --template vanilla-ts
  • React JavaScript: apviz create my-app --template react-js

ApViz CLI Commands

# Create new app
apviz create <app-name> --template <template-name>

# Build for production
apviz build

Support

For issues and questions, please refer to the package repository or contact Lumel support.