Lineup Lite API Documentation

website·Indexed 30 days ago

https://lineup-lite.js.org/

API reference for Lineup Lite, featuring TypeDoc-generated documentation for hooks and interfaces. Includes detailed specifications for data statistics (INumericStats, ITextStats, ICategoricalStats, IDateStats), rendering options for charts and histograms, and table configuration interfaces such as UseSortingOptions and UseGroupingOptions.

Tokens
62.2K
Snippets
409
Records
601
Agent score
52%

What's inside Lineup Lite

  1. Overview of @lineup-lite/components

    The @lineup-lite/components package provides a set of basic React visualization components and methods for computing statistics. It supports several attribute types for data visualization, including text, categorical, categorical sets, numbers, number arrays, and dates.
  2. Overview of lineup-lite/table/modules API

    The lineup-lite/table/modules module provides a suite of tools for creating advanced data tables. It includes core table components (LineUpLite, LineUpLiteTR, LineUpLiteTD, etc.), state management providers, and a variety of column utility functions for defining data types (categorical, date, number, etc.).
  3. Overview of LineUp-lite features and architecture

    LineUp-lite is a lightweight React data table extension based on the headless react-table library. It is designed for the visual analysis of multi-attribute rankings and is written in TypeScript. It provides three levels of abstraction for developers: individual components, react-table hooks, and a high-level ready-to-use LineUpLite React component. Key features include interactive column filtering based on column type and built-in visual encodings for cells, aggregations, and summaries such as Bars, Histograms, and Boxplots.
  4. Use GitHub-flavored Markdown for content

    The product supports GitHub-flavored Markdown (GFM) for writing content. This includes standard headers (H1-H6), emphasis (italics, bold, strikethrough), lists (ordered and unordered), links, images, blockquotes, and tables.
  5. Access date statistics properties in IDateStats

    Use the following readonly properties of IDateStats to retrieve statistical data about a Date collection:

    • count: Total number of items in the array.
    • depth: The maximum nested depth if the array is nested.
    • flatCount: Total number of items when flattened.
    • flatItems: A readonly array of all Date items (readonly Date[]).
    • flatMissing: Number of missing items in the flattened array.
    • missing: Number of missing items in the array.
    • min: The minimum Date value in the array.
    • max: The maximum Date value in the array.
    • median: The median Date value in the array.
    • hist: The histogram data, represented as an array of IBin<Date>.
    • histGranularity: The granularity used to compute the histogram (of type DateHistGranularity).
    • maxBin: The bin containing the maximal number of items (IBin<Date>).
    • items: The raw items in the stats, which can be a Date, a readonly array of Dates, or a Set of Dates.
  6. Add a side panel overview to LineUp-lite

    Use the LineUpLitePanel component to provide a vertical overview of the table. To share state between the main table and the panel, both must be wrapped in a LineUpLiteStateContextProvider.
    import {
      LineUpLite,
      LineUpLiteStateContextProvider,
      LineUpLitePanel,
    } from '@lineup-lite/table';
    
    function App() {
      // ... data, columns, and features definitions ...
    
      return (
        <LineUpLiteStateContextProvider>
          <div style={{ display: 'flex', minHeight: '25em' }}>
            <div style={{ flexGrow: 1 }}>
              <LineUpLite data={data} columns={columns} features={features} />
            </div>
            <LineUpLitePanel style={{ minWidth: '15em' }} />
          </div>
        </LineUpLiteStateContextProvider>
      );
    }
  7. Understand LineUp-lite's relationship to react-table

    LineUp-lite is an extension and wrapper for the react-table library, designed to implement the LineUp ranking visualization technique. It offers two primary levels of abstraction:

    1. Hooks and Renderers: Provided by @lineup-lite/hooks, these offer extensions to react-table via additional React hooks and custom renderers.
    2. Component Wrapper: Provided by @lineup-lite/table, this offers a high-level wrapper that provides a single, ready-to-use LineUp-like React table component.
  8. TableInstance Interface Overview

    The TableInstance<D> interface is the core object for managing a table's state and behavior in LineUpLite. It is generic over type D, which represents the data object for a row and must extend object (defaulting to {}).
  9. Visualize categorical set columns in LineUp-lite

    LineUp-lite supports categorical set columns, which are rendered using a visualization technique inspired by UpSet. This allows for the representation of intersecting sets across different data categories.
  10. Lineup-lite API Component and Module Index

    The lineup-lite library provides a wide range of visualization components and utility functions for handling statistical data. Key available components include:

    • Charts & Plots: BoxPlot, BoxPlotArray, BoxPlotChart, Histogram, LineChart, MultiLineChart, HeatMap1D, StackedBar, DivergingNumberBar, and NumberBar.
    • Filters & UI: FilterBinHistogram, FilterRangeBoxPlot, FilterRangeHistogram, FilterSetHistogram, and FilterTextSummary.
    • Axes & Labels: ArrayAxis, DateLabel, TextLabel, NumberColor, and NumberSymbol.
    • Stats Generators: categoricalStatsGenerator, dateStatsGenerator, numberStatsGenerator, and textStatsGenerator.
    • Utility Functions: normalize, deNormalize, autoAssignColors, and various defaultColorScale variants.
  11. Reference the ICategoricalStats interface

    The ICategoricalStats interface (extending IHistStats<string>) represents a categorical statistics object used to analyze string-based data. It provides metadata about the distribution, nesting depth, and presence of missing values within a dataset.